6 Replies Latest reply: Jun 24, 2012 9:15 PM by gigazhang RSS

    KnowledgeStoreServiceImpl.buildCommandService java.lang.reflect.InvocationTargetException

    gigazhang Newbie

      java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

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

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

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

          at com.baison.demo.jbpm.commons.TaskServiceImpl.createSession(TaskServiceImpl.java:263)

          at com.baison.demo.jbpm.service.TaskProcessServiceImpl.startProcess(TaskProcessServiceImpl.java:92)

          at com.baison.demo.jbpm.controller.TaskProcessController.getUserCommitProcess(TaskProcessController.java:75)

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

          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

          at java.lang.reflect.Method.invoke(Method.java:597)

          at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:212)

          at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)

          at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)

          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)

          at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)

          at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)

          at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:900)

          at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)

          at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)

          at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789)

          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.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)

          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

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

          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:102)

          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:859)

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

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

          at java.lang.Thread.run(Thread.java:662)

      Caused by: java.lang.reflect.InvocationTargetException

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

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

          at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

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

          ... 37 more

      Caused by: java.lang.RuntimeException: Could not commit session or rollback

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

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

          ... 42 more

      Caused by: 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:369)

          ... 43 more

      Caused by: java.lang.NullPointerException

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

          ... 44 more

        • 1. Re: KnowledgeStoreServiceImpl.buildCommandService java.lang.reflect.InvocationTargetException
          Mauricio Salatino Master

          This is not even a question.

          What are you trying to do when you get this exception? Can you share your configurations and the jBPM version that you are using?
          Cheers

          • 2. Re: KnowledgeStoreServiceImpl.buildCommandService java.lang.reflect.InvocationTargetException
            gigazhang Newbie

            5.3.0.Final

             

            when I do so:

             

            KnowledgeBase kbase = readKnowledgeBase(url);

                    // 创建EntityManagerFactory

                    Environment env = KnowledgeBaseFactory.newEnvironment();

                    env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, entityManagerFactory);

                    env.set(EnvironmentName.TRANSACTION_MANAGER, transactionManager);

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

             

                    Properties properties = new Properties();

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

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

                    KnowledgeSessionConfiguration config = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);

                   

                    return JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);

            • 3. Re: KnowledgeStoreServiceImpl.buildCommandService java.lang.reflect.InvocationTargetException
              Mauricio Salatino Master

              Can you check your classpath to see that you have the correct dependencies set?

              Did you update your applicaiton from a different jBPM version?

              Cheers

              • 5. Re: KnowledgeStoreServiceImpl.buildCommandService java.lang.reflect.InvocationTargetException
                Mauricio Salatino Master

                How did you do that update?

                Are you using maven?

                • 6. Re: KnowledgeStoreServiceImpl.buildCommandService java.lang.reflect.InvocationTargetException
                  gigazhang Newbie

                  <dependency>

                              <groupId>org.jbpm</groupId>

                              <artifactId>jbpm-flow</artifactId>

                              <version>${jbpm.version}</version>

                          </dependency>

                          <dependency>

                              <groupId>org.jbpm</groupId>

                              <artifactId>jbpm-flow-builder</artifactId>

                              <version>${jbpm.version}</version>

                          </dependency>

                          <dependency>

                              <groupId>org.jbpm</groupId>

                              <artifactId>jbpm-persistence-jpa</artifactId>

                              <version>${jbpm.version}</version>

                          </dependency>

                          <dependency>

                              <groupId>org.jbpm</groupId>

                              <artifactId>jbpm-gwt-graph</artifactId>

                              <version>${jbpm.stable.version}</version>

                              <exclusions>

                                  <exclusion>

                                      <groupId>org.jbpm</groupId>

                                      <artifactId>jbpm-human-task-hornetq</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.jbpm</groupId>

                                      <artifactId>jbpm-human-task-jms</artifactId>

                                  </exclusion>

                                  <exclusion>

                                      <groupId>org.hornetq</groupId>

                                      <artifactId>hornetq-core</artifactId>

                                  </exclusion>

                              </exclusions>

                          </dependency>

                          <dependency>

                              <groupId>org.jbpm</groupId>

                              <artifactId>jbpm-bam</artifactId>

                              <version>${jbpm.stable.version}</version>

                          </dependency>

                   

                   

                  <jbpm.version>5.3.0.Final</jbpm.version>

                  <jbpm.stable.version>5.3.0.Final</jbpm.stable.version>