[jboss-user] [jBPM] - JTA with britonix and spring

Sasi R do-not-reply at jboss.com
Wed Aug 3 15:17:24 EDT 2011


Sasi R [http://community.jboss.org/people/sasir] created the discussion

"JTA with britonix and spring"

To view the discussion, visit: http://community.jboss.org/message/619249#619249

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

Reply to this message by going to Community
[http://community.jboss.org/message/619249#619249]

Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110803/e2ddc29b/attachment-0001.html 


More information about the jboss-user mailing list