1 Reply Latest reply on Oct 1, 2003 12:07 AM by Alexey Pismenskiy

    Hot Redeployment - ClassCastException. Part 123456

    Alexey Pismenskiy Newbie

      As I can see this topic has already been discussed, but I have not found a solution
      of my trouble yet.

      I use JBoss 3.0.4
      I have developed .jar with CMP and session bean (session facade) for that CMP.
      When I start and stop JBoss (almost :) everything works fine, but after hot redeployment
      I catch a ClassCastException in
      this.mlsTreeLocalHome = (MlsTreeLocalHome) locator.getLocalHome(ENTITY_NAME);


      source code is
      //-------------------------------------------------------
      final String ENTITY_NAME = "java:comp/env/ejb/MlsTreeBean";
      try {
      Properties props = new Properties();
      ServiceLocator locator = new ServiceLocator(props);
      this.mlsTreeLocalHome = (MlsTreeLocalHome) locator.getLocalHome(ENTITY_NAME);
      // ClassCastException raises here after hot redeployment
      }
      catch (ServiceLocatorException e) {
      log.error("<findMlsTreeBeanHome()>: ServiceLocatorException. " + e.getMessage());
      throw new RemoteException(e.getMessage());
      }
      catch (ClassCastException e1) {
      log.error("<findMlsTreeBeanHome()>: ClassCastException. " + e1.getMessage());
      throw new RemoteException(e1.getMessage());
      }
      //-------------------------------------------------------
      StackTrace is
      //-------------------------------------------------------
      14:26:33,785 ERROR [org.jboss.ejb.plugins.LogInterceptor] RuntimeException:

      java.lang.ClassCastException

      at ru.mgr.mls.cmp.mlstree.MlsTreeBeanSessionFacadeBean.findMlsTreeBeanHome(MlsTreeBeanSessionFacadeBean.java:53)

      at ru.mgr.mls.cmp.mlstree.MlsTreeBeanSessionFacadeBean.setSessionContext(MlsTreeBeanSessionFacadeBean.java:35)

      at org.jboss.ejb.StatefulSessionEnterpriseContext.(StatefulSessionEnterpriseContext.java:51)

      at org.jboss.ejb.plugins.StatefulSessionInstancePool.create(StatefulSessionInstancePool.java:51)

      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.java:209)

      at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invokeHome(StatefulSessionInstanceInterceptor.java:113)

      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:111)

      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:178)

      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:52)

      at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:129)

      at org.jboss.ejb.StatefulSessionContainer.invokeHome(StatefulSessionContainer.java:368)

      at org.jboss.ejb.Container.invoke(Container.java:730)

      at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:517)

      at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:382)

      at sun.reflect.GeneratedMethodAccessor73.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:324)

      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)

      at sun.rmi.transport.Transport$1.run(Transport.java:148)

      at java.security.AccessController.doPrivileged(Native Method)

      at sun.rmi.transport.Transport.serviceCall(Transport.java:144)

      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)

      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)

      at java.lang.Thread.run(Thread.java:536)