• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

java.lang.ClassCastException at ...javax.rmi.PortableRemoteObject.narrow in oc4j10.1.3

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I have been trying to get EJB bean and I get the below exception. My code is

Object objref = context.lookup("SubModule");
System.out.println("Objectref-->"+objref);
Class homeclass=getClassFromProperty("SubModule");
System.out.println("home interface--->"+homeclass);
EJBHome home= (EJBHome)javax.rmi.PortableRemoteObject.narrow(objref,homeclass);

I have added oc4jclient.jar in applib and my ejb-jar.xml looks fine.


09/08/06 11:57:42 In Servlet
09/08/06 11:57:42 Objectref-->SubModule EJBHome
09/08/06 11:57:42 Class name:org.rl.submod.SubModuleHome
09/08/06 11:57:42 home interface--->interface org.rl.submod.SubModu
leHome
09/08/06 11:57:42 java.lang.ClassCastException
09/08/06 11:57:42 at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.
narrow(PortableRemoteObject.java:229)
09/08/06 11:57:42 at javax.rmi.PortableRemoteObject.narrow(PortableRemoteO
bject.java:137)
09/08/06 11:57:42 at ir.framework.servicelocator.ServiceLocator.getEJBHome
(ServiceLocator.java:118)
09/08/06 11:57:42 at javax.servlet.http.HttpServlet.service(HttpServlet.ja
va:763)
09/08/06 11:57:42 at javax.servlet.http.HttpServlet.service(HttpServlet.ja
va:856)
09/08/06 11:57:42 at com.evermind.server.http.ServletRequestDispatcher.inv
oke(ServletRequestDispatcher.java:713)
09/08/06 11:57:42 at com.evermind.server.http.ServletRequestDispatcher.for
wardInternal(ServletRequestDispatcher.java:370)
09/08/06 11:57:42 at com.evermind.server.http.HttpRequestHandler.doProcess
Request(HttpRequestHandler.java:871)
09/08/06 11:57:42 at com.evermind.server.http.HttpRequestHandler.processRe
quest(HttpRequestHandler.java:453)
09/08/06 11:57:42 at com.evermind.server.http.HttpRequestHandler.serveOneR
equest(HttpRequestHandler.java:221)
09/08/06 11:57:42 at com.evermind.server.http.HttpRequestHandler.run(HttpR
equestHandler.java:122)
09/08/06 11:57:42 at com.evermind.server.http.HttpRequestHandler.run(HttpR
equestHandler.java:111)
09/08/06 11:57:42 at oracle.oc4j.network.ServerSocketReadHandler$SafeRunna
ble.run(ServerSocketReadHandler.java:260)
09/08/06 11:57:42 at oracle.oc4j.network.ServerSocketAcceptHandler.procCli
entSocket(ServerSocketAcceptHandler.java:234)
09/08/06 11:57:42 at oracle.oc4j.network.ServerSocketAcceptHandler.access$
700(ServerSocketAcceptHandler.java:29)
09/08/06 11:57:42 at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptH
andlerHorse.run(ServerSocketAcceptHandler.java:879)
09/08/06 11:57:42 at com.evermind.util.ReleasableResourcePooledExecutor$My
Worker.run(ReleasableResourcePooledExecutor.java:298)
09/08/06 11:57:42 at java.lang.Thread.run(Thread.java:595)
09/08/06 11:57:42 Caused by: java.lang.ClassCastException: SubModule_RemoteHo
meProxy_1agn9nm
09/08/06 11:57:42 at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.
narrow(PortableRemoteObject.java:212)
09/08/06 11:57:42 ... 20 more
09/08/06 11:57:42 Done with Servlet


Please help me find the solution!!!
 
There are 29 Knuts in one Sickle, and 17 Sickles make up a Galleon. 42 tiny ads in a knut:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic