• Post Reply Bookmark Topic Watch Topic
  • New Topic

Class Loader Problem while sending a response from EJB to a webapplication

 
Shiju K K
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am using EJB 2.0, Axis2 Websrvice and Weblogic 8.1 Server.

I am trying to make a EJB call from my Axis2 Webservice part. I am deploying an ear file which contains both ejb and webservice war file.
Here, the EJB call is going fine, but wile returning a response object i am getting a ClassLoader Problem, which says that " Loader constrained violated for com.ejb.Response class".
I am having this class in com.jar file and placed in ear file. I have added the com.jar in manifest classpath entry of both war file and ejb.jar file. Both are sharing the same jar file.

But if while I am testing the ejb alone from a Junit test case the response is coming correctly.
and while I am testing the web service alone, with out having the ejb call inside, its going fine.

Can anybody help me out to resolve this issue.

Thanks in advance,

Shiju
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is your web service and EJBs part of the same application? If so, then simply place the JAR file containing common classes like Response in APP-INF/lib. You do not need manifest entries as, from WebLogic Server 8.1, classes in APP-INF/lib are automatically loaded into the root classloader for the application. You will find that the Response.class is loaded once and is available to both your web service and EJB.
 
Guttikonda Phaneendra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to expose the Web Service of EJB deployed in Weblogic using axis2. I have created and deployed aar file in axis2 services folder. The aar file contains the EJb Client jar, services.xml and the interfaces. When I tried to access the web service I got the following error. Please let me know how to fix this problem?


java.lang.ClassCastException: Cannot narrow remote object to test.HelloHome
at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteO
jectDelegateImpl.java:242)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at org.apache.axis2.rpc.receivers.ejb.EJBUtil$EJBClientWorker.createRemo
eEJB(EJBUtil.java:156)
at org.apache.axis2.rpc.receivers.ejb.EJBUtil$EJBClientWorker.run(EJBUti
.java:128)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
er.runTask(ThreadPoolExecutor.java:665)
at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Wor
er.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:534)
ar 25, 2008 9:02:45 AM org.apache.axis2.transport.http.AxisServlet doPost
EVERE: java.lang.NullPointerException
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!