4 Replies Latest reply on Jun 3, 2005 10:58 AM by Scott Stark

    EJBs Redeployment in JBoss 4.0.2

    eric cartman Newbie

      Hi,

      I am having problems with redeploying an EJB. I've been reading lots of threads to avoid posting this message and solve my problem. But unfortunetely all questions/answers are focused on EARs and WARs which does not help me specifically at all. I have a very simple Stateless SessionBean and I want to be able to hot-redeploy it? It works after a restart of JBoss but when I redeploy it doesn't.

      Can please somebody tell me to do something about it very simply?

      Is it simply not possible with JBoss 4.0.2?

      Regards.

        • 1. Re: EJBs Redeployment in JBoss 4.0.2
          Darran Lofthouse Master

          What do you mean by it doesn't work?

          As long as I don't have existing clients using the session bean at the time of redeployment I don't have any problems redeploying beans.

          http://wiki.jboss.org/wiki/Wiki.jsp?page=MakeSureRequestsBeingProcessedAreNotImpactedByHotDeployments

          • 2. Re: EJBs Redeployment in JBoss 4.0.2
            eric cartman Newbie

            It doesn't work this way.

            I deploy a Stateless Session Bean with JUnit tests in it. (TestRunnerSession provided by JUnit is already deployed).

            I start JBoss and run the JUnit test and it works. I change (or don't change anything) in the bean, and redeploy it. JBoss seems to deploy it fine. Then I try to run the test again and it fails.

            I get ;

            14:22:47,711 ERROR [LogInterceptor] TransactionRolledbackException in method: public abstract com.aircom.ejb.MySession com.aircom.ejb.MySessionHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException, causedBy:
            javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract com.aircom.ejb.MySession com.aircom.ejb.MySessionHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException
            at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHome(StatelessSessionContainer.java:161)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:81)
            at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
            at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
            at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
            at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
            at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
            at org.jboss.ejb.Container.invoke(Container.java:894)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
            at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
            at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
            at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
            at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
            at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
            at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
            at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
            at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
            at $Proxy60.create(Unknown Source)
            at test.com.aircom.ejb.MySessionBeanTest.setUp(MySessionBeanTest.java:58)
            at junit.framework.TestCase.runBare(TestCase.java:125)
            at junit.framework.ejb.ServerTestCase.runBareAtServer(ServerTestCase.java:107)
            at junit.framework.ejb.TestRunnerSessionBean.runTest(TestRunnerSessionBean.java:37)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
            at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
            at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
            at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
            at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
            at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
            at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
            at org.jboss.ejb.Container.invoke(Container.java:873)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
            at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
            at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
            at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
            at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
            at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
            at sun.rmi.transport.Transport$1.run(Transport.java:153)
            at java.security.AccessController.doPrivileged(Native Method)
            at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
            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:595)
            14:22:47,711 INFO [STDOUT] javax.transaction.TransactionRolledbackException: Invalid invocation, check your deployment packaging, method=public abstract com.aircom.ejb.MySession com.aircom.ejb.MySessionHome.create() throws java.rmi.RemoteException,javax.ejb.CreateE
            javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract com.aircom.ejb.MySession com.aircom.ejb.MySessionHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException
            14:22:47,711 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:244)
            14:22:47,711 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
            14:22:47,711 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:146)
            14:22:47,711 INFO [STDOUT] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.java:116)
            14:22:47,711 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:121)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invokeHome(ProxyFactoryFinderInterceptor.java:93)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.SessionContainer.internalInvokeHome(SessionContainer.java:613)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:894)
            14:22:47,727 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            14:22:47,727 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            14:22:47,727 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            14:22:47,727 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
            14:22:47,727 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:155)
            14:22:47,727 INFO [STDOUT] at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:104)
            14:22:47,727 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:179)
            14:22:47,727 INFO [STDOUT] at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:165)
            14:22:47,727 INFO [STDOUT] at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:46)
            14:22:47,727 INFO [STDOUT] at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:55)
            14:22:47,727 INFO [STDOUT] at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:169)
            14:22:47,727 INFO [STDOUT] at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:86)
            14:22:47,727 INFO [STDOUT] at $Proxy60.create(Unknown Source)
            14:22:47,727 INFO [STDOUT] at test.com.aircom.ejb.MySessionBeanTest.setUp(MySessionBeanTest.java:58)
            14:22:47,727 INFO [STDOUT] at junit.framework.TestCase.runBare(TestCase.java:125)
            14:22:47,727 INFO [STDOUT] at junit.framework.ejb.ServerTestCase.runBareAtServer(ServerTestCase.java:107)
            14:22:47,727 INFO [STDOUT] at junit.framework.ejb.TestRunnerSessionBean.runTest(TestRunnerSessionBean.java:37)
            14:22:47,727 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            14:22:47,727 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            14:22:47,727 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            14:22:47,727 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            14:22:47,727 INFO [STDOUT] at org.jboss.invocation.Invocation.performCall(Invocation.java:345)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:214)
            14:22:47,727 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:130)
            14:22:47,727 INFO [STDOUT] at org.jboss.webservice.server.ServiceEndpointInterceptor.invoke(ServiceEndpointInterceptor.java:51)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:48)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:105)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:335)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:166)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:139)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:192)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.SessionContainer.internalInvoke(SessionContainer.java:624)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.Container.invoke(Container.java:873)
            14:22:47,727 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            14:22:47,727 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            14:22:47,727 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            14:22:47,727 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:249)
            14:22:47,727 INFO [STDOUT] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:644)
            14:22:47,727 INFO [STDOUT] at org.jboss.invocation.jrmp.server.JRMPInvoker$MBeanServerAction.invoke(JRMPInvoker.java:805)
            14:22:47,727 INFO [STDOUT] at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:406)
            14:22:47,727 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            14:22:47,727 INFO [STDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            14:22:47,727 INFO [STDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            14:22:47,727 INFO [STDOUT] at java.lang.reflect.Method.invoke(Method.java:585)
            14:22:47,727 INFO [STDOUT] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
            14:22:47,727 INFO [STDOUT] at sun.rmi.transport.Transport$1.run(Transport.java:153)
            14:22:47,727 INFO [STDOUT] at java.security.AccessController.doPrivileged(Native Method)
            14:22:47,727 INFO [STDOUT] at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
            14:22:47,727 INFO [STDOUT] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
            14:22:47,727 INFO [STDOUT] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
            14:22:47,727 INFO [STDOUT] at java.lang.Thread.run(Thread.java:595)
            14:22:47,727 INFO [STDOUT] Caused by: javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract com.aircom.ejb.MySession com.aircom.ejb.MySessionHome.create() throws java.rmi.RemoteException,javax.ejb.CreateException
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHome(StatelessSessionContainer.java:161)
            14:22:47,727 INFO [STDOUT] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:212)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:81)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractInterceptor.invokeHome(AbstractInterceptor.java:90)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.CallValidationInterceptor.invokeHome(CallValidationInterceptor.java:41)
            14:22:47,727 INFO [STDOUT] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:109)
            14:22:47,727 INFO [STDOUT] ... 69 more

            And I do some state checks with System.out.println if I modify anything, the changes are not getting noticed by JBoss.

            If I restart JBoss everything works. But If I hot redeploy again, if fails. So I assume this is a hot redeployment problem.

            However, I also have a client that uses the Bean, it works fine even with redeployments.

            Could it be a problem in JUnit? If you think it is, did you ever experienced a problem similar to mine?

            Regards.

            • 3. Re: EJBs Redeployment in JBoss 4.0.2
              eric cartman Newbie

              I've solved the problem.

              Thanks for the reply though.

              My problem was JUnit related. If I redeploy TestRunnerSession bean whenever (I mean before) I redeploy my SessionBean - which I want to run the test on - there is no problem, everything works fine.

              I think relates to Class Loading and Library sharing in JBoss.

              Regads.

              • 4. Re: EJBs Redeployment in JBoss 4.0.2
                Scott Stark Master

                The test runner has to be hanging onto the previous deployments class loader which results in an inconsistent type system. This is detected by the ejb container and results in the incompatible invocation msg.