3 Replies Latest reply on Aug 3, 2006 1:22 PM by Gary Cuozzo

    class cast exception

    Razvan Caraghin Newbie

      Hello,

      I am using JBoss 4.0.4.GA and i have the following problem:

      I have two ears,
      - first contains the ejbs jar + the ejb interfaces jar. The ejb jar refers the ejb interfaces jar.
      - the second ear contains a war archive that refers the ejb interfaces jar file. it also contains the ejb interfaces jar file in root.

      I also changed the ear deployer.xml to have isolation and call by value set to true.

      when I try to acquire a reference to a stateful session bean located in the first ear from the second ear, i get a class cast exception:

      SEVERE: Error Rendering View[/view_server.xhtml]
      javax.ejb.EJBException: java.lang.ClassCastException: $Proxy90
      at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:69)
      at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:83)

      ....
      Caused by: java.lang.ClassCastException: $Proxy90
      at org.nuxeo.os.delegate.EJBFactory.getServerOperations(EJBFactory.java:120)
      at org.nuxeo.os.delegate.BusinessDelegate.getServerOperationsRemote(BusinessDelegate.java:96)
      at org.nuxeo.os.delegate.BusinessDelegate$$EnhancerByCGLIB$$d66ac51f.CGLIB$getServerOperationsRemote$4()
      at org.nuxeo.os.delegate.BusinessDelegate$$EnhancerByCGLIB$$d66ac51f$$FastClassByCGLIB$$c53bdfc9.invoke()
      at net.sf.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:167)
      at org.jboss.seam.interceptors.JavaBeanInterceptor$1.proceed(JavaBeanInterceptor.java:80)




      basically after i've done some reading it seems it's a classloader problem.
      however, i need to separate the two ear files as they will ultimately be deployed on separate machines.

      Can you ples tell me how can i solve this?

      Razvan C