cancel
Showing results for 
Search instead for 
Did you mean: 

NoClassDefFoundError caused by calling from web app

Former Member
0 Kudos

I almost give up trying, but I still know it should be a silly simple problem.

I have a EAR, with a EJB Module and a web module as well.

my web app can call my stateless java bean, it's very well.

I have another ear(with web module only), with the former ear they're at the same server. I try to call the stateless session bean from my independent web app(it's a jsp)

I know of course you should give your ejb-jar file to the classpath of the caller, or there's a NoClassDefFoundError exception. I put this jar to the classpath(such as WEB-INF\lib) of the independant web app.

But I tried all my best there's still the same error.

I dont know where else to add the classpath,

the only problem left to me is just

NoClassDefFoundError

java.lang.NoClassDefFoundError: com.comgorup.crmenhance.SapUtilHome

at com.comgroup.ejbutil.EjbAgent.output(EjbAgent.java:26)

at jsp_hello1138806991855._jspService(jsp_hello1138806991855.java:9)

at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:538)

at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:186)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

Anyone help me

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi William,

Just try this, go to Window->Prefreneces menu and then add your jar file directly from there, then comile your application and try to deploy and test.

Reply back for issues,

Guru.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi William,

i suppose, you have to add an ejb-reference in web.xml file in your web application. I hope that can solve your problem.

Regards

Bogdan

Former Member
0 Kudos

I'm so sorry to tell you, Gurvinder

I have no chance to deploy the caller web app again.

That is, This web app is existed in advance, then I have the ejb application belongs a new ear project which I can control fully. I just do the enhancement. All I can do to the caller is to add classes, modify jsp and config files like web.xml if needed.

Thank you for your response.

Former Member
0 Kudos

Hi,

If you are not able to deploy/redeploy that means the changes made to the web.xml files won't get reflected. Do one thing, stop the web application and restart it after modifying the web.xml file. If it doesn't helps, then try restating the WAS server and see if it works.

Regards,

Guru.

PS: Reward points for helpfull replies

Former Member
0 Kudos

Hi William,

In the web.xml file, you will get an tab option for EJBs. Here, add ejb reference for your ejb lying in another ear project.

Then, use it in your code.

Regards,

Bhavik