I am experiencing this same problem.
Any answer? What am I missing??
Does no one know the answer to this?? Is the question not clear?
Please help!! I'm stuck and don't know how to get my application to work!
I can't help you but I found useful this lecture about classloading: http://webdev.apl.jhu.edu/~jcs/corej2ee.spring03/deploy/doc/book/public/02_J2EE_Application_Components.pdf
I hope this can help you!
Why not forget about the reference in the manifest file and add the library file as module in your application.xml?
That is likely to cause less problems when redeploying as well.
I originally tried the reference in the application.xml. Didn't work. I then tried the classpath in the manifest file. Didn't work.
Something doesn't seem right.
This was an app created in a WebLogic environment and I've been tasked with "porting" it to JBoss.
Post the application.xml you used to reference it from there.
It might help to not put the library file in a subdirectory.
I'll show you what I had in WebLogic. Here's what I have in my ear:
Here's my Manifest.mf:
Ant-Version: Apache Ant 1.5.3
Created-By: 1.4.2_03-b02 (Sun Microsystems Inc.)
Here's my application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'>
I've tried adding a Class-Path attribute to the manifest with no success.
I've tried adding a module element to the application.xml with no success. (I even tried all three types of modules besides web just for the sake of trying.) So something like SharedUtils.jar
And I've tried putting the SharedUtils.jar in just a lib subdirectory (no APP-INF above it), and tried putting it in no subdirectory.
It's a class withing the SharedUtils.jar that can't seem to be found at runtime. Do I need to create a directory structure under the lib directory that mimicks my package structure? (I know this is done in the classes directory in a web app.)
Sorry the xml in the application.xml isn't showing up properly. Should be:
and so on.
Hmm.... If I take the SharedUtils.jar out of the ear and just drop it into the deploy directory, the app can find the classes.
I am sure that referencing the jar from inside application.xml works.
As the xml snipped got eaten (you need to put it in a code block), here is a (working) application.xml from one of my projects:
<!DOCTYPE application PUBLIC '-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN' 'http://java.sun.com/dtd/application_1_3.dtd'> <application> <display-name>IC-trace</display-name> <!-- libraries --> <module> <java>cabsoft.jar</java> </module> <module> <java>uni-d-client.jar</java> </module> <module> <java>resources.jar</java> </module> <!-- actual IC-trace server-side components --> <module> <ejb>core.jar</ejb> </module> <module> <web> <web-uri>ws.war</web-uri> <context-root>/ws/1.0</context-root> </web> </module> <module> <web> <web-uri>ic-trace.war</web-uri> <context-root>/</context-root> </web> </module> <module> <web> <web-uri>admin.war</web-uri> <context-root>/admin</context-root> </web> </module> </application>
Hope that helps.
Thanks Joachim. Your persistence telling me to put it in my application.xml got me to thinking. I think it's working now after I added this:
<module> <java>APP-INF/lib/SharedUtils.jar</java> </module>
Interesting that in all the documents I've seen, I've never seen one that added the path. But it works.