views:

27

answers:

3

I have to upload about 30M for my app since it uses a lot of libraries, log, web engine and so on.

I think there should be a way to share these libs on glassfish, but I failed to figure it out. I tried to put them in domain/lib/ext but does not work.

So where should I store these libs and how should I refer to them? thank you.

A: 

One option would be to put them in domains/domain1/lib. But actually, I suggest to read GlassFish equivalent to WebSphere's "shared libraries", including the comments.

Pascal Thivent
A: 

If I remember well, you can also specify additional libraries in the classpath via the admin console (in Application Server > JVM settings or something like this). Then you can put them wherever you want.

(I had a quick look at Pascal's link, but I don't know if that's what they describe, if yes, my apologies for the duplicate answer.)

ewernli
A: 

Why domaindir/lib/ext does not work?

from glassfish manual:

Optional packages are packages of Java classes and associated native code that application developers can use to extend the functionality of the core platform. To use the Java optional package mechanism, copy the JAR files into the domain-dir/lib/ext directory, then restart the server.

Why domaindir/lib work?

To use the Common class loader, copy the JAR files into the domain-dir/lib or as-install/lib directory or copy the .class files (and other needed files, such as .properties files) into the domain-dir/lib/classes directory, then restart the server. Using the Common class loader makes an application or module accessible to all applications or modules deployed on servers that share the same configuration.However, this accessibility does not extend to application clients.

Ben