I'm baffled by what is going on here. I keep getting the following exception:

Caused by: java.lang.ClassNotFoundException: org.jaxen.JaxenException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
... 51 more

Yet, this class file IS in my ear and also on the 'Class-Path' attribute of both my ejb's manifest and my ear's manifest file. Is there somewhere else I need to add the jaxen jar to have it be seen by other jar's in the ear? Do all jar's in a ear share the same classpath?

EDIT #1

There is this too:

Caused by: java.lang.NoClassDefFoundError: org/jaxen/JaxenException
at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:230)
at org.dom4j.tree.AbstractNode.createXPath(AbstractNode.java:207)
at org.dom4j.tree.AbstractNode.selectNodes(AbstractNode.java:164)

EDIT #2

I am deploying to glassfish v3.1 and the lib jars are at the root of the ear file, like so:

-foo.ear
--\META-INF
--lib1.jar
--lib2.jar
--jaxen-1.1.1.jar

EDIT #3

I have tried deploying to another version of GF and it appears to work, I think it might be a bug in the version I'm using. I've opened a forum thread here.

EDIT #4

I had dom4j in the app server lib directory but not jaxen on the server. Adding the jaxen lib fixed this.

Any jars that are in the lib/ directory of your EAR will automatically be loaded.

Another example is the common task of bundling a number of library JAR files with an application. By default, the lib directory under the application root is reserved for library files. Previously, you had to add a manifest entry to the application module, which could be a tedious task.

That means they are on the "shared path" more or less, right? Also, is this a standard across application servers?
–
javamonkey79Aug 16 '11 at 0:42

If it works on Glassfish, then it should work on every other server since Glassfish is the reference implementation. I use WebLogic 10 at work, and the lib/ is automatically loaded as well. I added a link to some documentation that explains it.
–
Jeremy HeilerAug 16 '11 at 0:46

I apologize, I was wrong (yet again...sigh). I've got jaxen in the lib dir of he packed ear and the problem persists :(
–
javamonkey79Aug 16 '11 at 1:00