2 Replies Latest reply on Feb 10, 2003 4:24 PM by Andreas Vogler

    ClassCastException on EJB reference

    Andreas Vogler Newbie


      I have a strange problem with getting a reference to an entity bean.

      I try to get an entity bean from a session bean with code like this:

      Object o = (new InitialContext()).lookup("java:comp/env/ProjectEJB");
      return (LocalProjectHome)o;

      I get a ClassCastException at the return statement. I tried to get information about the class and it is called $Proxy40 and it implements the interface LocalProjectHome (thats what o.getClass().getInterfaces() tells me).

      Any idea what the problem could be?