Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

java.lang.NoClassDefFoundError problem

Former Member
0 Kudos

Hi everyone

I have developed a login module class. In this class I call a webservice, so I have imported some external classes. And I export the jar file, create a library project and deploy the library project on to the server following the help document. After that I add my login module into the ticket template. When I want to logon to the portal, I always meet the "java.lang.NoClassDefFoundError: javax/xml/rpc/ServiceException" exception after I inputed the id and password.

I have tried many ways. For example in my login module project, I import the jars I used into my project and in build path choose "add jar..." not "add external jar...". Then export my project including all the jars I used. I also try to copy all the jars I used onto the server, under the <java home>/jre/lib/ext directory. I also have changed the MANIFEST.MF file of my project by adding the classpath to it. But nothing helps me.

So do you have any more method to solve my problem?

Thanks

1 ACCEPTED SOLUTION

tim_alsop
Active Contributor
0 Kudos

Hi,

We had exact same problem with our login module, and couldn't find an easy solution. We eventually settled on modifying the Classpath used by J2EE engine to include our jar files. You can modify the Classpath using consoleconfig script.

Thanks,

Tim

5 REPLIES 5

tim_alsop
Active Contributor
0 Kudos

Hi,

We had exact same problem with our login module, and couldn't find an easy solution. We eventually settled on modifying the Classpath used by J2EE engine to include our jar files. You can modify the Classpath using consoleconfig script.

Thanks,

Tim

Former Member
0 Kudos

Hi,

If your LM library needs to use another library or libraries (for example you are using third-party API provided in additional jar files) then you have two possibilities:

- Deploy the third-party jars together with your LM jar. Then the SDA file will pack all jars together.

- Deploy the third-party stuff as a J2EE Library. Then you have to create a hard reference from your LM library to that J2EE library.

The difference is the third-party library scope. In the first case, it will be visible only within your LM. The second approach makes the library visible within the J2EE and you can reuse it in other libraries and applications.

Kind regards,

Tsvetomir

Former Member
0 Kudos

Hi Tim,

Do you know how can I use the consoleconfig to include my jars or is there any documents about this?

Thanks

tim_alsop
Active Contributor
0 Kudos

Hi,

I wondered if you thought the suggestions made by Tsvetomir were any use ?

Anyway, to use consoleconfig you need to :


cd /usr/sap/<SID>/DVEMBGS00/j2ee/configtool

sh consoleconfig.sh

Then, choose option "Instance Properties" (option 8 ?) followed by "Server" (option 18 ?). Then enter option for "General settings" (option 19) and you will be asked if you want to edit the Java settings. The rest is self explanatory. Make sure when you change the classpath to include the entries already present, and just add your .jar file to the configured list. Also make sure you include the . in the classpath, as this is easy to miss and will cause SAP j2ee engine to fail during startup if you make a mistake.

Good luck,

Tim

0 Kudos

Hi Tsvetomir,

I also want to use third-party API in my loginmodule, but was unable to add these jars to the SDA file using SAP Dev Studio. I don't know how to make SAP Dev Studio use the external third party jars as it says it can add jars only from workspace into provider.xml in LoginLibrary project.

I know that changing the classpath using consoleconfig.sh works but I don't like changing it because of the scope of the accessibility of these jars when added to classpath.

Can you please let me know how the jars can be added as said (any link or instruction to do the same would be appreciated very much) :

  • Deploy the third-party jars together with your LM jar. Then the SDA file will pack all jars together.

  • Deploy the third-party stuff as a J2EE Library. Then you have to create a hard reference from your LM library to that J2EE library.

Thanks,

Srinivas Cheruku