- This topic has 1 reply, 2 voices, and was last updated 15 years, 10 months ago by Loyal Water.
-
AuthorPosts
-
bipien@yahoo.comMembersir
I want to call my stateless session bean from servlet but class exception occurs pl help
my server is weblogic 8.1 and ide is myeclipse 6.5
my servlet code is
try{
Context ic=new InitialContext();
//TwoHome home=TwoUtil.getHome();
//System.out.println(home.getClass().getName());
//System.out.println(home instanceof TwoHome);
//System.out.println(home.getClass().getClassLoader());
//System.out.println(getClass().getClassLoader());
Object o=ic.lookup(“java:comp/env”);
TwoHome home=(TwoHome)PortableRemoteObject.narrow(o, TwoHome.class);
//TwoHome home=TwoUtil.getHome();
Two two=(Two)home.create();
//Two two=(Two);
two.myCall();
}catch(Exception e){e.printStackTrace();}
and out put error is
<Jan 11, 2009 8:27:04 PM IST> <Notice> <WebLogicServer> <BEA-000360> <Server started in RUNNING mode>
java.lang.ClassCastException: Cannot narrow remote object to two.interfaces.TwoHome
at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:219)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:134)
at MyServlet.doGet(MyServlet.java:55)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6291)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:97)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3575)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2573)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
Loyal WaterMemberMoving to Off Topic >> Software Development.
-
AuthorPosts