Bitronix Transaction Manager - cannot open disk journal

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Bitronix Transaction Manager - cannot open disk journal

ajay.gour
Mine is a grails based application for which I am trying to configure Bitronix TransactionManager (using btm-2.1.3) managed by Container (Tomcat 6.0.35). But continuously getting "cannot open disk journal". Here are my configuration details -

<CATALINA_HOME>/conf/btm-config.properties -

#bitronix.tm.serverId=tomcat-btm-node0
bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog
bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties

<CATALINA_HOME>/conf/resources.properties

resource.ds1.className=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
resource.ds1.uniqueName=jdbc/mydatasource
resource.ds1.allowLocalTransactions=true
resource.ds1.minPoolSize=0
resource.ds1.maxPoolSize=50
resource.ds1.driverProperties.url=jdbc:mysql://localhost:3306/
resource.ds1.driverProperties.user=root
resource.ds1.driverProperties.password=****
resource.ds1.driverProperties.databaseName=test

hibernate properties (defined in grails's DataSource.groovy) -

dataSource {
        jndiName = "java:comp/env/jdbc/mydatasource"
}

hibernate {
        current_session_context_class = "jta";
        transaction.factory_class = "org.hibernate.transaction.JTATransactionFactory";
        transaction.manager_lookup_class = "org.hibernate.transaction.BTMTransactionManagerLookup";
}


<CATALINA_HOME>/conf/context.xml

<Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory"/>
<Resource name="jdbc/mydatasource"
     auth="Container"
     type="javax.sql.DataSource"
     username="root"
     password="mysql"
     driverClassName="com.mysql.jdbc.Driver"
     url="jdbc:mysql://localhost:3306/"
/>

Although defining <Resource> element in Context.xml is not a part of configuration but only after defining it here i was able to create and register data source.

One of the reason for this error i found on internet is - if transaction manager is configured to be managed by both container and spring. But that is not the case in my configuration. I also tried killing all JVM instances before starting the tomcat server. While tomcat server is up, i used process explorer to check which process is using btm1.tlog and btm2.tlog files. Search result showed 2 entries of btm1.tlog file against the same process id. Have a look on attached image for details.

When i start the Tomcat server, i get this error -


2012-07-12 19:13:44,030 [main] ERROR hbm2ddl.SchemaUpdate  - Unsuccessful: create table session (id bigint not null auto_increment, version bigint not null, session_id varchar(255) not null, some_count integer not null, user varchar(255) not null, primary key (id))
2012-07-12 19:13:44,032 [main] ERROR hbm2ddl.SchemaUpdate  - No database selected
2012-07-12 19:13:44,032 [main] ERROR hbm2ddl.SchemaUpdate  - Unsuccessful: create table some_test (id bigint not null auto_increment, version bigint not null, name varchar(255) not null, some_property varchar(255) not null, primary key (id))
2012-07-12 19:13:44,032 [main] ERROR hbm2ddl.SchemaUpdate  - No database selected
2012-07-12 19:13:44,050 [main] INFO  tm.BitronixTransactionManager  - Bitronix Transaction Manager version 2.1.3
2012-07-12 19:13:44,052 [main] WARN  tm.Configuration  - cannot get this JVM unique ID. Make sure it is configured and you only use ASCII characters. Will use IP address instead (unsafe for production usage!).
2012-07-12 19:13:44,053 [main] INFO  tm.Configuration  - JVM unique ID: <192.168.100.105>
2012-07-12 19:13:44,072 [main] ERROR context.ContextLoader  - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Could not obtain BTM transaction manager instance
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
        at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:135)
        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:194)
        at org.springframework.context.support.AbstractApplicationContext.initMessageSource(AbstractApplicationContext.java:755)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:413)
        at org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration.getApplicationContext(DefaultRuntimeSpringConfiguration.java:154)
        at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:164)
        at org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:124)
        at org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:120)
        at org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:73)
        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:4206)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
        at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
        at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
        at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
        at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
        at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
        at org.apache.catalina.core.StandardService.start(StandardService.java:525)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
        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.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 'transactionManager': Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Could not obtain BTM transaction manager instance
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
        at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:135)
        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.codehaus.groovy.grails.orm.support.TransactionManagerPostProcessor.postProcessAfterInstantiation(TransactionManagerPostProcessor.java:77)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1036)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
        ... 39 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory': Invocation of init method failed; nested exception is org.hibernate.HibernateException: Could not obtain BTM transaction manager instance
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
        at org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:135)
        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.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
        ... 52 more
