首先是在netbeans 8.1中使用ireport 5.6.0插件。 当我启动IDE时问题开始了,在启动时我得到一个无提示错误: Error
这是完整的错误:
java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Caused: java.lang.ClassNotFoundException: org.w3c.dom.ElementTraversal
starting from ModuleCL@3b3c4010[org.netbeans.libs.xerces] with
possible defining loaders [ModuleCL@794617ef[com.jaspersoft.ireport]]
and declared parents ]
at org.netbeans.ProxyClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
Caused: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at org.netbeans.JarClassLoader.doLoadClass(Unknown Source)
Caused: java.lang.NoClassDefFoundError: org/w3c/dom/ElementTraversal
while loading org.apache.xerces.dom.ElementImpl; see
http://wiki.netbeans.org/DevFaqTroubleshootClassNotFound
at org.netbeans.ProxyClassLoader.selfLoadClass(Unknown Source)
at org.netbeans.ProxyClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.apache.xerces.parsers.AbstractDOMParser.startDocument(Unknown
Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startDocument(Unknown
Source)
at org.apache.xerces.impl.XMLDocumentScannerImpl.startEntity(Unknown
Source)
at org.apache.xerces.impl.XMLVersionDetector.startDocumentParsing(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at com.jaspersoft.ireport.designer.fonts.IRFontUtils.loadFonts(IRFontUtils.java:95)
at com.jaspersoft.ireport.designer.options.IReportPanel.updateFontsList(IReportPanel.java:3231)
at com.jaspersoft.ireport.designer.options.IReportPanel.load(IReportPanel.java:3215)
at com.jaspersoft.ireport.designer.options.IReportOptionsPanelController.update(IReportOptionsPanelController.java:64)
at org.netbeans.modules.options.CategoryModel$Category.update(Unknown Source)
at org.netbeans.modules.options.OptionsPanel.setCurrentCategory(Unknown Source)
at org.netbeans.modules.options.OptionsPanel.access$300(Unknown Source)
at org.netbeans.modules.options.OptionsPanel$CategoryButton.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Component.java:6539)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6304)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.awt.Container.dispatchEventImpl(Container.java:2283)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at org.netbeans.core.TimableEventQueue.dispatchEvent(Unknown Source)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
atjava.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
atjava.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
atjava.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
根据该消息,不会再发生任何问题,但是当我打开报表并尝试从中拖动任何项目时,即使它是静态文本也不会拖动它。 我对这个错误大加赞赏,他们谈论了一个jar文件(xml-apis-ext.jar)包含在项目中以消除该错误,但也许我添加的jar文件是错误的,因为当我单击它时会使用ireport选项给我同样的错误,我不知道如何将这个jar文件添加到ireports本身。 附注:我尝试重新安装该插件,并且在我卸载该插件时该错误消失了。