4 Replies Latest reply on Dec 26, 2008 2:25 AM by jaikiran

    [EJBTHREE-1659] Support for asynchronous calls on EJB3 in JB

    jaikiran

      Asynchronous invocations on EJB3 beans as explained here http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html#d0e427, at present, does not work in JBoss-5.

      [java] Exception in thread "main" java.lang.ClassCastException: $Proxy2
       [java] at org.jboss.ejb3.asynchronous.Asynch.getAsynchronousProxy(Asynch.java:38)
       [java] at org.jboss.tutorial.asynch.client.Client.main(Client.java:40)
       [java] Java Result: 1
      


      The ClassCastException arises from this line in org.jboss.ejb3.asynchronous.Asynch.getAsynchronousProxy:

      JBossProxy proxy = (JBossProxy)ejbRef;



      The proxies that we create in EJB3 on JBoss-5.0, no longer implement this JBossProxy interface and hence this exception. The JNDI tree output of the bean:
      +- SomeJNDIName (class: Proxy for: org.jboss.ejb3.core.asynch.test.SimpleSLSBRemote)


      The same beans when deployed on JBoss-4.2.x do implement this interface:

      +- SimpleSLSB (class: org.jnp.interfaces.NamingContext)
       | +- remote (proxy: $Proxy70 implements interface org.jboss.ejb3.core.asynch.test.SimpleSLSBRemote,interface org.jboss.ejb3.JBossProxy)
      


      Any specific reason why we no longer add this as a default interface for the proxies?