Caused by: org.hibernate.HibernateException: Could not obtain BTM transaction manager instance
        at org.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:50)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:357)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
        at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
        at org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration.buildSessionFactory(GrailsAnnotationConfiguration.java:121)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
        at org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.newSessionFactory(ConfigurableLocalSessionFactoryBean.java:126)
        at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
        at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
        ... 60 more
Caused by: java.lang.reflect.InvocationTargetException
        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.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:47)
        ... 70 more
Caused by: bitronix.tm.utils.InitializationException: cannot open disk journal
        at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:98)
        at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:75)
Caused by: java.io.IOException: The process cannot access the file because another process has locked a portion of the file
        at bitronix.tm.journal.TransactionLogHeader.<init>(TransactionLogHeader.java:101)
        at bitronix.tm.journal.TransactionLogAppender.<init>(TransactionLogAppender.java:70)
        at bitronix.tm.journal.DiskJournal.open(DiskJournal.java:157)
        at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:85)
        ... 1 more

Has anybody encountered this error before? Can you please help me in resolving this issue?

Thanks in advance,
-Ajay  PX.png
Reply | Threaded
Open this post in threaded view
|

Re: Bitronix Transaction Manager - cannot open disk journal

Ludovic Orban-2
You are definitely trying to start BTM twice, one way or another.

In the configs you posted, you omitted quite some details like
configuring the BTMLifecycleListener in Tomcat's server.xml. I suppose
it is correctly configured but you have to confirm this.

Your context.xml on the other hand is wrong. The <Transaction
factory="..."/> tag is right, but NOT the <Resource .../> one. What
you've done with that resource tag is asking Tomcat to create a
connection pool using its own non-XA pooling mechanism so connections
from this pool cannot participate in XA transactions and will be
silently ignored. You should configure a ResourceObjectFactory
instead, see: http://docs.codehaus.org/display/BTM/Tomcat2x#Tomcat2x-Step4ConfiguretransactionmanageranddatasourcesinitializationinyourMETA-INFcontextxml

Where have you copied the BTM jars (btm-x.x.x.jar, jta.jar,
slf4j.jar...)? Those should be in Tomcat's lib folder and only there.
You must NOT include them in your webapp's WEB-INF/lib folder or you
will get strange class cast errors, or BTM will refuse to start up
like it does for you because its transaction journal has already been
started. BTW, why did you disable bitronix.tm.serverId in your
btm-config.properties? You should definitely have this configured or
recovery might not work correctly.

