5 Replies Latest reply on Aug 23, 2006 1:11 PM by brado

    Web app hot deploy problem

    jpaagt

      Hello forum members,

      I'm developing a web application that uses JBPM under JBoss Application Server 4.0.0 with Tomcat. JBPM is deployed in a SAR (that registers the session in JNDI) in JBoss and the JbpmSessionFactory is obtained using the static method getInstance that looks it up in JNDI.

      All is working well, but I have an anoying problem when trying to hot deploy the web application. The deployment seems to work fine but when a request is made that uses JBPM the following exception is logged to the standard output:

      Caused by: java.lang.IllegalStateException: The org.jbpm.taskmgmt.def.Task Cache is not alive.
      15:25:31,750 INFO [STDOUT] at net.sf.ehcache.Cache.checkStatus(Cache.java:713)
      15:25:31,751 INFO [STDOUT] at net.sf.ehcache.Cache.get(Cache.java:355)
      15:25:31,751 INFO [STDOUT] at org.hibernate.cache.EhCache.get(EhCache.java:110)
      15:25:31,751 INFO [STDOUT] at org.hibernate.cache.NonstrictReadWriteCache.get(NonstrictReadWriteCache.java:41)
      15:25:31,751 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:438)
      15:25:31,751 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:314)
      15:25:31,751 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113)
      15:25:31,751 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:151)
      15:25:31,751 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79)
      15:25:31,752 INFO [STDOUT] at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:655)
      15:25:31,752 INFO [STDOUT] at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:261)
      15:25:31,752 INFO [STDOUT] at org.hibernate.type.EntityType.resolve(EntityType.java:286)
      15:25:31,752 INFO [STDOUT] at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:105)
      15:25:31,752 INFO [STDOUT] at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:530)
      15:25:31,752 INFO [STDOUT] at org.hibernate.loader.Loader.doQuery(Loader.java:436)
      15:25:31,752 INFO [STDOUT] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
      15:25:31,752 INFO [STDOUT] at org.hibernate.loader.Loader.doList(Loader.java:1593)
      15:25:31,753 INFO [STDOUT] at org.hibernate.loader.Loader.list(Loader.java:1577)
      15:25:31,753 INFO [STDOUT] at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:395)
      15:25:31,753 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
      15:25:31,753 INFO [STDOUT] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:844)
      15:25:31,753 INFO [STDOUT] at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
      15:25:31,753 INFO [STDOUT] at com.flare.jbpm.wrapper.TaskMgmtSessionWrapper.findPooledTaskInstances(Unknown Source)
      15:25:31,753 INFO [STDOUT] at com.flare.jbpm.api.JbpmApiUtil.getTasks(JbpmApiUtil.java:73)
      15:25:31,753 INFO [STDOUT] ... 78 more
      15:25:52,443 ERROR [GraphSession] java.lang.IllegalStateException: The org.jbpm.graph.def.ProcessDefinition Cache is not alive.
      15:25:52,460 INFO [STDOUT] at net.sf.ehcache.Cache.checkStatus(Cache.java:713)
      15:25:52,460 INFO [STDOUT] at net.sf.ehcache.Cache.get(Cache.java:355)
      15:25:52,460 INFO [STDOUT] at org.hibernate.cache.EhCache.get(EhCache.java:110)
      15:25:52,460 INFO [STDOUT] at org.hibernate.cache.NonstrictReadWriteCache.get(NonstrictReadWriteCache.java:41)
      15:25:52,460 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.loadFromSecondLevelCache(DefaultLoadEventListener.java:438)
      15:25:52,460 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:314)
      15:25:52,461 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:113)
      15:25:52,461 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:151)
      15:25:52,461 INFO [STDOUT] at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:79)
      15:25:52,461 INFO [STDOUT] at org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:655)
      15:25:52,461 INFO [STDOUT] at org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:261)
      15:25:52,461 INFO [STDOUT] at org.hibernate.type.EntityType.resolve(EntityType.java:286)
      15:25:52,461 INFO [STDOUT] at org.hibernate.type.EntityType.nullSafeGet(EntityType.java:207)
      15:25:52,461 INFO [STDOUT] at org.hibernate.impl.IteratorImpl.postNext(IteratorImpl.java:92)
      15:25:52,461 INFO [STDOUT] at org.hibernate.impl.IteratorImpl.(IteratorImpl.java:57)
      15:25:52,462 INFO [STDOUT] at org.hibernate.loader.hql.QueryLoader.iterate(QueryLoader.java:412)
      15:25:52,462 INFO [STDOUT] at org.hibernate.hql.ast.QueryTranslatorImpl.iterate(QueryTranslatorImpl.java:281)
      15:25:52,462 INFO [STDOUT] at org.hibernate.impl.SessionImpl.iterate(SessionImpl.java:935)
      15:25:52,462 INFO [STDOUT] at org.hibernate.impl.QueryImpl.iterate(QueryImpl.java:41)
      15:25:52,462 INFO [STDOUT] at org.jbpm.db.GraphSession.findLatestProcessDefinition(GraphSession.java:91)
      15:25:52,462 INFO [STDOUT] ... 80 more

      Does anyone know how to hot deploy a JBPM enabled web application?

        • 1. Re: Web app hot deploy problem
          kukeltje

          uhhhmmm... by just deploying it.... I've never seen this error before. Did you make specific changes to the hibernate config?

          • 2. Re: Web app hot deploy problem
            jpaagt

            No changes to the hibernate config. The error does not occur when deployed but after deployment when trying to open a JbpmSession. In my application I'm using my own hibernate model with it's own hibernate config. I use an open session in view filter. I think the error has something to do with that. I load the Configuration for my app as follows:

            1) File configFile = new File(filterConfig.getServletContext().getRealPath("/WEB-INF/classes/hibernate.cfg.xml"));
            2) factory = new Configuration().configure(configFile).buildSessionFactory();

            When the web app is reloaded, the filter is reloaded. When I remove the filter all works fine, so I think it has to do with these to lines... :S

            • 3. Re: Web app hot deploy problem
              kukeltje

              no changes to the hibernate config BUT using your own. how much does your hibernate config differ from the ones used by jBPM?

              • 4. Re: Web app hot deploy problem
                jpaagt

                The hibernate config used by JBPM has not been modified, and I have a diferent model in hibernate with its own config. What changes? Well the datasource used for example because both models use diferent databases. The question is, does one hibernate config affect the other or are they completely isolated? When the server is started with the web app already deployed all works well, so both hibernate models are working fine, accesing there own datasources... but, when the app is redeployed (hot deploy), the JBPM part fails with the exeption I posted earlier.

                Does my explenation make sence? Or are do I have to post more details about the App? If yes, what files or fragments of code should I post?

                • 5. Re: Web app hot deploy problem
                  brado

                  I realize my response is about a year after the fact, but in case anyone else had come across this thread, I thought I'd reference you to a post in another JBoss forum on deployment:

                  http://www.jboss.com/index.html?module=bb&op=viewtopic&t=89209

                  The gist of the post is that I believe that there is a bug in JBoss 4.0.4 hot deployment.

                  Hope that helps someone.

                  Brad