简体   繁体   中英

Java EE Shared Libs?

I'm having trouble getting a shared library working in a Java EE environment.

In particular, the library contains some helpers for common JMS activities. However, as soon as the code enters a library function that requires anything from javax.jms it's triggering a ClassNotFound exception (claiming it can't find javax.jms.Message , for instance.)

How do I get around this? I'm placing the shared lib under $AS_HOME\\lib\\endorsed -- does it belong elsewhere? I have tried also packaging all the dependencies inside the jar; this doesn't seem to make much of a difference.

I am really hoping this is much more straightforward than it is seeming right now. In order just to get it working, I've refactored the helper into a helper-per-module within each component that requires the functionality. Note that this is working, so I'm thinking the issue at this point is just classpath problems? Thanks for any advice!

The best practice is to put the jms.jar in:

 $AS_HOME/domains/<your domain>/lib

but you could always just place them in:

$AS_HOME/lib/

If you are not familiar with domains, take a quick glance at Concept of a GlassFish Domain

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM