Dear Community,
we are developing a client-server application. On the client side we use a Eclipse RCP application. We would like to use GlassFish v3 as application server. Our client should communicate via RMI with GlassFish server. So we tried to get the InitialContext within our RCP application for look-up the EJBs on the server and got into trouble, caused by ClassNotFoundException:
Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.naming.impl.SerialInitContextFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.eclipse.core.runtime.internal.adaptor.ContextFinder.loadClass(ContextFinder.java:129)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:46)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:654)
... 40 more
If we run a simple GlassFish client outside the RCP application everything works fine.
Here is the code snippet for the context look-up:
Properties props = new Properties();
props.put("java.naming.factory.initial", "com.sun.enterprise.naming.impl.SerialInitContextFactory");
props.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
props.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
Context ctx = new InitialContext(props);
ctx.lookup("company.TestEJB");
Now the challenge is to provide all necessary GlassFish classes to the RCP runtime enviroment. We did it by setting all GlassFish libraries
of the GlassFish installation package 'modules' to the runtime classpath.
Does anybody know which GlassFish libraries are neccessary to run the GlassFish client? Furthermore we are searching for
a more elegant way to provide these libraries to the runtime environment, e.g. as a plugin which contains all neccessary GlassFish classes.
Thank you for any help!
Best wishes,
Maxim
[Message sent by forum member 'ente0815']
http://forums.java.net/jive/thread.jspa?messageID=477207