Plugin class loaders
Posted: Wed Jun 10, 2009 6:21 pm
Hi Again,
Still working on my webservice backed custom protocol handler.
I have nearly got it all working appart from the actual webservice interaction inside the plugin. I can run the core methods of my plugin as a stand alone application and everything works fine but when running as Oxygen plugin I get some class loader issues.
I am using a JAX-WS client in the plugin, and have the jars 'jaxws-rt.jar' and 'jaxws-api.jar' on my plugin classpath (set via plugin.xml). These are the Jax-RS RI 2.2RC1 versions of these files. There is some overlap with the WS implementation provided as part of the JRE that come with Oxygen. For an example lets take 'javax.xml.ws.WebFault'. This is loaded by oxygen using the system classloader from rt.jar at 'oxygen/jre/lib/rt.jar'. The version loaded is not the 2.2 version, and doesn't, for example, contain the method 'messageName'. Thus when I call Serfvice.getPort() to create my client object I get the following exception:
16:31:34,473 16 ERROR [ main ] ro.sync.exml.editor.WA - java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
at com.sun.xml.ws.model.RuntimeModeler.processExceptions(RuntimeModeler.java:1115)
at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:856)
at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:624)
at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:413)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:252)
at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:698)
at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:686)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:341)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:324)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:306)
at javax.xml.ws.Service.getPort(Unknown Source)
at uk.co.smg.acm.services.ws.client.WSDocumentServiceService.getWSDocumentServicePort(WSDocumentServiceService.java:56)
at uk.co.smg.acm.oxygen.protocol.athenaws.CLI.doIt(CLI.java:52)
at uk.co.smg.acm.oxygen.protocol.athenaws.WebserviceConnection.getInputStream(WebserviceConnection.java:343)
at ro.sync.exml.editor.FA.A(Unknown Source)
at ro.sync.exml.editor.FA.A(Unknown Source)
at ro.sync.exml.editor.pA.K(Unknown Source)
at ro.sync.exml.editor.a.f.K(Unknown Source)
at ro.sync.exml.editor.WA.K(Unknown Source)
at ro.sync.exml.editor.WA.K(Unknown Source)
at ro.sync.exml.editor.WA.open(Unknown Source)
at ro.sync.exml.editor.WA.S(Unknown Source)
at ro.sync.exml.editor.WA.ยค(Unknown Source)
at ro.sync.exml.D.G.K(Unknown Source)
at ro.sync.exml.D.G.S(Unknown Source)
at ro.sync.exml.MainFrame.open(Unknown Source)
at ro.sync.ui.application.ApplicationLauncher.processArguments(Unknown Source)
at ro.sync.ui.application.ApplicationLauncher.launch(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at ro.sync.exml.Oxygen.main(Unknown Source)
I have tried placing the JAX-WS implementation and API jars in the endorsed dir of the oxygen JRE, but that just causes problems loading the remaining plugin lib jars.
Has anyone got any ideas how I get a JAX-WS 2.2 client running inside oxygen 10 plugin? Any help greatfully received.
Simon.
Still working on my webservice backed custom protocol handler.
I have nearly got it all working appart from the actual webservice interaction inside the plugin. I can run the core methods of my plugin as a stand alone application and everything works fine but when running as Oxygen plugin I get some class loader issues.
I am using a JAX-WS client in the plugin, and have the jars 'jaxws-rt.jar' and 'jaxws-api.jar' on my plugin classpath (set via plugin.xml). These are the Jax-RS RI 2.2RC1 versions of these files. There is some overlap with the WS implementation provided as part of the JRE that come with Oxygen. For an example lets take 'javax.xml.ws.WebFault'. This is loaded by oxygen using the system classloader from rt.jar at 'oxygen/jre/lib/rt.jar'. The version loaded is not the 2.2 version, and doesn't, for example, contain the method 'messageName'. Thus when I call Serfvice.getPort() to create my client object I get the following exception:
16:31:34,473 16 ERROR [ main ] ro.sync.exml.editor.WA - java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
java.lang.NoSuchMethodError: javax.xml.ws.WebFault.messageName()Ljava/lang/String;
at com.sun.xml.ws.model.RuntimeModeler.processExceptions(RuntimeModeler.java:1115)
at com.sun.xml.ws.model.RuntimeModeler.processDocWrappedMethod(RuntimeModeler.java:856)
at com.sun.xml.ws.model.RuntimeModeler.processMethod(RuntimeModeler.java:624)
at com.sun.xml.ws.model.RuntimeModeler.processClass(RuntimeModeler.java:413)
at com.sun.xml.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:252)
at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:698)
at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:686)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:341)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:324)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:306)
at javax.xml.ws.Service.getPort(Unknown Source)
at uk.co.smg.acm.services.ws.client.WSDocumentServiceService.getWSDocumentServicePort(WSDocumentServiceService.java:56)
at uk.co.smg.acm.oxygen.protocol.athenaws.CLI.doIt(CLI.java:52)
at uk.co.smg.acm.oxygen.protocol.athenaws.WebserviceConnection.getInputStream(WebserviceConnection.java:343)
at ro.sync.exml.editor.FA.A(Unknown Source)
at ro.sync.exml.editor.FA.A(Unknown Source)
at ro.sync.exml.editor.pA.K(Unknown Source)
at ro.sync.exml.editor.a.f.K(Unknown Source)
at ro.sync.exml.editor.WA.K(Unknown Source)
at ro.sync.exml.editor.WA.K(Unknown Source)
at ro.sync.exml.editor.WA.open(Unknown Source)
at ro.sync.exml.editor.WA.S(Unknown Source)
at ro.sync.exml.editor.WA.ยค(Unknown Source)
at ro.sync.exml.D.G.K(Unknown Source)
at ro.sync.exml.D.G.S(Unknown Source)
at ro.sync.exml.MainFrame.open(Unknown Source)
at ro.sync.ui.application.ApplicationLauncher.processArguments(Unknown Source)
at ro.sync.ui.application.ApplicationLauncher.launch(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at ro.sync.exml.Oxygen.main(Unknown Source)
I have tried placing the JAX-WS implementation and API jars in the endorsed dir of the oxygen JRE, but that just causes problems loading the remaining plugin lib jars.
Has anyone got any ideas how I get a JAX-WS 2.2 client running inside oxygen 10 plugin? Any help greatfully received.
Simon.