Plugin class loaders

Having trouble installing Oxygen? Got a bug to report? Post it all here.
sijomon
Posts: 83
Joined: Wed May 20, 2009 1:18 pm

Plugin class loaders

Post by sijomon »

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.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Plugin class loaders

Post by sorin_ristache »

sijomon wrote: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.
What are the problems of loading the other jars of the plugin and what are these jars? Do you mean they are not compatible with your JAX-WS RI 2.2 jars that you placed in the JRE/endorsed directory?

Other option is to find a JRE 1.5 or a JRE 1.6 version that includes your jars or that can run with them in the endorsed directory and run Oxygen 10 with that JRE. You do this by renaming or removing the [Oxygen10-install-dir]/jre directory and making sure that your JRE is the default JVM launched on your computer. If you start Oxygen with the oxygen.bat script you should specify the full path to the java.exe executable of your JRE in the java command at the end of the oxygen.bat script.


Regards,
Sorin
Post Reply