how can i use a shared lib in glassfish to avoid deployment of the huge libs?

允我心安 提交于 2019-12-01 05:47:20

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.

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.)

Pascal Thivent

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!