5 Replies Latest reply on May 15, 2002 11:37 AM by Ryan Scharer

    Classpath Bug

    Ryan Scharer Newbie

      Application recycling doesn't appear to work correctly in 3.0RC2. After an ejb module is redeployed, old versions of classes are still hanging around, messing up the creation and use of dynamic proxies.

      Scenario:
      Boot JBoss, look up a local home, and stuff the resulting proxy into a local variable(obj). Invoking the following two method will produce the same result:

      1) obj.getClass().getInterfaces()[0].hashCode();
      2) Class.forName("myEntityBean").hashCode();

      Now recycle the application by touching its jar or ejb-jar.xml file. Run the same two code snippets. This time they will return different results.

      The consequence of this is that you'll get a ClassCastException while trying to narrow the proxy to the class of your home interface.

        • 1. Re: Classpath Bug
          Ryan Scharer Newbie

          I've just confirmed that this classpath conflict occurs only in exploded ejb-jar modules, not zipped ones. Does anyone have any idea why this would be the case?

          Thanks.

          • 2. Re: Classpath Bug
            David Jencks Master

            Could you also check if this works better with the cvs version? I changed some things so UnifiedClassloaders were released on undeployment.

            • 3. Re: Classpath Bug
              Ryan Scharer Newbie

              I'm having a lot of trouble getting my app to deploy on the latest 3.1 alpha code... are your changes in a 3.0x tag yet?

              • 4. Re: Classpath Bug
                Ryan Scharer Newbie

                I can't verify this on the current RC3 tag, either... all my entities keep throwing this:
                java.lang.IllegalStateException: removing bean lock and it has tx set!
                at org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock.removeRef(QueuedP
                essimisticEJBLock.java:469)
                at org.jboss.ejb.BeanLockManager.removeLockRef(BeanLockManager.java:78)
                at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockIntercep
                tor.java:124)
                at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreation
                Interceptor.java:69)
                at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
                rceptor.java:96)
                at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
                torCMT.java:167)
                at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
                1)
                at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
                java:129)
                at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
                at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
                at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLoca
                lContainerInvoker.java:296)
                at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
                at $Proxy342.getValue(Unknown Source)
                at com.classwell.administration.ejb.LoginSessionBean.login(LoginSessionB
                ean.java:86)
                at java.lang.reflect.Method.invoke(Native Method)
                at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(S
                tatelessSessionContainer.java:664)
                at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
                ke(CachedConnectionInterceptor.java:147)
                at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(Stat
                elessSessionInstanceInterceptor.java:77)
                at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
                rceptor.java:96)
                at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
                torCMT.java:167)
                at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:6
                1)
                at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
                java:129)
                at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
                at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContai
                ner.java:313)
                at org.jboss.ejb.Container.invoke(Container.java:705)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491)
                at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
                364)
                at java.lang.reflect.Method.invoke(Native Method)
                at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
                at sun.rmi.transport.Transport$1.run(Transport.java:147)
                at java.security.AccessController.doPrivileged(Native Method)
                at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
                at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
                60)
                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
                .java:701)
                at java.lang.Thread.run(Thread.java:479)

                • 5. Re: Classpath Bug
                  Ryan Scharer Newbie

                  I just merged your forgetProxyForClass stuff back into my RC2 tree, but it doesn't seem to have fixed the problem.

                  Thanks.