• Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassCastException while getting Home interface's reference

 
Lalit Nagalkar
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I tried a "Hello world using EJB and Servlet" program. I am getting "ClassCastException" on the line: "testSessionBean = (MyTestSessionHome)PortableRemoteObject.narrow(objref,MyTestSessionHome.class);".

testSessionBean is of home type as expected.

I tried a lot to get the program right but couldn't get it.

Analysis of "objref" shows, though it implements MyTestSessionHome, is not an instance of MyTestSessionHome (?), but it's an instance of EJBHome. Actually both must be true.

I am using JBoss server 4.0.4

Please reply urgently...

THANK YOU.
Lalit.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at Debug ClassCastExceptions in JBoss. Specifically the jmx-console method mentioned over there. Looks like you have packaged the home/remote/local interfaces of the bean in more than one archives.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!