0 Replies Latest reply on Apr 25, 2016 10:50 AM by Vasanth Kumar

    InvocationTargetException on creating StatefulKnowledgeSession.  BitronixTransactionManager.getTransaction() returns null

    Vasanth Kumar Newbie

      Hello All,

       

               Im new to jBPM . Trying to start process from my Web Application.

       

                Im trying to create newStatefulKnowledgeSession to start the process. TransactionManagerServices.getTransactionManager() returns null while setting it in

      org.kie.api.runtime.Environment for EnvironmentName.TRANSACTION_MANAGER.

       

       

          Im using Tomcat 7 server configured in Eclipse Kepler. Here is the code snippet and attached persistence.xml .

       

      Code Snippet:

       

                EntityManagerFactory emf = Persistence

                                 .createEntityManagerFactory("org.jbpm.persistence.jpa");

       

       

                     Environment env = KnowledgeBaseFactory

                                      .newEnvironment();

       

                     env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);

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

       

      // BitronixTransactionManager transactionManager = TransactionManagerServices.getTransactionManager();

      // transactionManager.getTransaction() : return null .

       

                     return JPAKnowledgeService

                                 .newStatefulKnowledgeSession(kbase, null, env);

       

      Kindly help me to resolve this. Should jndi.properties to be configured? If yes where to place it in web application?