Skip to Content
Oct 01, 2009 at 02:03 PM

External Jar not in ear file


Hi everybody!

Yesterday, I created a new Java DC to implement some classes. This DC is to use Log4J, so I added another DC of type external library, copied log4j.jar into the libraries folder of the project and added the jar to both the compilation and assembly public parts of this external library DC. After that, I defined these public parts as Used DCs of my Java DC, implemented some logging inside that one, defined a WebService on it and built and deployed the Java DC as I dit a lot of times before in other tracks.

But when sending a request to the WebService, I got a NoClassDefFound exception on a Log4J class.

In the generated .ear file, the log4j.jar was not present. I looked it up in another SC where I had some Java DC's and some WebDynpro DC's as well as sone external library DC's that worked without a problem. Everything in there was defined exactly as I did in the new DC's and the log4j.jar was packaged in the ear file as well as many other jar's.

When I rebuilt the "old" DC's (those that worked properly) and looked into the new ear files, the log4j.jar was gone as well! Nothing I do seems to get that jar back into the ear files (or into it fpr the first time with my new DC); I even tried defining a J2EE Server ibrary component and referencing that as mentioned in some blogs.

Any idea on that ?