Skip to main content

classpath for remote client - tomcat --> glassfish-3.1

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
5 replies [Last post]
dniklas
Offline
Joined: 2006-03-11

Hi,

i want to call my Remote-Session-Bean from a webapplication deployed on tomcat.
Wich jars must be on the classpath?

Looking into Manifest.MF in gf-client.jar lists a lot of jars. I cannot find all jars, e.g "jtype.jar". I don't want to provide some other jars, because there are conflicts with tomcat - e.g. el.

Is there a simple solution for that? I need a "gf-client-all.jar".

Best regards
Daniel

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dniklas
Offline
Joined: 2006-03-11

ok, it took some time, but now i found a good solution:

  • use "gf-client.jar" first
  • set jvm args to -verbose:class
  • extract all loaded jars

This list is not very long, about 35 jars.

See details here:
http://blog.thejeearchitectcookbook.net/post/2011/01/30/Setting-minimal-...

Daniel

dniklas
Offline
Joined: 2006-03-11

I think the right approach is, to generate a "appclient.jar" with the "package-appclient"-script. This generates a 42.6 MB file. But then i get this exception, too:

java.lang.NullPointerException
at com.sun.enterprise.naming.impl.SerialContext.<init>(SerialContext.java:276)
at com.sun.enterprise.naming.impl.SerialContext.<init>(SerialContext.java:335)
at com.sun.enterprise.naming.impl.SerialInitContextFactory.createInitialContext(SerialInitContextFactory.java:358)
at com.sun.enterprise.naming.impl.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:353)
at com.sun.enterprise.naming.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:69)
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:197)

Any ideas?

Daniel

tjquinn
Offline
Joined: 2005-03-30

Daniel,

The appclient.jar file created by package-appclient contains the JARs and other files needed by the client. It needs to be expanded somewhere and then the gf-client.jar can be added to the classpath for the app. Adding appclient.jar to the class path will not work.

You did not mention expanding the JAR so I just wanted to make sure that's understood.

- Tim

cf126330
Offline
Joined: 2005-03-29

Depends on the scope of your applications. You will need to try it out, maybe starting with glassfish-naming.jar?

dniklas
Offline
Joined: 2006-03-11

I tried to zip all classes of the jar-files listed in Manifes.MF of gf-client.jar. But after that i get get a NullpointerException:

java.lang.NullPointerException
at com.sun.enterprise.naming.impl.SerialContext.<init>(SerialContext.java:276)
at com.sun.enterprise.naming.impl.SerialContext.<init>(SerialContext.java:335)
at com.sun.enterprise.naming.impl.SerialInitContextFactory.createInitialContext(SerialInitContextFactory.java:358)
at com.sun.enterprise.naming.impl.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:353)
at com.sun.enterprise.naming.SerialInitContextFactory.getInitialContext(SerialInitContextFactory.java:69)
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:197)

Any ohter suggestions?

Thanks
Daniel