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.)
It fails on
m_ctx = new InitialContext();
with the exception
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.<init>(ManifestProxy.java:34)
at com.sun.enterprise.module.single.ProxyModuleDefinition.<init>(ProxyModuleDefinition.java:78)
at com.sun.enterprise.module.single.ProxyModuleDefinition.<init>(ProxyModuleDefinition.java:73)
at com.sun.enterprise.module.single.SingleModulesRegistry.<init>(SingleModulesRegistry.java:42)
at com.sun.enterprise.module.single.SingleModulesRegistry.<init>(SingleModulesRegistry.java:30)
at com.sun.enterprise.module.single.StaticModulesRegistry.<init>(StaticModulesRegistry.java:60)
at org.glassfish.internal.api.Globals.getStaticHabitat(Globals.java:67)
at com.sun.enterprise.naming.impl.SerialContext.<init>(SerialContext.java:183)
at com.sun.enterprise.naming.impl.SerialContext.<init>(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.<init>(InitialContext.java:175)
Has anybody an idea how to solve this problem?