9 Replies Latest reply on Sep 3, 2009 8:55 AM by jaikiran pai

    class java.lang.ClassCastException in EJB3.0 lookup

    Harish Newbie

      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

      It is unable to cast it to the Remote interface.

      Can anyone help me?.

      Thanks in advance