As a summary, please read the Tomcat integration document again
(http://docs.codehaus.org/display/BTM/Tomcat2x) and make sure you
followed every step then make sure you did NOT embed the BTM and JTA
jars in your webapp.


On Thu, Jul 12, 2012 at 3:55 PM, ajay.gour <[hidden email]> wrote:

>
> Mine is a grails based application for which I am trying to configure
> Bitronix TransactionManager (using btm-2.1.3) managed by Container (Tomcat
> 6.0.35). But continuously getting "cannot open disk journal". Here are my
> configuration details -
>
> <CATALINA_HOME>/conf/btm-config.properties -
>
> #bitronix.tm.serverId=tomcat-btm-node0
> bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog
> bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog
> bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties
>
> <CATALINA_HOME>/conf/resources.properties
>
> resource.ds1.className=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
> resource.ds1.uniqueName=jdbc/mydatasource
> resource.ds1.allowLocalTransactions=true
> resource.ds1.minPoolSize=0
> resource.ds1.maxPoolSize=50
> resource.ds1.driverProperties.url=jdbc:mysql://localhost:3306/
> resource.ds1.driverProperties.user=root
> resource.ds1.driverProperties.password=****
> resource.ds1.driverProperties.databaseName=test
>
> hibernate properties (defined in grails's DataSource.groovy) -
>
> dataSource {
>         jndiName = "java:comp/env/jdbc/mydatasource"
> }
>
> hibernate {
>         current_session_context_class = "jta";
>         transaction.factory_class =
> "org.hibernate.transaction.JTATransactionFactory";
>         transaction.manager_lookup_class =
> "org.hibernate.transaction.BTMTransactionManagerLookup";
> }
>
>
> <CATALINA_HOME>/conf/context.xml
>
> <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory"/>
> <Resource name="jdbc/mydatasource"
>      auth="Container"
>      type="javax.sql.DataSource"
>      username="root"
>      password="mysql"
>      driverClassName="com.mysql.jdbc.Driver"
>      url="jdbc:mysql://localhost:3306/"
> />
>
> Although defining <Resource> element in Context.xml is not a part of
> configuration but only after defining it here i was able to create and
> register data source.
>
> One of the reason for this error i found on internet is - if transaction
> manager is configured to be managed by both container and spring. But that
> is not the case in my configuration. I also tried killing all JVM instances
> before starting the tomcat server. While tomcat server is up, i used process
> explorer to check which process is using btm1.tlog and btm2.tlog files.
> Search result showed 2 entries of btm1.tlog file against the same process
> id. Have a look on attached image for details.
>
> When i start the Tomcat server, i get this error -
>
>
> 2012-07-12 19:13:44,030 [main] ERROR hbm2ddl.SchemaUpdate  - Unsuccessful:
> create table session (id bigint not null auto_increment, version bigint not
> null, session_id varchar(255) not null, some_count integer not null, user
> varchar(255) not null, primary key (id))
> 2012-07-12 19:13:44,032 [main] ERROR hbm2ddl.SchemaUpdate  - No database
> selected
> 2012-07-12 19:13:44,032 [main] ERROR hbm2ddl.SchemaUpdate  - Unsuccessful:
> create table some_test (id bigint not null auto_increment, version bigint
> not null, name varchar(255) not null, some_property varchar(255) not null,
> primary key (id))
> 2012-07-12 19:13:44,032 [main] ERROR hbm2ddl.SchemaUpdate  - No database
> selected
> 2012-07-12 19:13:44,050 [main] INFO  tm.BitronixTransactionManager  -
> Bitronix Transaction Manager version 2.1.3
> 2012-07-12 19:13:44,052 [main] WARN  tm.Configuration  - cannot get this JVM
> unique ID. Make sure it is configured and you only use ASCII characters.
> Will use IP address instead (unsafe for production usage!).
> 2012-07-12 19:13:44,053 [main] INFO  tm.Configuration  - JVM unique ID:
> <192.168.100.105>
> 2012-07-12 19:13:44,072 [main] ERROR context.ContextLoader  - Context
> initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'messageSource': Initialization of bean failed; nested exception
> is org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'transactionManager': Cannot resolve reference to bean
> 'sessionFactory' while setting bean property 'sessionFactory'; nested
> exception is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory': Invocation of init method failed;
> nested exception is org.hibernate.HibernateException: Could not obtain BTM
> transaction manager instance
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
>         at
> org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:135)
>         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:194)
>         at
> org.springframework.context.support.AbstractApplicationContext.initMessageSource(AbstractApplicationContext.java:755)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:413)
>         at
> org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration.getApplicationContext(DefaultRuntimeSpringConfiguration.java:154)
>         at
> org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:164)
>         at
> org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:124)
>         at
> org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:120)
>         at
> org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:73)
>         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:4206)
>         at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
>         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
>         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
>         at
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
>         at
> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
>         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
>         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
>         at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
>         at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
>         at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
>         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
>         at org.apache.catalina.core.StandardService.start(StandardService.java:525)
>         at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
>         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.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 'transactionManager': Cannot resolve reference to
> bean 'sessionFactory' while setting bean property 'sessionFactory'; nested
> exception is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory': Invocation of init method failed;
> nested exception is org.hibernate.HibernateException: Could not obtain BTM
> transaction manager instance
>         at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
>         at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
>         at
> org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:135)
>         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.codehaus.groovy.grails.orm.support.TransactionManagerPostProcessor.postProcessAfterInstantiation(TransactionManagerPostProcessor.java:77)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1036)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
>         ... 39 more
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory': Invocation of init method failed;
> nested exception is org.hibernate.HibernateException: Could not obtain BTM
> transaction manager instance
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>         at
> org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:135)
>         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.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
>         ... 52 more
> Caused by: org.hibernate.HibernateException: Could not obtain BTM
> transaction manager instance
>         at
> org.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:50)
>         at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:357)
>         at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
>         at
> org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
>         at
> org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration.buildSessionFactory(GrailsAnnotationConfiguration.java:121)
>         at
> org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
>         at
> org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.newSessionFactory(ConfigurableLocalSessionFactoryBean.java:126)
>         at
> org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
>         at
> org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
>         ... 60 more
> Caused by: java.lang.reflect.InvocationTargetException
>         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.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:47)
>         ... 70 more
> Caused by: bitronix.tm.utils.InitializationException: cannot open disk
> journal
>         at
> bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:98)
>         at
> bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:75)
> Caused by: java.io.IOException: The process cannot access the file because
> another process has locked a portion of the file
>         at
> bitronix.tm.journal.TransactionLogHeader.<init>(TransactionLogHeader.java:101)
>         at
> bitronix.tm.journal.TransactionLogAppender.<init>(TransactionLogAppender.java:70)
>         at bitronix.tm.journal.DiskJournal.open(DiskJournal.java:157)
>         at
> bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:85)
>         ... 1 more
>
> Has anybody encountered this error before? Can you please help me in
> resolving this issue?
>
> Thanks in advance,
> -Ajay   http://old.nabble.com/file/p34151045/PX.png PX.png
> --
> View this message in context: http://old.nabble.com/Bitronix-Transaction-Manager---cannot-open-disk-journal-tp34151045p34151045.html
> Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Bitronix Transaction Manager - cannot open disk journal

