cancel
Showing results for 
Search instead for 
Did you mean: 

External Library DC : NoClassDefFoundError

Former Member
0 Kudos

Hi All,

I have created a External Library DC to include certain jars in the libraries folder. I have exposed two public parts of it, one for runtime and other for build time.

Also I have created J2EE Server Component Library (deployable object) which includes the above mentioned DC(External Library DC) as 'used DC'.

At runtime it gives an error "NoClassDefFoundError", though the J2EE Server Component Library has the jar file.

Also where does (path) this J2EE Server Component Library .sda gets deployed, so that i can see whether the jar is actually present on server?

Please Help ...

Regards,

Vishal D.

Accepted Solutions (1)

Accepted Solutions (1)

sid-desh
Advisor
Advisor
0 Kudos

Hi Vishal,

Which version of NWDS do you use. Jar not getting included in the SDA file has been discussed quite a lot on this forum.

This is problem with some versions of NWDS. To solve this you have to create a build.vm in the cfg folder of External Library DC project. In the build.vm place the following piece of code

#StartProject("build" "build" ".")

#StartTarget("build")

#foreach ($pp in $dc_public_parts)

#MkDir("$/${pp.getName()}/lib/java") #foreach ($dir in $dc_sourceDirsAsFiles) <copy todir="$/${pp.getName()}/lib/java">

<fileset dir="$dir">

<include name="*.jar"/>

</fileset>

</copy>

#end

#end

#EndTarget()

#EndProject()

<u><b><The above is courtesy our build guru Marc Wirth></b></u>

Sometimes even after this jar may not be included in the SDA. So just restart the IDE and build the DC's again.

If you still get the NoClassDefError exception just ensure that you have placed the appropriate refrence in application-j2ee-engine.xml deployment descriptor.

Hope this helps.

Regards

Sidharth Deshpande

p.s. This problem may have been fixed in SP09 NWDS 7.0, but i am not sure. You can just check on this.

Message was edited by:

Sidharth Deshpande

Former Member
0 Kudos

Regarding your P.S.: A patch for SP09 was released last Friday that should fix the issue of Jars from external libraries that are not assembled.

null

Former Member
0 Kudos

But Marc, what for now we are still on EP6 SP16. Some how on our development server this is working fine even without the configs mentioned by sidharth. I have not yet done the changes which sidharth mentioned, should i go ahead with the changes in test and production environment?

Former Member
0 Kudos

Hi Vishal,

No. If you are on (NW04) SP16 then your build plugins should match that. You should not mix service packs or whole releases as that may produce some very interesting but also very unusable results.

My answer was just intended as a short update to Sidharths answer.

Libraries are unpacked in the filesystem in some path like /usr/sap/<SID>/JC<instance>/cluster/server/bin/ext.

Maybe the class itself is included in the Jar but uses another class that is not available in a static initializer?

Best regards,

Marc

Former Member
0 Kudos

Hi Marc/Sidharth

I see my J2EE server component DC deployed under the folder /usr/sap/<SID>/JC<instance>/cluster/server/bin/ext with all the relevent jars in it. But still it gives the same error, i have also tried the build.vm code but that also doesnt help.

sid-desh
Advisor
Advisor
0 Kudos

Hi vishal,

Then it may be that you have not added the reference in your application descriptor. Can you please check that.

Regards

Sidharth

Former Member
0 Kudos

Hi Sidharth,

Can you please elaborate on the exact entry required in the application-j2ee-engine.xml deployment descriptor.

I am facing exactly the same problem, to add to it.

I have the archive with the required jar file, but during deployment, it says dependancy with the dc of external library time not resolved There is no component either in SDM repository or in Deployment batch that resolves the dependency.Deployment will be aborted.

Please help

Regards,

Anish

Former Member
0 Kudos

It seems like you have defined a deploytime dependency to your External Library DC. This makes no sense, since an External Library DC has no deployable result. You should encapsulate the External Library DC in a J2EE Library and expose the contents of the External Library DC in the J2EE Library DC. You can then reference the J2EE Library DC.

Former Member
0 Kudos

Hi Pascal,

Its not working for me, I added the public parts of the external library to a new J2ee Server Component Library, and added the public part of the J2ee DC to the WebDynpro DC, it is giving me compilation error for the webdynpro dc as the jars are now not part of the WebDynpro Archive.

Please help

Former Member
0 Kudos

Hi Pascal,

I deployed the J2ee DC and now I am not getting any error in the deployment of the WebDynpro DC (after I add the public part of the J2ee Dc to the WebDynpro DC), but again when I run the WebDynpro Application it is failing to find the class in the jar file....

Please let me know if i need to make any changes in the application-j2ee-engine.xml or some other file.

Regards,

Anish

Former Member
Former Member
0 Kudos

No yet solved kindly help....

Former Member
0 Kudos

Hi All,

This problem is still not solved, helpful answers will be awarded.

Kindly help.

Vishal.

Former Member
0 Kudos

Hi vishal,

Did u check the sda file whether it is having the added jar or not.

Just navigate to the structure below in ur local system and see it. Go to the workspace and open ur J2EE library DC project.

<Project name>\_comp\gen\default\deploy\<U will find the sda file here>

Open it and check if its present.

- Nagarajan.

Former Member
0 Kudos

Did you use an API and an assembly public part for the external library DC? API to compile and assembly so the jar is available at runtime.

Check <a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/e2/084c16e1e4d545bb94c2bc8379d5f8/frameset.htm">here</a>.

Regards,

Christophe

Former Member
0 Kudos

>Regarding your P.S.: A patch for SP09 was released last Friday that should fix the issue of Jars from external >libraries that are not assembled.

>null

Hello!

I've read your post and I'm also experiencing the problem that external jars are not assembled. My version of NWDS SP9 is from August '06 and your post states there was a fix in Nov '06. Now, my question is, where do I find this fix. I looked at service.sap.com, but i didnt find sth which looked like it. Can u please hint where I have to look, or how the patch file is named?

Thanks!

Edited by: Timo Lau on Feb 4, 2008 3:44 PM

Former Member
0 Kudos

NWDS patch: JIDE09P_1-10003480.SAR. http://service.sap.com/swdc -> Support Packages and Patches -> Entry by Application Group -> SAP NetWeaver -> SAP NETWEAVER -> SAP NETWEAVER 7.0 (2004S) -> Entry by Component -> Developer Studio

SAP_BUILDT: SAPBUILDT09P_1-10003479.SCA. http://service.sap.com/swdc -> Support Packages and Patches -> Entry by Application Group -> SAP NetWeaver -> SAP NETWEAVER -> SAP NETWEAVER 7.0 (2004S) -> Entry by Component -> Development Infrastructure -> DI Build Tool 7.00

Answers (0)