java ee - Running standalone Glassfish v3 client as Eclipse plugin -


I am developing a standalone client who invites some EJB methods on Glassfish v3. This works fine until I am integrating an Eclipse plugin to run the client in our RCP application. In this setting a classmaker problem appears when you start the naming context, and I get the exception listed below. (Client in client has gf-client.jar and all its dependencies.)

This fails

  m_ctx = new InitialContext ();  

with exception

  java.lang.NoSuchMethodException: org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findResources (java.lang.String) . Init & gt; (ManifestProxy.java:34) at com.sun.enterprise.module.single at java.lang.Class.getMethod (Class.java:1605) com.sun.enterprise.module.single.ManifestProxy & lt at. ProxyModuleDefinition. & Lt; Init & gt; (ProxyModuleDefinition.java:78) at com.sun.enterprise.module.single.ProxyModuleDefinition. & Lt; Init & gt; Com.sun.enterprise.module.single.SingleModulesRegistry (ProxyModuleDefinition.java:73). & Lt; Init>. (SingleModulesRegistry.java:42) com.sun.enterprise.module.single.SingleModulesRegistry & lt; Init>. (SingleModulesRegistry.java:30) com.sun.enterprise.module.single.StaticModulesRegistry & lt; Init & gt; (StaticModulesRegistry.java:60) at org.glassfish.internal.api.Globals.getStaticHabitat (Globals.java:67) com.sun.enterprise.naming.impl.SerialContext. & Lt; Init & gt; (SerialContext.java:183) at com.sun.enterprise.naming.impl.SerialContext. & Lt; Init & gt; Com (SerialContext.java:253). Sun.enterprise.naming.impl.SerialInitContextFactory.createInitialContext (SerialInitContextFactory.java:121) at com.sun.enterprise.naming.impl.SerialInitContextFactory.getInitialContext (SerialInitContextFactory.java:116) at javax.naming.spi.NamingManager.getInitialContext ( .javax.naming.InitialContext.getDefaultInitCtx (InitialContext.java:288) javax.naming.InitialContext.init (InitialContext.java:223) is on javax.naming.InitialContext & lt at NamingManager.java:667); Init & gt; (InitialContext.  

Further investigation of the problem has shown that the glassfish 3 relies on a public method Find Resources (or Va.lang.String) java.lang.Classloader .

  package com.sun.enterprise.module .single; [...] Public class manifestation expense {[...] throws IOException to public manifests (ClassLoder CL, list & quot; separator mapping & gt; mapping) {try {[...] meeting method = Cl.getClass () GetMethod ("Search "String", string, class); counting & lt; url & gt; url = null; try {met.setAccessible (true); urls = (enumeration lt; URL & gt;) met.invoke (cl, jarfile.MANIFEST_NAME );  

But this method is only protected in Classroom class. Running the client as a standalone Java application, the derived classloader sun.misc.Launcher $ AppClassLoader It is used which overrides this method and declares it public, but when the plugin classloader moves in the form of eclipse org Eclipse.osgi.internal.baseadaptor.DefaultClassLoader does not dominate findResource -Method which it preserves by ManifestProxy class and leaves inaccessible.

What is the best way to resolve it? How do I set a specific classular code for an Eclipse plugin / OSSB bundle?

Thank you!


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -