title: Running standalone Glassfish v3 client as Eclipse plugin
body: <p>I'm developing a standalone client that invokes some EJB methods on Glassfish v3. This works well until I'm integrating the client into an Eclipse plugin for running in our RCP application. In this setting there seems to be a classloader problem on initializing the naming context and I get the exception listed below. (The client has gf-client.jar and all its dependencies on its classpath.)</p>
  
  <p>It fails on</p>
  
  <pre><code>m_ctx = new InitialContext();
  </code></pre>
  
  <p>with the exception</p>
  
  <pre><code>java.lang.NoSuchMethodException: org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findResources(java.lang.String)
              at java.lang.Class.getMethod(Class.java:1605)
              at com.sun.enterprise.module.single.ManifestProxy.&lt;init&gt;(ManifestProxy.java:34)
              at com.sun.enterprise.module.single.ProxyModuleDefinition.&lt;init&gt;(ProxyModuleDefinition.java:78)
              at com.sun.enterprise.module.single.ProxyModuleDefinition.&lt;init&gt;(ProxyModuleDefinition.java:73)
              at com.sun.enterprise.module.single.SingleModulesRegistry.&lt;init&gt;(SingleModulesRegistry.java:42)
              at com.sun.enterprise.module.single.SingleModulesRegistry.&lt;init&gt;(SingleModulesRegistry.java:30)
              at com.sun.enterprise.module.single.StaticModulesRegistry.&lt;init&gt;(StaticModulesRegistry.java:60)
              at org.glassfish.internal.api.Globals.getStaticHabitat(Globals.java:67)
              at com.sun.enterprise.naming.impl.SerialContext.&lt;init&gt;(SerialContext.java:183)
              at com.sun.enterprise.naming.impl.SerialContext.&lt;init&gt;(SerialContext.java:253)
              at com.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(NamingManager.java:667)
              at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
              at javax.naming.InitialContext.init(InitialContext.java:223)
              at javax.naming.InitialContext.&lt;init&gt;(InitialContext.java:175)
  </code></pre>
  
  <p>Has anybody an idea how to solve this problem?</p>