1 Reply Latest reply on Oct 26, 2015 5:01 AM by Jaime Izuzquiza Suárez-Inclán

    jBPM6.2 - Error while creating persistence

    Jaime Izuzquiza Suárez-Inclán Newbie

      Hi all,

       

      I'm getting an error while creating persistence in my jbpm6 application. I'm using an Oracle database, and my persistence.xml is attached:

       

      09:30:06,572 ERROR [stderr] (http-/0.0.0.0:8080-1) java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

      09:30:06,573 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:185)

      09:30:06,573 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newKieSession(KnowledgeStoreServiceImpl.java:70)

      09:30:06,573 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newKieSession(KnowledgeStoreServiceImpl.java:39)

      09:30:06,574 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.kie.internal.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:121)

      09:30:06,574 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jbpm.runtime.manager.impl.factory.JPASessionFactory.newKieSession(JPASessionFactory.java:42)

      09:30:06,575 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jbpm.runtime.manager.impl.PerRequestRuntimeManager$PerRequestInitializer.initKieSession(PerRequestRuntimeManager.java:163)

      09:30:06,575 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jbpm.runtime.manager.impl.RuntimeEngineImpl.getKieSession(RuntimeEngineImpl.java:70)

      09:30:06,575 ERROR [stderr] (http-/0.0.0.0:8080-1) at aegon.bpm.tallerproductos.services.ServiceImpl.loadBPMProcess(ServiceImpl.java:62)

      09:30:06,576 ERROR [stderr] (http-/0.0.0.0:8080-1) at aegon.bpm.tallerproductos.services.ServiceImpl$Proxy$_$$_WeldClientProxy.loadBPMProcess(ServiceImpl$Proxy$_$$_WeldClientProxy.java)

      09:30:06,576 ERROR [stderr] (http-/0.0.0.0:8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      09:30:06,577 ERROR [stderr] (http-/0.0.0.0:8080-1) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

      09:30:06,577 ERROR [stderr] (http-/0.0.0.0:8080-1) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      09:30:06,577 ERROR [stderr] (http-/0.0.0.0:8080-1) at java.lang.reflect.Method.invoke(Method.java:606)

      09:30:06,578 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168)

      09:30:06,578 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)

      09:30:06,579 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227)

      09:30:06,579 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216)

      09:30:06,579 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:541)

      09:30:06,580 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:523)

      09:30:06,580 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125)

      09:30:06,581 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)

      09:30:06,581 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)

      09:30:06,581 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)

      09:30:06,582 ERROR [stderr] (http-/0.0.0.0:8080-1) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

      09:30:06,582 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295)

      09:30:06,583 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)

      09:30:06,583 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231)

      09:30:06,583 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149)

      09:30:06,584 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

      09:30:06,584 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.as.jpa.interceptor.WebNonTxEmCloserValve.invoke(WebNonTxEmCloserValve.java:50)

      09:30:06,585 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169)

      09:30:06,585 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:150)

      09:30:06,585 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97)

      09:30:06,586 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:400)

      09:30:06,586 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102)

      09:30:06,587 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:344)

      09:30:06,587 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:854)

      09:30:06,587 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:653)

      09:30:06,588 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926)

      09:30:06,588 ERROR [stderr] (http-/0.0.0.0:8080-1) at java.lang.Thread.run(Thread.java:745)

      09:30:06,589 ERROR [stderr] (http-/0.0.0.0:8080-1) Caused by: java.lang.reflect.InvocationTargetException

      09:30:06,589 ERROR [stderr] (http-/0.0.0.0:8080-1) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      09:30:06,590 ERROR [stderr] (http-/0.0.0.0:8080-1) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

      09:30:06,590 ERROR [stderr] (http-/0.0.0.0:8080-1) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

      09:30:06,590 ERROR [stderr] (http-/0.0.0.0:8080-1) at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

      09:30:06,591 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:171)

      09:30:06,591 ERROR [stderr] (http-/0.0.0.0:8080-1) ... 39 more

      09:30:06,592 ERROR [stderr] (http-/0.0.0.0:8080-1) Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement

      09:30:06,592 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)

      09:30:06,592 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310)

      09:30:06,593 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1316)

      09:30:06,593 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:881)

      09:30:06,594 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.drools.persistence.jpa.JpaPersistenceContext.persist(JpaPersistenceContext.java:41)

      09:30:06,594 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:105)

      09:30:06,594 ERROR [stderr] (http-/0.0.0.0:8080-1) ... 44 more

      09:30:06,595 ERROR [stderr] (http-/0.0.0.0:8080-1) Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement

      09:30:06,595 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:74)

      09:30:06,596 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:49)

      09:30:06,596 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:124)

      09:30:06,596 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)

      09:30:06,597 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:189)

      09:30:06,597 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:96)

      09:30:06,598 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:58)

      09:30:06,598 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2987)

      09:30:06,598 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:3499)

      09:30:06,599 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:81)

      09:30:06,599 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:395)

      09:30:06,600 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:229)

      09:30:06,600 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:209)

      09:30:06,600 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:193)

      09:30:06,601 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:321)

      09:30:06,601 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:286)

      09:30:06,602 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:192)

      09:30:06,602 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:125)

      09:30:06,602 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.ejb.event.EJB3PersistEventListener.saveWithGeneratedId(EJB3PersistEventListener.java:78)

      09:30:06,603 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:208)

      09:30:06,603 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:151)

      09:30:06,604 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:78)

      09:30:06,604 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:772)

      09:30:06,604 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:746)

      09:30:06,605 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:750)

      09:30:06,605 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:875)

      09:30:06,606 ERROR [stderr] (http-/0.0.0.0:8080-1) ... 46 more

      09:30:06,606 ERROR [stderr] (http-/0.0.0.0:8080-1) Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("JBMPDB"."SESSIONINFO"."ID")

      09:30:06,606 ERROR [stderr] (http-/0.0.0.0:8080-1)

      09:30:06,607 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:447)

      09:30:06,607 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:396)

      09:30:06,607 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:951)

      09:30:06,608 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:513)

      09:30:06,608 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:227)

      09:30:06,609 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:531)

      09:30:06,609 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:208)

      09:30:06,609 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1046)

      09:30:06,610 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1336)

      09:30:06,610 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3613)

      09:30:06,611 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3694)

      09:30:06,611 ERROR [stderr] (http-/0.0.0.0:8080-1) at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1354)

      09:30:06,611 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.jboss.jca.adapters.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:493)

      09:30:06,612 ERROR [stderr] (http-/0.0.0.0:8080-1) at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:186)

      09:30:06,612 ERROR [stderr] (http-/0.0.0.0:8080-1) ... 67 more

       

      This is the really important sentence: Caused by: java.sql.SQLIntegrityConstraintViolationException: ORA-01400: cannot insert NULL into ("JBMPDB"."SESSIONINFO"."ID")

       

      This is the way I'm trying to create the process with jBPM:

       

        KieServices ks = KieServices.Factory.get();

        KieContainer kContainer = ks.getKieClasspathContainer();

        KieBase kbase = kContainer.getKieBase(kiebase); // "TallerProductosKB"

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

        RuntimeEnvironmentBuilder builder = RuntimeEnvironmentBuilder.Factory.get()

        .newDefaultBuilder().entityManagerFactory(emf)/*.userGroupCallback(userGroupCallback)*/

        .knowledgeBase(kbase);

       

        // manager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(builder.get(), "");

        RuntimeManager manager = RuntimeManagerFactory.Factory.get().newPerRequestRuntimeManager(builder.get());

       

        // TODO: esto pertenece a la creación de la instancia y no a la carga del proceso.

        /* INI Instanciación del proceso */

        RuntimeEngine engine = manager.getRuntimeEngine(null);

        KieSession ksession = engine.getKieSession();

        TaskService taskService = engine.getTaskService();

        ProcessInstance processInstance = ksession.startProcess("crearproducto"); // "crearproducto"

       

      Does anyone know where is the problem? The exception is produced in this sentence: KieSession ksession = engine.getKieSession();

       

      Thank you.