This allows WSAD to properly resolve all references to org.jdom.*. However, when I build the EAR and deploy it to the server, it cannot locate the jdom.jar file during deployment. I get this error in SystemOut.log:
[7/17/06 15:37:16:140 EDT] 1ea2c28f EJBContainerI E WSVR0040E: addEjbModule failed for queueMdbEJB.jar [class com.ibm.ws.runtime.com ponent.DeployedModuleImpl] java.lang.NoClassDefFoundError: org/jdom/Content
Does that mean it cannot locat the jdom.jar file?
What is the proper way to resolve this? Since There is a jdom.jar on the server, I would prefer to use it as opposed to embedding one in my EAR.
The normal procedure is to put any external jar files your application needs into its WEB-INF/lib directory and export that in the WAR or EAR file. It may also be possible to configure them into your Websphere server's classpath, but that can lead to strange behaviour and it isn't normally recommended.
posted 14 years ago
Paul, thanks for replying. Since this happens to be an EJB project (only containing one MDB), I don't have a WEB-INF/lib directory.
I tried creating a lib directory in the EJB project and importing the jar into it. I redployed the EAR witout any errror. When I start the application, it thows that exception : java.lang.NoClassDefFoundError: org/jdom/Content.
I left the jdom.jar file in the project and commented all the code references to jdom. When I deployed and started this version, it worked. That is, there were no errors; it didn't do any of the JDom stuff of course.
So should the lib/jdom.jar go under the "ejbModule" folder in WSAD? Or am I just missing something?
I haven't ever used EJBs, so what I say may not be useful in your context. I recall at one point I had some jars in my EAR file, and my WAR file could use those jars with no problem. But I took them out and moved them to the WAR (basically for aesthetic reasons). I believe they were in the root of the EAR project in WSAD, not in a lib directory, and there must have been some configuration in my WAR project, but I don't remember exactly.
posted 14 years ago
I have figured this out with the help of a co-worker. The utility jar (jdom.jar) needed to be added to the META-INF/MANIFEST.MF file in my EJB project. Right mouse click on that file and select Open with... > JAR Dependency Editor and put a check mark next to it in the Dependencies table.
Export and redeploy and it worked.
One caveat, I was getting another error, this time something about "Incompatible argument to method..." I change the Classloader Mode on the application to PARENT_LAST and it worked. I suppose this is because WAS is using a different version of JDOM and there are some differences in the method signatures between versions. Changing the Classloader Mode to look in my app first to resolve classes fixed the problem.