6 Replies Latest reply: May 30, 2012 3:07 PM by Marco Rietveld RSS

    JTA with britonix and spring

    Sasi R Newbie

      WHile testing jbpm5, I have below configuration in spring which i am running in tomcat. Am getting below error in btm. Can you advise if it is issue with configuration or btm transaction log?

       

      <bean id="droolsFlowDataSource"

              class="bitronix.tm.resource.jdbc.PoolingDataSource" init-method="init" destroy-method="close">

               <property name="className"

                    value="oracle.jdbc.xa.client.OracleXADataSource" />           

              <property name="uniqueName" value="jdbc/jbpmDS" />

              <property name="minPoolSize" value="5" />

              <property name="maxPoolSize" value="225" />

              <property name="allowLocalTransactions" value="true"></property>

               <property name="testQuery" value="SELECT 1 FROM DUAL" />

              <property name="driverProperties">

                 <props>

                     <prop key="URL">jdbc:oracle:thin:@servername:dbname</prop>

                     <prop key="user">JBPM5</prop>

                     <prop key="password">JBPM5</prop>

                 </props>

              </property>

          </bean>

         

          <bean id="droolsFlowEntityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">

                <property name="persistenceUnitName" value="org.drools.persistence.jpa"></property>

                <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml"></property>

                <property name="dataSource" ref="droolsFlowDataSource"></property>

              <property name="jpaVendorAdapter">

                             <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">

                                    <property name="database" value="ORACLE" />

                                    <property name="showSql" value="true" />

                          </bean>

              </property>

          </bean>            

         

          <bean id="bitronixTransactionManagerConfig" factory-method="getConfiguration" class="bitronix.tm.TransactionManagerServices" depends-on="droolsFlowEntityManagerFactory" >

              <property name="serverId" value="spring-btm" />

              <property name="warnAboutZeroResourceTransaction" value="true"></property>

          </bean>   

         

          <bean id="bitronixTransactionManager" factory-method="getTransactionManager"

              class="bitronix.tm.TransactionManagerServices" depends-on="droolsFlowDataSource,bitronixTransactionManagerConfig,droolsFlowEntityManagerFactory" destroy-method="shutdown" />   

         

          <bean id="springJtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">

              <property name="transactionManager" ref="bitronixTransactionManager" />

              <property name="userTransaction" ref="bitronixTransactionManager" />

          </bean>      

       

       

      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bitronixTransactionManager' defined in ServletContext resource [/WEB-INF/spring/root-context.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static synchronized bitronix.tm.BitronixTransactionManager bitronix.tm.TransactionManagerServices.getTransactionManager()] threw exception; nested exception is bitronix.tm.utils.InitializationException: cannot open disk journal

          at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:581)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:983)

          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:879)

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

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

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

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

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

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

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

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

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

          at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)

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

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

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

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)

          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

          at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)

          at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

          at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)

          at org.apache.catalina.core.StandardService.start(StandardService.java:519)

          at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

          at org.apache.catalina.startup.Catalina.start(Catalina.java:581)

          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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

          at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

      Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public static synchronized bitronix.tm.BitronixTransactionManager bitronix.tm.TransactionManagerServices.getTransactionManager()] threw exception; nested exception is bitronix.tm.utils.InitializationException: cannot open disk journal

          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:157)

          at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:570)

          ... 29 more

      Caused by: bitronix.tm.utils.InitializationException: cannot open disk journal

          at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:75)

          at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:62)

          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.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:145)

          ... 30 more

      Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file

          at java.io.RandomAccessFile.read(Native Method)

          at java.io.RandomAccessFile.readInt(Unknown Source)

          at bitronix.tm.journal.TransactionLogHeader.<init>(TransactionLogHeader.java:96)

          at bitronix.tm.journal.TransactionLogAppender.<init>(TransactionLogAppender.java:69)

          at bitronix.tm.journal.DiskJournal.open(DiskJournal.java:151)

          at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:62)

        • 1. Re: JTA with britonix and spring
          Marco Rietveld Novice

          Hi Sasi,

           

          This is happening because Spring and Tomcat are fighting over who gets to use Bitronix.

           

          See http://old.nabble.com/BTM,-Spring-and-Tomcat-td20917679.html for more info.

           

          Good luck!

          Marco

          • 2. Re: JTA with britonix and spring
            Sasi R Newbie

            Thanks Marco for replying but after resolving that am getting the below exception while creating knowledge session bean. Can you please advise on what might be wrong

             

            <drools:kstore id="knowledgeStore"/>

             

            <drools:kbase id="knowledgeBase">
                <drools:resources>
                    <drools:resource type="BPMN2" source="classpath:assigntask.bpmn" />
                </drools:resources>
                <drools:configuration>
                    <drools:multithread enabled="true" max-threads="5" />
                </drools:configuration>
            </drools:kbase>
            <drools:ksession id="jpaSingleSessionCommandService" type="stateful" kbase="knowledgeBase">
                <drools:configuration>
                    <drools:work-item-handlers>
            <!--              <drools:work-item-handler name="Email" ref="refToSHumanTaskHandler" /> -->
                    </drools:work-item-handlers>
                    <drools:jpa-persistence>
                        <drools:transaction-manager ref="springJtaTransactionManager" />
                        <drools:entity-manager-factory ref="droolsFlowEntityManagerFactory" />
                    </drools:jpa-persistence>
                </drools:configuration>
            </drools:ksession>

             

             

            ERROR: SingleSessionCommandService:532 - Could not commit session

            java.lang.NullPointerException

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

                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.buildCommanService(KnowledgeStoreServiceImpl.java:116)

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

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

                at org.drools.container.spring.beans.StatefulKnowledgeSessionBeanFactory.internalAfterPropertiesSet(StatefulKnowledgeSessionBeanFactory.java:82)

                at org.drools.container.spring.beans.AbstractKnowledgeSessionBeanFactory.afterPropertiesSet(AbstractKnowledgeSessionBeanFactory.java:108)

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

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

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

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

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

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

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

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

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)

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

                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)

                at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)

                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)

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

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

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

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

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

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

                at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)

                at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:383)

                at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:362)

                at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:82)

                at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.initApplicationContext(AbstractDetectingUrlHandlerMapping.java:58)

                at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)

                at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)

                at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)

                at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106)

                at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)

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

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

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

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

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

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

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

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

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

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

                at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)

                at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)

                at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)

                at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)

                at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)

                at javax.servlet.GenericServlet.init(GenericServlet.java:212)

                at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)

                at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)

                at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)

                at org.apache.catalina.core.StandardService.start(StandardService.java:519)

                at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:581)

                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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

            ERROR: TransactionSynchronizationUtils:171 - TransactionSynchronization.afterCompletion threw exception

            java.lang.NullPointerException

                at org.drools.persistence.SingleSessionCommandService$SynchronizationImpl.afterCompletion(SingleSessionCommandService.java:358)

                at org.drools.container.spring.beans.persistence.SpringTransactionSynchronizationAdapter.afterCompletion(SpringTransactionSynchronizationAdapter.java:41)

                at org.springframework.transaction.support.TransactionSynchronizationUtils.invokeAfterCompletion(TransactionSynchronizationUtils.java:168)

                at org.springframework.transaction.support.AbstractPlatformTransactionManager.invokeAfterCompletion(AbstractPlatformTransactionManager.java:996)

                at org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerAfterCompletion(AbstractPlatformTransactionManager.java:971)

                at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:874)

                at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:822)

                at org.drools.container.spring.beans.persistence.DroolsSpringTransactionManager.rollback(DroolsSpringTransactionManager.java:68)

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

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

                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.buildCommanService(KnowledgeStoreServiceImpl.java:116)

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

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

                at org.drools.container.spring.beans.StatefulKnowledgeSessionBeanFactory.internalAfterPropertiesSet(StatefulKnowledgeSessionBeanFactory.java:82)

                at org.drools.container.spring.beans.AbstractKnowledgeSessionBeanFactory.afterPropertiesSet(AbstractKnowledgeSessionBeanFactory.java:108)

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

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

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

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

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

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

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

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

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)

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

                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)

                at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)

                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)

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

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

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

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

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

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

                at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)

                at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:383)

                at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:362)

                at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:82)

                at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.initApplicationContext(AbstractDetectingUrlHandlerMapping.java:58)

                at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)

                at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)

                at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)

                at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106)

                at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)

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

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

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

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

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

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

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

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

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

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

                at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)

                at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)

                at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)

                at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)

                at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)

                at javax.servlet.GenericServlet.init(GenericServlet.java:212)

                at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)

                at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)

                at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)

                at org.apache.catalina.core.StandardService.start(StandardService.java:519)

                at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:581)

                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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

            INFO : DefaultListableBeanFactory:422 - Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@395aaf: defining beans [org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0,org.springframework.format.support.FormattingConversionServiceFactoryBean#0,org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter#0,org.springframework.web.servlet.handler.MappedInterceptor#0,org.springframework.web.servlet.mvc.HttpRequestHandlerAdapter,org.springframework.web.servlet.resource.ResourceHttpRequestHandler#0,org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0,org.springframework.beans.factory.config.PropertyPlaceholderConfigurer#0,org.springframework.web.servlet.view.InternalResourceViewResolver#0,documentumUtil,LDAPUtil,singleSignonUtil,VTUtil,homeController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,multipartResolver,server,minaTaskClient,lDAPUtil,DocumentumUtil,taskHandler,knowledgeStore,knowledgeBase,jpaSingleSessionCommandService]; parent: org.springframework.beans.factory.support.DefaultListableBeanFactory@787c16

            ERROR: DispatcherServlet:314 - Context initialization failed

            org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.drools.runtime.StatefulKnowledgeSession com.citi.jbpm.HomeController.ksession; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaSingleSessionCommandService': Invocation of init method failed; nested exception is java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

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

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

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

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

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

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

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

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

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

                at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)

                at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)

                at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)

                at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)

                at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)

                at javax.servlet.GenericServlet.init(GenericServlet.java:212)

                at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1173)

                at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:993)

                at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4350)

                at org.apache.catalina.core.StandardContext.start(StandardContext.java:4659)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)

                at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

                at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)

                at org.apache.catalina.core.StandardService.start(StandardService.java:519)

                at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)

                at org.apache.catalina.startup.Catalina.start(Catalina.java:581)

                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.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

                at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

            Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.drools.runtime.StatefulKnowledgeSession com.citi.jbpm.HomeController.ksession; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaSingleSessionCommandService': Invocation of init method failed; nested exception is java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)

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

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

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

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

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

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

                at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)

                at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:383)

                at org.springframework.web.servlet.handler.AbstractUrlHandlerMapping.registerHandler(AbstractUrlHandlerMapping.java:362)

                at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.detectHandlers(AbstractDetectingUrlHandlerMapping.java:82)

                at org.springframework.web.servlet.handler.AbstractDetectingUrlHandlerMapping.initApplicationContext(AbstractDetectingUrlHandlerMapping.java:58)

                at org.springframework.context.support.ApplicationObjectSupport.initApplicationContext(ApplicationObjectSupport.java:119)

                at org.springframework.web.context.support.WebApplicationObjectSupport.initApplicationContext(WebApplicationObjectSupport.java:72)

                at org.springframework.context.support.ApplicationObjectSupport.setApplicationContext(ApplicationObjectSupport.java:73)

                at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:106)

                at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:85)

                at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:394)

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

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

                ... 31 more

            Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.drools.runtime.StatefulKnowledgeSession com.citi.jbpm.HomeController.ksession; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaSingleSessionCommandService': Invocation of init method failed; nested exception is java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502)

                at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)

                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)

                ... 51 more

            Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaSingleSessionCommandService': Invocation of init method failed; nested exception is java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

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

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

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

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

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

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

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

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:844)

                at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:786)

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

                at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474)

                ... 53 more

            Caused by: java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException

                at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:130)

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

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

                at org.drools.container.spring.beans.StatefulKnowledgeSessionBeanFactory.internalAfterPropertiesSet(StatefulKnowledgeSessionBeanFactory.java:82)

                at org.drools.container.spring.beans.AbstractKnowledgeSessionBeanFactory.afterPropertiesSet(AbstractKnowledgeSessionBeanFactory.java:108)

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

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

                ... 63 more

            Caused by: java.lang.reflect.InvocationTargetException

                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.buildCommanService(KnowledgeStoreServiceImpl.java:116)

                ... 69 more

            Caused by: java.lang.NullPointerException

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

            • 3. Re: JTA with britonix and spring
              Marco Rietveld Novice

              Sasi,

               

              Is drools-spring in your classpath?

               

                  <groupId>org.drools</groupId>

                  <artifactId>drools-spring</artifactId>

                  <version>5.2.1.Final</version>

               

              (The version may differ depending on which version of jBPM 5 you're using: see the pom.xml of your jbpm 5 jar and use the drools.version property value that's in that pom).

               

              Regards,

              Marco

              • 4. Re: JTA with britonix and spring
                Sasi R Newbie

                Marco,

                Drools spring is in my classpath and the same works if I am using Jpatarnsaction manager instaed of JTA. It seems to be an open issue in drools

                 

                https://issues.jboss.org/browse/JBRULES-3067 

                 

                But am not sure whether its goign to be fixed or we have to follow soem other way

                 


                • 5. Re: JTA with britonix and spring
                  gigazhang Newbie

                  Has this issue fixed?

                  • 6. Re: JTA with britonix and spring
                    Marco Rietveld Novice

                    It has been fixed in 5.3.