cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.NoClassDefFoundError: org.apache.commons.httpclient.HttpMethod

Former Member
0 Kudos

Dear Experts,

I m having a java.lang.NoClassDefFoundError exception.

Basically what i have done is create an external library DC with 2 public parts.

One for compilation and the other one for assembly.

Then create a J2ee server/library and add the 2 public parts of the external library DC as the the used DC.

In CMS, after doing the assembly and successfully deployed to the TEST server, why do i still have the

java.lang.NoClassDefFoundError: org.apache.commons.httpclient.HttpMethod

I have also check that the SDA file contains the Jars by unzipping it.

FYI, my SDA file structure:

commons-codec-1.3.jar

commons-httpclient-3.0-rc3.jar

commons-logging.jar

commons-logging-api.jar

meta-inf\Manifest.mf

meta-inf\Sap_manifext.mf

meta-inf\sda-dd.xml

server\provider.xml

Please let me know your views.

Thanks in advance.

Rgds,

Daniel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Daniel,

As you have created the J2EE Server Library project and deployed it successfully, you will need to,

1. Add the Public part of the J2EE server Lib project to the project where you need to use those jars.

2. If it is a Web Dynpro project, then you need to add the name of the J2EE Server Library project to the

project Properties -> Project References -> Library References.

Regards,

Alka.

Former Member
0 Kudos

Hi Alka,

The 2 points you mentioned was done as well.

What are the other things can i check ?

Thanks.

Rgds,

Daniel

Former Member
0 Kudos

Make sure your Used DC definition to the J2EE library has a runtime dependency.

Former Member
0 Kudos

Hi Pascal,

I m encountering similar problem.

I did all the above and when i look at the SCA file, i can see an entry for the J2EE library file as an SDA file. But although deployment is successful, when i browse through the folder (/usr/sap/WS5/JC00/j2ee/cluster/server0/apps/) containing the deployed apps, i can't find the J2EE library deployed ?

So that is the reason i m getting the java.lang.NoClassDefFoundError exception.

But what is the reason that the J2EE library is not deployed. Hope to get your input. Thanks in advance.

Rgds,

Daniel

Former Member
0 Kudos

Hi Daniel,

I'm not sure why the J2ee Server Library is not deployed to your server.

You can adopt another mechanism to use external jars using this [blog|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/4512] [original link is broken] [original link is broken] [original link is broken];.

In this method, the J2EE Server component is not needed, the SDA type PP of the External Library can be directly used in the Web Dynpro Application Used DCs.

Regards,

Alka.

Former Member
0 Kudos

Hi Alka,

I tried the method you suggested and it works.

Thanks loads.

Cheers,

Daniel

Answers (0)