[jboss-user] [EJB 3.0] - class java.lang.ClassCastException in EJB3.0 lookup

harish.vamsh do-not-reply at jboss.com
Fri Dec 19 01:22:06 EST 2008


Hi All,

I'm trying to invoke a sample HelloBean EJB 3.0 in JBOSS 4.2.2. But getting following error
-------------------ERROR -----------------
11:20:53,187 WARN  [RequestProcessor] Unhandled Exception thrown: class java.lang.ClassCastException
11:20:53,187 ERROR [[action]] Servlet.service() for servlet action threw exception
java.lang.ClassCastException: $Proxy63 cannot be cast to examples.session.stateless.Hello
------------------------------------------
EJB jar file deployment was successful.

Trying to lookup in my servlet as shown below, which throws above stated error

Hello hello = (Hello) ctx.lookup("HelloBean/remote");

However, on calling
 System.out.println("--->"+ctx.lookup("HelloEJB/remote"));
outputs
--->jboss.j2ee:jar=firstEJB3.jar,name=HelloEJB,service=EJB3

It is unable to cast it to the Remote interface.

Can anyone help me?. 

Thanks in advance



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4197515#4197515

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4197515



More information about the jboss-user mailing list