David, I have not played with netbeans but...
when resolving method "org.apache.xerces.dom.CoreDocumentImpl.getDoctype()Lorg/w3c/dom/DocumentTyp e;" the class loader (instance of org/netbeans/StandardModule$OneModuleClassLoader) of the current class, org/apache/xerces/dom/CoreDocumentImpl, and the class loader (instance of <bootloader>) for interface org/w3c/dom/Document have different Class objects for the type org/w3c/dom/DocumentType used in the signature indicates that 2 versions of org.w3c.dom.DocumentType have been loaded by the classloaders. This is probably a Xerces version issue. It also appears that NetBeans is using some form of OSGI classloader which may complicate the investigation a bit. Many web containers have the ability to reverse the order of class loading. Does Netbeans have this option and is it enabled? It seems that what is happening is that the w3c class is loaded from 2 different class loaders because the classes that use it are loaded in two different loaders and then references are passed from one to the other. In this case they could even be the same version and get a class cast exception. I suspect that this might be an issue with java and javax classes (though I am not certain how). java and javax classes are always loaded by the boot loader. If a javax/java class loaded the w3c class then I would expect the org/netbeans/StandardModule$OneModuleClassLoader to find it. So I suspect that the w3c class was loaded be the OneModuleClassLoader because it was not a java or javax package, then the root class loaded also loaded it because it was not found in it's context. However this can be difficult to determine. On some Java implementations there a -X switches that will provide a trace of the classes loaded by each loader. It can be verbose but may be the best way to debug this issue. Good luck, Claude On Sat, Sep 5, 2015 at 4:47 AM, David Moss <[email protected]> wrote: > I¹ve been trying to get my head around the Netbeans Platform lately. > In straight Java, written within the Netbeans IDE, my Jena programs work > fine. > When I try to use it from a wrapped library in a Netbeans Module in a > Netbeans Platform program however, it crashes. > > > The code is very straightforward: > > public class JenaTool { > > Logger logger = Logger.getLogger(JenaTool.class); > Properties properties = new Properties(); > File dataLocation; > Model m = ModelFactory.createDefaultModel(); > Š > > It crashes creating the model with the error below. > > I have the relevant imports from the wrapped library. Everything in the > Jena 3.0.0 lib folder is wrapped. > It compiles and fine but crashes as soon as it encounters > Model m = ModelFactory.createDefaultModel(); > > Is anyone else working with the Netbeans Platform? > Any tips? > > > SEVERE [global] > java.lang.LinkageError: loader constraint violation in interface itable > initialization: when resolving method > > "org.apache.xerces.dom.CoreDocumentImpl.getDoctype()Lorg/w3c/dom/DocumentTyp > e;" the class loader (instance of > org/netbeans/StandardModule$OneModuleClassLoader) of the current class, > org/apache/xerces/dom/CoreDocumentImpl, and the class loader (instance of > <bootloader>) for interface org/w3c/dom/Document have different Class > objects for the type org/w3c/dom/DocumentType used in the signature > 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 org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source) > at > > sun.util.xml.PlatformXmlPropertiesProvider.getLoadingDoc(PlatformXmlProperti > esProvider.java:106) > at > > sun.util.xml.PlatformXmlPropertiesProvider.load(PlatformXmlPropertiesProvide > r.java:78) > at java.util.Properties$XmlSupport.load(Properties.java:1201) > at java.util.Properties.loadFromXML(Properties.java:881) > at org.apache.jena.util.Metadata.read(Metadata.java:75) > at org.apache.jena.util.Metadata.addMetadata(Metadata.java:53) > at org.apache.jena.util.Metadata.<init>(Metadata.java:47) > at org.apache.jena.JenaRuntime.<clinit>(JenaRuntime.java:89) > at > org.apache.jena.rdf.model.impl.RDFReaderFImpl.reset(RDFReaderFImpl.java:80) > at > > org.apache.jena.rdf.model.impl.RDFReaderFImpl.<clinit>(RDFReaderFImpl.java:7 > 1) > at org.apache.jena.rdf.model.impl.ModelCom.<clinit>(ModelCom.java:53) > at > > org.apache.jena.rdf.model.ModelFactory.createDefaultModel(ModelFactory.java: > 113) > at info.admoss.jenatool.JenaTool.<init>(JenaTool.java:41) > at > > info.admoss.ui.outTopComponent.jButton1MouseReleased(outTopComponent.java:11 > 3) > at info.admoss.ui.outTopComponent.access$000(outTopComponent.java:40) > at info.admoss.ui.outTopComponent$1.mouseReleased(outTopComponent.java:66) > at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290) > at java.awt.Component.processMouseEvent(Component.java:6525) > at javax.swing.JComponent.processMouseEvent(JComponent.java:3324) > at java.awt.Component.processEvent(Component.java:6290) > at java.awt.Container.processEvent(Container.java:2234) > at java.awt.Component.dispatchEventImpl(Component.java:4881) > at java.awt.Container.dispatchEventImpl(Container.java:2292) > at java.awt.Component.dispatchEvent(Component.java:4703) > at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4898) > at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4533) > at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4462) > at java.awt.Container.dispatchEventImpl(Container.java:2278) > at java.awt.Window.dispatchEventImpl(Window.java:2750) > at java.awt.Component.dispatchEvent(Component.java:4703) > at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758) > 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$1.doIntersectionPrivilege(ProtectionDomain.ja > va:75) > at > > java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.ja > va:86) > at java.awt.EventQueue$4.run(EventQueue.java:731) > at java.awt.EventQueue$4.run(EventQueue.java:729) > at java.security.AccessController.doPrivileged(Native Method) > at > > java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.ja > va:75) > at java.awt.EventQueue.dispatchEvent(EventQueue.java:728) > at > > org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159 > ) > [catch] at > > java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java > :201) > at > > java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:11 > 6) > at > > java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java > :105) > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) > at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93) > at java.awt.EventDispatchThread.run(EventDispatchThread.java:82) > > > > > > -- I like: Like Like - The likeliest place on the web <http://like-like.xenei.com> LinkedIn: http://www.linkedin.com/in/claudewarren
