2 Replies Latest reply on Feb 20, 2008 9:52 AM by Pedro Neves

    Lookup EJB 3 +  ClassCastException ( jboss-4.2.2.GA )

    Pedro Neves Newbie

      I have two .ears, one .ear with ejbs and other .ear with web.
      To locate a ejb in ear the web are experiencing a mistake "ClassCastException"

      I find the ejb perfect, but to instance of StatelessLocalProxy and not do the casting for the interface of EJB

      Exception:
      Caused by: java.lang.ClassCastException: $Proxy142

      Code:

      InitialContext ic = new InitialContext();
      IMyEJBTest ejb = (IMyEJBTest)ic.lookup( ejbName );


      Note: In one .ear only is not the error.

      helpe-me

      Pedro Neves
      Brazil