ajay.gour
Thanks for a quick response Ludovic. The mistake was copying btm jars into the WEB-INF\lib folder. Once i removed those binaries, it worked smoothly.

Cheers,
-Ajay


Ludovic Orban-2 wrote
You are definitely trying to start BTM twice, one way or another.

In the configs you posted, you omitted quite some details like
configuring the BTMLifecycleListener in Tomcat's server.xml. I suppose
it is correctly configured but you have to confirm this.

Your context.xml on the other hand is wrong. The <Transaction
factory="..."/> tag is right, but NOT the <Resource .../> one. What
you've done with that resource tag is asking Tomcat to create a
connection pool using its own non-XA pooling mechanism so connections
from this pool cannot participate in XA transactions and will be
silently ignored. You should configure a ResourceObjectFactory
instead, see: http://docs.codehaus.org/display/BTM/Tomcat2x#Tomcat2x-Step4ConfiguretransactionmanageranddatasourcesinitializationinyourMETA-INFcontextxml

Where have you copied the BTM jars (btm-x.x.x.jar, jta.jar,
slf4j.jar...)? Those should be in Tomcat's lib folder and only there.
You must NOT include them in your webapp's WEB-INF/lib folder or you
will get strange class cast errors, or BTM will refuse to start up
like it does for you because its transaction journal has already been
started. BTW, why did you disable bitronix.tm.serverId in your
btm-config.properties? You should definitely have this configured or
recovery might not work correctly.

