3 Replies Latest reply on Oct 31, 2014 2:31 AM by Maciej Swiderski

    Counld not commit/rollback transaction?

    星兰 蒋 Newbie

      Hi JBPM,

       

      i meet these Exception while i try to get a Session:

       

      EntityManagerFactory  emf = jbpmEMF;

      KnowledgeBase kbase = this.getKnowledgeBuilder().newKnowledgeBase();

      Environment env = KnowledgeBaseFactory.newEnvironment();

      env.set( EnvironmentName.ENTITY_MANAGER_FACTORY, emf );

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

      env.set( EnvironmentName.GLOBALS, new MapGlobalResolver() );

      StatefulKnowledgeSession ksession = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, null, env);

       

       

      473995 06/12 10:22:06,021[http-8080-1] ERROR drools.persistence.SingleSessionCommandService.rollbackTransaction  - Could not commit session

      java.lang.NullPointerException

      at org.drools.persistence.jta.JtaTransactionManager.getStatus(JtaTransactionManager.java:205)

      at org.drools.persistence.jta.JtaTransactionManager.begin(JtaTransactionManager.java:163)

      at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:148)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

      at java.lang.reflect.Constructor.newInstance(Unknown Source)

      at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:129)

      at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:67)

      at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)

      at com.sogou.ka.jbpm.impl.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:72)

      at com.sogou.ka.jbpm.impl.CommandDelegate.getSession(CommandDelegate.java:132)

      at com.sogou.ka.jbpm.impl.CommandDelegate.getProcess(CommandDelegate.java:150)

      at com.sogou.ka.jbpm.impl.ProcessManagementImpl.getProcessDefinition(ProcessManagementImpl.java:46)

      at com.sogou.ka.service.impl.ContractServiceImpl.newContractService(ContractServiceImpl.java:34)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)

      at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)

      at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)

      at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)

      at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)

      at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)

      at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

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

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)

      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

      at java.lang.Thread.run(Unknown Source)

      474011 06/12 10:22:06,037[http-8080-1] ERROR drools.persistence.SingleSessionCommandService.rollbackTransaction  - Could not rollback

      java.lang.RuntimeException: Unable to rollback transaction

      at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:197)

      at org.drools.persistence.SingleSessionCommandService.rollbackTransaction(SingleSessionCommandService.java:397)

      at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:157)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)

      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)

      at java.lang.reflect.Constructor.newInstance(Unknown Source)

      at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:129)

      at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:67)

      at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:122)

      at com.sogou.ka.jbpm.impl.CommandDelegate.newStatefulKnowledgeSession(CommandDelegate.java:72)

      at com.sogou.ka.jbpm.impl.CommandDelegate.getSession(CommandDelegate.java:132)

      at com.sogou.ka.jbpm.impl.CommandDelegate.getProcess(CommandDelegate.java:150)

      at com.sogou.ka.jbpm.impl.ProcessManagementImpl.getProcessDefinition(ProcessManagementImpl.java:46)

      at com.sogou.ka.service.impl.ContractServiceImpl.newContractService(ContractServiceImpl.java:34)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

      at java.lang.reflect.Method.invoke(Unknown Source)

      at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)

      at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)

      at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)

      at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)

      at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)

      at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)

      at org.directwebremoting.servlet.DwrServlet.doPost(DwrServlet.java:146)

      at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)

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

      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)

      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)

      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)

      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)

      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

      at java.lang.Thread.run(Unknown Source)

      Caused by: java.lang.NullPointerException

      at org.drools.persistence.jta.JtaTransactionManager.rollback(JtaTransactionManager.java:193)

      ... 39 more

       

      All help will be appriciate!

       

      Thanks and Best Regards