0 Replies Latest reply on Aug 30, 2005 2:37 PM by khalidhajsaleh

    ClassCastException with @Local annotation

    khalidhajsaleh

      I am trying to run the example of Ejb3 from the webinar by Marshall. The example runs correctly when my interface is @remote. It fails however with @local. I get the following exception:

      java.lang.ClassCastException: javax.naming.Reference
       at org.jboss.ejb3.LocalProxy.readObject(LocalProxy.java:50)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)


      the line that is causing the problem is

      HellowWorld hl = (HellowWorld)ctx.lookup(HellowWorld.class.getName());


      where my bean def is as follows:

      @Local
      public interface HellowWorld {}
      public class HellowWorldBean implements HellowWorld{}

      thanks for the help!

      Khalid