2 Replies Latest reply on Feb 3, 2007 7:01 AM by Sergey Ignatov

    ClassCastException in the InvokeRemoteInterceptor

    Sergey Ignatov Newbie

      Client application lookups SLSB in the JNDI and invokes its method. If SLSB throws exception (in this example - DAOException), I see on the client side ClassCastException.

      Caused by: java.lang.ClassCastException: net.uk.topdog.td2.common.dao.DAOException
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:53)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:77)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
      at $Proxy4.executeCommands(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      at net.uk.topdog.td2.common.jndi.RemoteProxy.invokeRemote(RemoteProxy.java:75)
      at net.uk.topdog.td2.common.jndi.RemoteProxy.invoke(RemoteProxy.java:40)
      at $Proxy4.executeCommands(Unknown Source)
      at net.uk.topdog.td2.common.dao.client.ClientUnTypedDAOImpl.executeCommands(ClientUnTypedDAOImpl.java:173)
      ... 12 more

      I saw ClassCastException for EJBException also.
      And ClassCastException for NotFoundInDispatcherException if I used clustered SLSB.

      My SessionBean :

      @Stateless(name = "UnTypedEmfDAORemoteSessionBean")
      @Remote(UnTypedEmfSerializableDAO.class)
      @Interceptors({EmfPreparerForSerialization.class})
      public class UnTypedEmfDAORemoteSessionBean implements UnTypedEmfSerializableDAO { ... }

      I use JBoss 4.0.5.GA with jboss-EJB-3.0_RC9_Patch_1 now.
      Earlier I used JBoss 4.0.4.GA with EJB 3.0 RC7 and didn't see ClassCastException.