As a summary, please read the Tomcat integration document again
(http://docs.codehaus.org/display/BTM/Tomcat2x) and make sure you
followed every step then make sure you did NOT embed the BTM and JTA
jars in your webapp.


On Thu, Jul 12, 2012 at 3:55 PM, ajay.gour <ajay.gour@gmail.com> wrote:
>
> Mine is a grails based application for which I am trying to configure
> Bitronix TransactionManager (using btm-2.1.3) managed by Container (Tomcat
> 6.0.35). But continuously getting "cannot open disk journal". Here are my
> configuration details -
>
> <CATALINA_HOME>/conf/btm-config.properties -
>
> #bitronix.tm.serverId=tomcat-btm-node0
> bitronix.tm.journal.disk.logPart1Filename=${btm.root}/work/btm1.tlog
> bitronix.tm.journal.disk.logPart2Filename=${btm.root}/work/btm2.tlog
> bitronix.tm.resource.configuration=${btm.root}/conf/resources.properties
>
> <CATALINA_HOME>/conf/resources.properties
>
> resource.ds1.className=com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
> resource.ds1.uniqueName=jdbc/mydatasource
> resource.ds1.allowLocalTransactions=true
> resource.ds1.minPoolSize=0
> resource.ds1.maxPoolSize=50
> resource.ds1.driverProperties.url=jdbc:mysql://localhost:3306/
> resource.ds1.driverProperties.user=root
> resource.ds1.driverProperties.password=****
> resource.ds1.driverProperties.databaseName=test
>
> hibernate properties (defined in grails's DataSource.groovy) -
>
> dataSource {
>         jndiName = "java:comp/env/jdbc/mydatasource"
> }
>
> hibernate {
>         current_session_context_class = "jta";
>         transaction.factory_class =
> "org.hibernate.transaction.JTATransactionFactory";
>         transaction.manager_lookup_class =
> "org.hibernate.transaction.BTMTransactionManagerLookup";
> }
>
>
> <CATALINA_HOME>/conf/context.xml
>
> <Transaction factory="bitronix.tm.BitronixUserTransactionObjectFactory"/>
> <Resource name="jdbc/mydatasource"
>      auth="Container"
>      type="javax.sql.DataSource"
>      username="root"
>      password="mysql"
>      driverClassName="com.mysql.jdbc.Driver"
>      url="jdbc:mysql://localhost:3306/"
> />
>
> Although defining <Resource> element in Context.xml is not a part of
> configuration but only after defining it here i was able to create and
> register data source.
>
> One of the reason for this error i found on internet is - if transaction
> manager is configured to be managed by both container and spring. But that
> is not the case in my configuration. I also tried killing all JVM instances
> before starting the tomcat server. While tomcat server is up, i used process
> explorer to check which process is using btm1.tlog and btm2.tlog files.
> Search result showed 2 entries of btm1.tlog file against the same process
> id. Have a look on attached image for details.
>
> When i start the Tomcat server, i get this error -
>
>
> 2012-07-12 19:13:44,030 [main] ERROR hbm2ddl.SchemaUpdate  - Unsuccessful:
> create table session (id bigint not null auto_increment, version bigint not
> null, session_id varchar(255) not null, some_count integer not null, user
> varchar(255) not null, primary key (id))
> 2012-07-12 19:13:44,032 [main] ERROR hbm2ddl.SchemaUpdate  - No database
> selected
> 2012-07-12 19:13:44,032 [main] ERROR hbm2ddl.SchemaUpdate  - Unsuccessful:
> create table some_test (id bigint not null auto_increment, version bigint
> not null, name varchar(255) not null, some_property varchar(255) not null,
> primary key (id))
> 2012-07-12 19:13:44,032 [main] ERROR hbm2ddl.SchemaUpdate  - No database
> selected
> 2012-07-12 19:13:44,050 [main] INFO  tm.BitronixTransactionManager  -
> Bitronix Transaction Manager version 2.1.3
> 2012-07-12 19:13:44,052 [main] WARN  tm.Configuration  - cannot get this JVM
> unique ID. Make sure it is configured and you only use ASCII characters.
> Will use IP address instead (unsafe for production usage!).
> 2012-07-12 19:13:44,053 [main] INFO  tm.Configuration  - JVM unique ID:
> <192.168.100.105>
> 2012-07-12 19:13:44,072 [main] ERROR context.ContextLoader  - Context
> initialization failed
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'messageSource': Initialization of bean failed; nested exception
> is org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'transactionManager': Cannot resolve reference to bean
> 'sessionFactory' while setting bean property 'sessionFactory'; nested
> exception is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory': Invocation of init method failed;
> nested exception is org.hibernate.HibernateException: Could not obtain BTM
> transaction manager instance
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:527)
>         at
> org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:135)
>         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:194)
>         at
> org.springframework.context.support.AbstractApplicationContext.initMessageSource(AbstractApplicationContext.java:755)
>         at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:413)
>         at
> org.codehaus.groovy.grails.commons.spring.DefaultRuntimeSpringConfiguration.getApplicationContext(DefaultRuntimeSpringConfiguration.java:154)
>         at
> org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:164)
>         at
> org.codehaus.groovy.grails.commons.spring.GrailsRuntimeConfigurator.configure(GrailsRuntimeConfigurator.java:124)
>         at
> org.codehaus.groovy.grails.web.context.GrailsConfigUtils.configureWebApplicationContext(GrailsConfigUtils.java:120)
>         at
> org.codehaus.groovy.grails.web.context.GrailsContextLoader.createWebApplicationContext(GrailsContextLoader.java:73)
>         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:4206)
>         at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:4705)
>         at
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799)
>         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)
>         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601)
>         at
> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:675)
>         at
> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:601)
>         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
>         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)
>         at
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)
>         at
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065)
>         at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
>         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
>         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
>         at org.apache.catalina.core.StandardService.start(StandardService.java:525)
>         at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
>         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.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 'transactionManager': Cannot resolve reference to
> bean 'sessionFactory' while setting bean property 'sessionFactory'; nested
> exception is org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory': Invocation of init method failed;
> nested exception is org.hibernate.HibernateException: Could not obtain BTM
> transaction manager instance
>         at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
>         at
> org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1325)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1086)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
>         at
> org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:135)
>         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.codehaus.groovy.grails.orm.support.TransactionManagerPostProcessor.postProcessAfterInstantiation(TransactionManagerPostProcessor.java:77)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1036)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
>         ... 39 more
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'sessionFactory': Invocation of init method failed;
> nested exception is org.hibernate.HibernateException: Could not obtain BTM
> transaction manager instance
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1420)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519)
>         at
> org.codehaus.groovy.grails.commons.spring.ReloadAwareAutowireCapableBeanFactory.doCreateBean(ReloadAwareAutowireCapableBeanFactory.java:135)
>         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.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:322)
>         ... 52 more
> Caused by: org.hibernate.HibernateException: Could not obtain BTM
> transaction manager instance
>         at
> org.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:50)
>         at
> org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:357)
>         at
> org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1327)
>         at
> org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
>         at
> org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration.buildSessionFactory(GrailsAnnotationConfiguration.java:121)
>         at
> org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:860)
>         at
> org.codehaus.groovy.grails.orm.hibernate.ConfigurableLocalSessionFactoryBean.newSessionFactory(ConfigurableLocalSessionFactoryBean.java:126)
>         at
> org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:779)
>         at
> org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1477)
>         at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1417)
>         ... 60 more
> Caused by: java.lang.reflect.InvocationTargetException
>         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.hibernate.transaction.BTMTransactionManagerLookup.getTransactionManager(BTMTransactionManagerLookup.java:47)
>         ... 70 more
> Caused by: bitronix.tm.utils.InitializationException: cannot open disk
> journal
>         at
> bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:98)
>         at
> bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:75)
> Caused by: java.io.IOException: The process cannot access the file because
> another process has locked a portion of the file
>         at
> bitronix.tm.journal.TransactionLogHeader.<init>(TransactionLogHeader.java:101)
>         at
> bitronix.tm.journal.TransactionLogAppender.<init>(TransactionLogAppender.java:70)
>         at bitronix.tm.journal.DiskJournal.open(DiskJournal.java:157)
>         at
> bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:85)
>         ... 1 more
>
> Has anybody encountered this error before? Can you please help me in
> resolving this issue?
>
> Thanks in advance,
> -Ajay   http://old.nabble.com/file/p34151045/PX.png PX.png
> --
> View this message in context: http://old.nabble.com/Bitronix-Transaction-Manager---cannot-open-disk-journal-tp34151045p34151045.html
> Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Reply | Threaded
Open this post in threaded view
|

Re: Bitronix Transaction Manager - cannot open disk journal

ani.shirguppe
This post has NOT been accepted by the mailing list yet.
Thanks.. its working fine