1 2 Previous Next 17 Replies Latest reply on Jul 27, 2011 12:57 PM by Jo Blithe Go to original post
      • 15. Re: How to continue process in a web application
        Demian Calcaprina Master

        You can try with "update" or "validate"

        • 16. Re: How to continue process in a web application
          Jo Blithe Newbie

          Thanks Demian, appreciate it. ALready tried validate and it worked better. I just have one more problem and I would really appreciate your help. I have my sessioninfo table filled with rows and each row had an id. But I can't seem to still load the current state of my process from the database to continue my process. I keep getting error that session id 1 doesn't exist whereas it exist on the sessioninfo table. Please tell me, am I looking for the session id from the wrong table or the wrong column. Please, I'd appreciate your help. Thanks.

           

          part of my code:

           

                           EntityManagerFactory emf1 = Persistence.createEntityManagerFactory("org.jbpm.persistence.jpa");

           

           

          Environment env = KnowledgeBaseFactory.newEnvironment();

          env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf1);

          env.set(EnvironmentName.TRANSACTION_MANAGER,                    TransactionManagerServices.getTransactionManager());

           

          Properties properties = new Properties();

          properties.put("drools.processInstanceManagerFactory","org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");

          properties.put("drools.processSignalManagerFactory","org.jbpm.persistence.processinstance.JPASignalManagerFactory");

          KnowledgeSessionConfiguration configu = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);

           

          StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(1, kbase, configu, env);

           

           

           

          My error:

           

           

          org.apache.jasper.JasperException: An exception occurred processing JSP page /page2.jsp at line 117

           

          114: properties.put("drools.processInstanceManagerFactory","org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");

          115: properties.put("drools.processSignalManagerFactory","org.jbpm.persistence.processinstance.JPASignalManagerFactory");

          116: KnowledgeSessionConfiguration configu = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);

          117: StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(1, kbase, configu, env);

          118:

          119:

          120:            //StatefulKnowledgeSession ksession = JPAKnowledgeService.loadStatefulKnowledgeSession( 1, kbase, null, env );

           

           

          Stacktrace:

          org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)

          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:413)

          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

          javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

           

          root cause

          java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:103)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:71)
               org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:118)
               org.apache.jsp.page2_jsp._jspService(page2_jsp.java:213)
               org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
               org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
               org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

           

          root cause

          java.lang.reflect.InvocationTargetException
               sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
               sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
               java.lang.reflect.Constructor.newInstance(Constructor.java:513)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:88)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:71)
               org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:118)
               org.apache.jsp.page2_jsp._jspService(page2_jsp.java:213)
               org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
               org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
               org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

           

          root cause

          java.lang.RuntimeException: Could not find session data for id 1
               org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:178)
               org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:160)
               sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
               sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
               java.lang.reflect.Constructor.newInstance(Constructor.java:513)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:88)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:71)
               org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:118)
               org.apache.jsp.page2_jsp._jspService(page2_jsp.java:213)
               org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
               org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
               org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

           

          root cause

          javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not load an entity: [org.drools.persistence.info.SessionInfo#1]
               org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:614)
               org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:202)
               org.drools.persistence.jpa.JpaPersistenceContext.findSessionInfo(JpaPersistenceContext.java:21)
               org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:176)
               org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:160)
               sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
               sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
               java.lang.reflect.Constructor.newInstance(Constructor.java:513)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:88)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:71)
               org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:118)
               org.apache.jsp.page2_jsp._jspService(page2_jsp.java:213)
               org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
               org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
               org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

           

          root cause

          org.hibernate.exception.GenericJDBCException: could not load an entity: [org.drools.persistence.info.SessionInfo#1]
               org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
               org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
               org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
               org.hibernate.loader.Loader.loadEntity(Loader.java:1895)
               org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
               org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
               org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3072)
               org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:434)
               org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415)
               org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)
               org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:223)
               org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:126)
               org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905)
               org.hibernate.impl.SessionImpl.get(SessionImpl.java:842)
               org.hibernate.impl.SessionImpl.get(SessionImpl.java:835)
               org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)
               org.drools.persistence.jpa.JpaPersistenceContext.findSessionInfo(JpaPersistenceContext.java:21)
               org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:176)
               org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:160)
               sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
               sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
               java.lang.reflect.Constructor.newInstance(Constructor.java:513)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:88)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:71)
               org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:118)
               org.apache.jsp.page2_jsp._jspService(page2_jsp.java:213)
               org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
               org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
               org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

           

          root cause

          org.postgresql.util.PSQLException: Large Objects may not be used in auto-commit mode.
               org.postgresql.largeobject.LargeObjectManager.open(LargeObjectManager.java:200)
               org.postgresql.largeobject.LargeObjectManager.open(LargeObjectManager.java:172)
               org.postgresql.jdbc2.AbstractJdbc2BlobClob.<init>(AbstractJdbc2BlobClob.java:47)
               org.postgresql.jdbc2.AbstractJdbc2Blob.<init>(AbstractJdbc2Blob.java:21)
               org.postgresql.jdbc3.AbstractJdbc3Blob.<init>(AbstractJdbc3Blob.java:19)
               org.postgresql.jdbc3.Jdbc3Blob.<init>(Jdbc3Blob.java:20)
               org.postgresql.jdbc3.Jdbc3ResultSet.getBlob(Jdbc3ResultSet.java:52)
               org.postgresql.jdbc2.AbstractJdbc2ResultSet.getBlob(AbstractJdbc2ResultSet.java:337)
               org.hibernate.type.ByteArrayBlobType.get(ByteArrayBlobType.java:87)
               org.hibernate.type.AbstractLobType.nullSafeGet(AbstractLobType.java:46)
               org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
               org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2124)
               org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
               org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
               org.hibernate.loader.Loader.getRow(Loader.java:1230)
               org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
               org.hibernate.loader.Loader.doQuery(Loader.java:724)
               org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
               org.hibernate.loader.Loader.loadEntity(Loader.java:1881)
               org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:71)
               org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:65)
               org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:3072)
               org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:434)
               org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:415)
               org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:165)
               org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:223)
               org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:126)
               org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905)
               org.hibernate.impl.SessionImpl.get(SessionImpl.java:842)
               org.hibernate.impl.SessionImpl.get(SessionImpl.java:835)
               org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:182)
               org.drools.persistence.jpa.JpaPersistenceContext.findSessionInfo(JpaPersistenceContext.java:21)
               org.drools.persistence.SingleSessionCommandService.initKsession(SingleSessionCommandService.java:176)
               org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:160)
               sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
               sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
               sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
               java.lang.reflect.Constructor.newInstance(Constructor.java:513)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:88)
               org.drools.persistence.jpa.KnowledgeStoreServiceImpl.loadStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:71)
               org.drools.persistence.jpa.JPAKnowledgeService.loadStatefulKnowledgeSession(JPAKnowledgeService.java:118)
               org.apache.jsp.page2_jsp._jspService(page2_jsp.java:213)
               org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
               org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
               org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
               org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
               javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
          • 17. Re: How to continue process in a web application
            Jo Blithe Newbie

            Ok Got it solved. I forgot to wrap around UserTransaction. Thanks again Demian and Mary, really appreciate your time.

            1 2 Previous Next