1 Reply Latest reply on Dec 17, 2002 12:10 PM by adrian.brock

    Problems when redeploy EJB's

    josteinf

      Hi !

      I need some advice on this (using Jboss302 and embedded Jetty):

      1. Deployed a war-file and several jar's containing one stateless sessionBean per jar and a lot of EJB20 entity beans

      2. Running my web-application to use a method on one of the sessionsBeans. This works ok.

      3. But when I redeploy one of the jars again (nothing is changed) and calling the same method from the web-app it gives me an EJBException (when calling xxSessionHome.create()):

      2002-12-17 11:06:37,040 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException, causedBy:
      javax.ejb.EJBException: Invalid invocation, check your deployment packaging, method=public abstract com.edb.syscon.services.workflow.business.ejb.WorkflowServiceRemote com.edb.syscon.services.workflow.business.ejb.WorkflowServiceHome.create() throws javax.ejb.CreateException,java.rmi.RemoteException
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHome(StatelessSessionContainer.java:597)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invokeHome(CachedConnectionInterceptor.java:206)
      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invokeHome(StatelessSessionInstanceInterceptor.java:57)


      Question :

      1. Why this error when there is nothing new .....

      2. Is it possible to hot-deploy and continue the application eventually with new classes beeing loaded. Or must i always restart ?

        • 1. Re: Problems when redeploy EJB's

          The most likely cause is:

          Your servlet is holding a reference to the
          previous version of the xxSessionHome.

          You just redeployed that class. It is changed,
          it is reloaded in a new classloader, so it isn't the
          same class.

          You must cycle the servlet as well.

          One common solution to this problem is to put
          interfaces in a separate jar so that they do
          not get redeployed, just the bean implementations.

          Another is ear packaging so the servlet is reloaded
          with the ejbs.

          Regards,
          Adrian