9 Replies Latest reply on Sep 12, 2007 9:02 AM by Anton Anton

    Cannot get my first EJB 3.0 to work!!!

    Seah Sherley Newbie

      Hi guys,

      I have created a interface....

      package examples.session.stateful;

      public interface Count
      {
      public int count();
      public void set(int val);
      public void remove();
      }

      Then I have created a Stateful Bean to implements the above interface

      @Stateful(name = "CountingBean")
      @Remote(Count.class)
      @Interceptors(CountCallbacks.class)
      public class CountBean implements Count
      {
      ...........
      }

      I have deploy eveything in the jboss and run my client

      Count obj = (Count)ctx.lookup("CountingBean");

      It give a ClassCastException....

      When i ran the JMX-Console.... and click on the JNDIVIEW and click on the INVOKE button under the method list..... on the page display... I see the following:

      .......
      +- CountingBean (class: org.jnp.interfaces.NamingContext)
      | +- remote (class: java.lang.Object)
      | +- remoteStatefulProxyFactory (proxy: $Proxy72 implements interface org.jboss.ejb3.ProxyFactory)
      ........

      My question is... how come the CountingBean is not of class Count?????

      Thanks a million!!!!