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 iss开发者_如何学Cue 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
精彩评论