6 Replies Latest reply on Oct 7, 2015 6:07 PM by rajiv_dadhich

    Trying to run jBPM 6.1 in spring 4.0.6.RELEASE

    ken_re

      Can anyone please offer suggestions as to how to fix this.  I am having trouble getting the runtime manager to work.  Any help would be appreciated.

       

       

      Thanks in advance.


       

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'workFlowController' defined in file [C:\Users\krepddat\Documents\workspace-sts-3.6.1.RELEASE\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\spotauth-service\WEB-INF\classes\mo\spectra\ds\spotauth\controller\WorkFlowController.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: No task persistence context available

       

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1553)

       

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)

       

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475)

       

      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)

       

      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228)

       

      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)

       

      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)

       

      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:703)

       

      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:760)

       

      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)

       

      at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)

       

      at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)

       

      at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)

       

      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4751)

       

      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5175)

       

      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)

       

      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408)

       

      at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398)

       

      Caused by: java.lang.IllegalStateException: No task persistence context available

       

      at org.jbpm.services.task.commands.TaskContext.getPersistenceContext(TaskContext.java:114)

       

      at org.jbpm.services.task.commands.InitDeadlinesCommand.execute(InitDeadlinesCommand.java:32)

       

      at org.jbpm.services.task.commands.InitDeadlinesCommand.execute(InitDeadlinesCommand.java:18)

       

      at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65)

       

      at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40)

       

      at org.jbpm.services.task.impl.TaskDeadlinesServiceImpl.initialize(TaskDeadlinesServiceImpl.java:367)

       

      at org.jbpm.services.task.HumanTaskConfigurator.getTaskService(HumanTaskConfigurator.java:153)

       

      at org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory.newTaskService(LocalTaskServiceFactory.java:65)

       

      at org.jbpm.runtime.manager.impl.SingletonRuntimeManager.init(SingletonRuntimeManager.java:82)

       

      at org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl.newSingletonRuntimeManager(RuntimeManagerFactoryImpl.java:71)

       

      at mo.spectra.ds.spotauth.controller.WorkFlowController.createRuntimeManager(WorkFlowController.java:60)

       

      at mo.spectra.ds.spotauth.controller.WorkFlowController.afterPropertiesSet(WorkFlowController.java:38)

       

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)

       

      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)

       

        • 1. Re: Trying to run jBPM 6.1 in spring 4.0.6.RELEASE
          swiderski.maciej

          looks like you don't have jbpm-human-task-jpa jar on your classpath

           

          HTH

          1 of 1 people found this helpful
          • 2. Re: Trying to run jBPM 6.1 in spring 4.0.6.RELEASE
            joe_re

            Thanks for the reply but that is not the issue.  jbpm-human-task-jpa.jar is on the class path.  It seems this error is a catchall and the problem is create elsewhere.

             

            I think the problem is in this method found in TaskTransactionInterceptor and an exception is thrown at this call

             

               this.txm = new JtaTransactionManager( env.get( EnvironmentName.TRANSACTION ),

               env.get( EnvironmentName.TRANSACTION_SYNCHRONIZATION_REGISTRY ),

               tm );

             

            tm is a not null.  but the other two are definitely null.

            an exception is thrown because env.get(EnvironmentName.TRANSACTION) is null . 

            Not sure how to get a transaction when doing an initialization.

             

            Anyone have any thoughts?

             

            public void initTransactionManager(Environment env) {

              Object tm = env.get( EnvironmentName.TRANSACTION_MANAGER );

               if ( env.get( EnvironmentName.TASK_PERSISTENCE_CONTEXT_MANAGER ) != null &&

               env.get( EnvironmentName.TRANSACTION_MANAGER ) != null ) {

               this.txm = (TransactionManager) tm;

               this.tpm = (TaskPersistenceContextManager) env.get( EnvironmentName.TASK_PERSISTENCE_CONTEXT_MANAGER );

              } else {

               if ( tm != null && isSpringTransactionManager(tm.getClass()) ) {

               try {

               logger.debug( "Instantiating KieSpringTransactionManager" );

              Class< ? > cls = Class.forName( "org.kie.spring.persistence.KieSpringTransactionManager" );

              Constructor< ? > con = cls.getConstructors()[0];

               this.txm = (TransactionManager) con.newInstance( tm );

               env.set( EnvironmentName.TRANSACTION_MANAGER, this.txm );

               cls = Class.forName( "org.kie.spring.persistence.KieSpringTaskJpaManager" );

               con = cls.getConstructors()[0];

               this.tpm = (TaskPersistenceContextManager) con.newInstance( new Object[]{env} );

              } catch ( Exception e ) {

               logger.warn( "Could not instantiate DroolsSpringTransactionManager" );

               throw new RuntimeException( "Could not instantiate org.kie.container.spring.beans.persistence.DroolsSpringTransactionManager", e );

              } else {

               logger.debug( "Instantiating JtaTransactionManager" );

               this.txm = new JtaTransactionManager( env.get( EnvironmentName.TRANSACTION ),

               env.get( EnvironmentName.TRANSACTION_SYNCHRONIZATION_REGISTRY ),

               tm );

             

               env.set( EnvironmentName.TRANSACTION_MANAGER, this.txm );

               try {

               this.tpm = new JPATaskPersistenceContextManager( env );

              } catch ( Exception e ) {

               throw new RuntimeException( "Error creating JPATaskPersistenceContextManager", e );

               env.set( EnvironmentName.TASK_PERSISTENCE_CONTEXT_MANAGER,

               this.tpm );

               env.set( EnvironmentName.TRANSACTION_MANAGER,

               this.txm );

            • 3. Re: Trying to run jBPM 6.1 in spring 4.0.6.RELEASE
              swiderski.maciej

              the weird thing is that in the stack trace there is no TaskTrnasactionInterceptor involved and thus it seems to be the issue. Would be best to have a reproducer to see what might be causing the issue.

               

              One thing is that we perform all spring tests on version 3.0.7.RELEASE might be worth trying if that is related to spring version.

               

              HTH

              • 4. Re: Trying to run jBPM 6.1 in spring 4.0.6.RELEASE
                joe_re

                OK,  How would I get a reproducer to look at what is causing the issue.   I can send provide the code we are using.

                • 5. Re: Trying to run jBPM 6.1 in spring 4.0.6.RELEASE
                  swiderski.maciej

                  exactly, if you could provide the code you're using (mavenized project) that would be great.

                  • 6. Re: Trying to run jBPM 6.1 in spring 4.0.6.RELEASE
                    rajiv_dadhich

                    Hi,

                    i am facing same issue..were you able to get aroundthe issue..please share..

                    thanks..