cancel
Showing results for 
Search instead for 
Did you mean: 

External Jar not in ear file

michael_voss2
Participant
0 Kudos

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 ?

Accepted Solutions (1)

Accepted Solutions (1)

chander_kararia4
Contributor
0 Kudos

HI Voss,

This could be an issue sometimes with NWDS. IT does not update the DCs perfectly. Sometimes, you may just restart the NWDS to sort out the issue. For your case, you may try as suggested in above post.

If still you face the trouble, just check your Library Activity (Under Open Activity Pane). Does it contains the jar file?

if not - Add the jar file to DTR forcefully (ie. manually)

if yes - Checkout that for deleting, add it again forcefully.

Build the DC again. Now, Check-In the activity. After that, remove the configuration & again do a fresh import.

Build the DC again. IF that is successful, You may proceed with the Further steps as specified earlier.

This is just an RnD method. Thanks.

Best REgards

Chander Kararia

michael_voss2
Participant
0 Kudos

Wow!

I'm impressed. I'd never thought of that... O.k., hope it will continue to work and thanks for your help to all who responded...

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Voss

I think this link will help you to some extent.

Regarding deploying external library DC's in the server

http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/60a0f850-c451-2c10-a6a6-ddcabfa3a65b

Thanks

Tulasi

Edited by: Tulasi Palnati on Oct 5, 2009 1:44 PM

Former Member
0 Kudos

Hi Michael,

You just try to rebulid your external library in which that log jar file is there and then add public part to the dc created where it has to be used.Also add webservcie as Publica part in that dc .Now rebulid and check whether the jar is still their after the rebulid .If its there ,it means the build structure is fine and now you can deploy the applciation.This you can check in going to project folder in webdynpro explorer,right clcik on that goto properties->java build path->libraries.

Moreover,Please deploy the external library dc and webservice dc then the dependent component or main application.

I hope this will help you in solving your problem.

Regards,

Anupama

former_member186148
Active Participant
0 Kudos

Hello Michael!

Please read my message at this:

May be it will help you.

N.B. this way had been used only with NWDS 7.0!

regards, Lev