tomcat 7.0.26 and bitronix

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

tomcat 7.0.26 and bitronix

Ralph Carlson

Does bitronix work with apache-tomcat-7.0.26? I am having trouble getting it to work, I have not yet deployed any apps to tomcat, only tried to configure bitronix with clean tomcat install

I am using windows 7 with 32 bit jdk

 

I followed the guide at: http://docs.codehaus.org/display/BTM/Tomcat

 

Setenv.bat has this one line:

set CATALINA_OPTS=-Dbtm.root=C:\apache-tomcat-7.0.26 -Dbitronix.tm.configuration=C:\apache-tomcat-7.0.26\conf\btm-config.properties

 

the jars in tomcat\lib are:

btm-2.0.1.jar

btm-tomcat55-lifecycle.jar

geronimo-jta_1.1_spec-1.1.jar

slf4j-api-1.6.0.jar

slf4j-jdk14-1.6.0.jar

classes12-10g.2.0.4.jar

 

 

btm-config.properties is:

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

 

server.xml and context.xml have the two lines added in their respective files for BTMLifecycleListener and bitronixUserTransactionObjectFactory

 

resources.properties is:

resource.ds1.className=oracle.jdbc.pool.OracleDataSource

resource.ds1.uniqueName=jdbc/mccAppDBPool

resource.ds1.maxPoolSize=10

resource.ds1.allowLocalTransactions=true

resource.ds1.testQuery=SELECT 1 FROM DUAL

resource.ds1.driverProperties.user=test

resource.ds1.driverProperties.password=test

resource.ds1.driverProperties.URL=jdbc:oracle:thin:@localhost:1521:test

 

here is the logs for tomcat, shutsdown after showing the server id, there is not other tomcat log entries:

 

 

Jun 8, 2012 10:05:45 AM org.apache.catalina.core.AprLifecycleListener init

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files (x86)\Java\jdk1.6.0_31-32bit\bin

Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["http-bio-8080"]

Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["ajp-bio-8009"]

Jun 8, 2012 10:05:45 AM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 329 ms

Jun 8, 2012 10:05:45 AM bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent

INFO: Starting Bitronix Transaction Manager

Jun 8, 2012 10:05:45 AM bitronix.tm.BitronixTransactionManager logVersion

INFO: Bitronix Transaction Manager version 2.0.1

Jun 8, 2012 10:05:45 AM bitronix.tm.Configuration buildServerIdArray

INFO: JVM unique ID: <tomcat-btm-node0>

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tomcat 7.0.26 and bitronix

Ludovic Orban-2
I don't know what's wrong with your Tomcat logs but as a simple
suggestion, have you tried starting it from a DOS box with
"catalina.bat run"?

I also wonder why you're using an old version of BTM and not the
latest 2.1.3. You should consider using the latest version as quite a
few new features and bug fixes made into it.

Finally, I spotted one mistake in your resources.properties config:
you've configured
resource.ds1.className=oracle.jdbc.pool.OracleDataSource but
oracle.jdbc.pool.OracleDataSource does not implement
javax.sql.XADataSource. BTM should refuse to boot with such mistake
and I suppose that's what prevented Tomcat from starting up but still
doesn't explain why that did not get logged. You should use
resource.ds1.className=oracle.jdbc.xa.client.OracleXADataSource
instead.



On Fri, Jun 8, 2012 at 4:07 PM, Ralph Carlson <[hidden email]> wrote:

> Does bitronix work with apache-tomcat-7.0.26? I am having trouble getting it
> to work, I have not yet deployed any apps to tomcat, only tried to configure
> bitronix with clean tomcat install
>
> I am using windows 7 with 32 bit jdk
>
>
>
> I followed the guide at: http://docs.codehaus.org/display/BTM/Tomcat
>
>
>
> Setenv.bat has this one line:
>
> set CATALINA_OPTS=-Dbtm.root=C:\apache-tomcat-7.0.26
> -Dbitronix.tm.configuration=C:\apache-tomcat-7.0.26\conf\btm-config.properties
>
>
>
> the jars in tomcat\lib are:
>
> btm-2.0.1.jar
>
> btm-tomcat55-lifecycle.jar
>
> geronimo-jta_1.1_spec-1.1.jar
>
> slf4j-api-1.6.0.jar
>
> slf4j-jdk14-1.6.0.jar
>
> classes12-10g.2.0.4.jar
>
>
>
>
>
> btm-config.properties is:
>
> 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
>
>
>
> server.xml and context.xml have the two lines added in their respective
> files for BTMLifecycleListener and bitronixUserTransactionObjectFactory
>
>
>
> resources.properties is:
>
> resource.ds1.className=oracle.jdbc.pool.OracleDataSource
>
> resource.ds1.uniqueName=jdbc/mccAppDBPool
>
> resource.ds1.maxPoolSize=10
>
> resource.ds1.allowLocalTransactions=true
>
> resource.ds1.testQuery=SELECT 1 FROM DUAL
>
> resource.ds1.driverProperties.user=test
>
> resource.ds1.driverProperties.password=test
>
> resource.ds1.driverProperties.URL=jdbc:oracle:thin:@localhost:1521:test
>
>
>
> here is the logs for tomcat, shutsdown after showing the server id, there is
> not other tomcat log entries:
>
>
>
>
>
> Jun 8, 2012 10:05:45 AM org.apache.catalina.core.AprLifecycleListener init
>
> INFO: The APR based Apache Tomcat Native library which allows optimal
> performance in production environments was not found on the
> java.library.path: C:\Program Files (x86)\Java\jdk1.6.0_31-32bit\bin
>
> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>
> INFO: Initializing ProtocolHandler ["http-bio-8080"]
>
> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>
> INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
>
> Jun 8, 2012 10:05:45 AM org.apache.catalina.startup.Catalina load
>
> INFO: Initialization processed in 329 ms
>
> Jun 8, 2012 10:05:45 AM
> bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent
>
> INFO: Starting Bitronix Transaction Manager
>
> Jun 8, 2012 10:05:45 AM bitronix.tm.BitronixTransactionManager logVersion
>
> INFO: Bitronix Transaction Manager version 2.0.1
>
> Jun 8, 2012 10:05:45 AM bitronix.tm.Configuration buildServerIdArray
>
> INFO: JVM unique ID: <tomcat-btm-node0>
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: tomcat 7.0.26 and bitronix

Ralph Carlson
I was able to resolve it using dos box, space after the resource.ds1.className value

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ludovic Orban
Sent: Friday, June 08, 2012 2:43 PM
To: [hidden email]
Subject: Re: [btm-user] tomcat 7.0.26 and bitronix

I don't know what's wrong with your Tomcat logs but as a simple suggestion, have you tried starting it from a DOS box with "catalina.bat run"?

I also wonder why you're using an old version of BTM and not the latest 2.1.3. You should consider using the latest version as quite a few new features and bug fixes made into it.

Finally, I spotted one mistake in your resources.properties config:
you've configured
resource.ds1.className=oracle.jdbc.pool.OracleDataSource but oracle.jdbc.pool.OracleDataSource does not implement javax.sql.XADataSource. BTM should refuse to boot with such mistake and I suppose that's what prevented Tomcat from starting up but still doesn't explain why that did not get logged. You should use resource.ds1.className=oracle.jdbc.xa.client.OracleXADataSource
instead.



On Fri, Jun 8, 2012 at 4:07 PM, Ralph Carlson <[hidden email]> wrote:

> Does bitronix work with apache-tomcat-7.0.26? I am having trouble
> getting it to work, I have not yet deployed any apps to tomcat, only
> tried to configure bitronix with clean tomcat install
>
> I am using windows 7 with 32 bit jdk
>
>
>
> I followed the guide at: http://docs.codehaus.org/display/BTM/Tomcat
>
>
>
> Setenv.bat has this one line:
>
> set CATALINA_OPTS=-Dbtm.root=C:\apache-tomcat-7.0.26
> -Dbitronix.tm.configuration=C:\apache-tomcat-7.0.26\conf\btm-config.pr
> operties
>
>
>
> the jars in tomcat\lib are:
>
> btm-2.0.1.jar
>
> btm-tomcat55-lifecycle.jar
>
> geronimo-jta_1.1_spec-1.1.jar
>
> slf4j-api-1.6.0.jar
>
> slf4j-jdk14-1.6.0.jar
>
> classes12-10g.2.0.4.jar
>
>
>
>
>
> btm-config.properties is:
>
> 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.properti
> es
>
>
>
> server.xml and context.xml have the two lines added in their
> respective files for BTMLifecycleListener and
> bitronixUserTransactionObjectFactory
>
>
>
> resources.properties is:
>
> resource.ds1.className=oracle.jdbc.pool.OracleDataSource
>
> resource.ds1.uniqueName=jdbc/mccAppDBPool
>
> resource.ds1.maxPoolSize=10
>
> resource.ds1.allowLocalTransactions=true
>
> resource.ds1.testQuery=SELECT 1 FROM DUAL
>
> resource.ds1.driverProperties.user=test
>
> resource.ds1.driverProperties.password=test
>
> resource.ds1.driverProperties.URL=jdbc:oracle:thin:@localhost:1521:tes
> t
>
>
>
> here is the logs for tomcat, shutsdown after showing the server id,
> there is not other tomcat log entries:
>
>
>
>
>
> Jun 8, 2012 10:05:45 AM org.apache.catalina.core.AprLifecycleListener
> init
>
> INFO: The APR based Apache Tomcat Native library which allows optimal
> performance in production environments was not found on the
> java.library.path: C:\Program Files (x86)\Java\jdk1.6.0_31-32bit\bin
>
> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>
> INFO: Initializing ProtocolHandler ["http-bio-8080"]
>
> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>
> INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
>
> Jun 8, 2012 10:05:45 AM org.apache.catalina.startup.Catalina load
>
> INFO: Initialization processed in 329 ms
>
> Jun 8, 2012 10:05:45 AM
> bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent
>
> INFO: Starting Bitronix Transaction Manager
>
> Jun 8, 2012 10:05:45 AM bitronix.tm.BitronixTransactionManager
> logVersion
>
> INFO: Bitronix Transaction Manager version 2.0.1
>
> Jun 8, 2012 10:05:45 AM bitronix.tm.Configuration buildServerIdArray
>
> INFO: JVM unique ID: <tomcat-btm-node0>
>
>

---------------------------------------------------------------------
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
|  
Report Content as Inappropriate

RE: tomcat 7.0.26 and bitronix

Ralph Carlson
In reply to this post by Ludovic Orban-2
I have my app deployed (cxf, hibernate, ejb3 on tomcat 7 JTA), yet it doesn't work, I am getting this class cast exception,
any ideas on where to start with this? Does it need to be an XA transaction manager?

Caused by: java.lang.ClassCastException: bitronix.tm.BitronixTransactionManager cannot be cast to javax.transaction.TransactionManager
        at org.hibernate.service.jta.platform.internal.BitronixJtaPlatform.locateTransactionManager(BitronixJtaPlatform.java:44)
        ... 52 more





Currently my cxf config looks like this:

<beans xmlns = "http://www.springframework.org/schema/beans" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws = "http://cxf.apache.org/jaxws" xsi:schemaLocation = "
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
    <import resource = "classpath:META-INF/cxf/cxf.xml"/>
    <import resource = "classpath:META-INF/cxf/cxf-extension-soap.xml"/>
    <import resource = "classpath:META-INF/cxf/cxf-servlet.xml"/>
    <jaxws:endpoint
        id = "Authentication"
        implementor = "com.company. Authenticator"
        address = "/Authenticator"/>

</beans>

Persistence.xml looks like:
<persistence xmlns = "http://java.sun.com/xml/ns/persistence"  version = "1.0">
        <persistence-unit name = "java:myjpa" transaction-type = "JTA">
                <provider>org.hibernate.ejb.HibernatePersistence</provider>
                <jta-data-source>jdbc/mccAppDBPool</jta-data-source>
                <class>com.company.Users</class>
                <class>com.company.UsersRoles</class>                
                <properties>
                        <property name = "hibernate.dialect" value = "org.hibernate.dialect.Oracle10gDialect"/>
                        <property name = "hibernate.max_fetch_depth" value = "0"/>
                        <property name = "hibernate.show_sql" value = "true"/>
                        <property name = "hibernate.connection.isolation" value = "2"/>
                        <property name = "hibernate.format_sql" value = "true"/>
                        <property name = "hibernate.cache.region_prefix" value=""/>
                        <property name = "hibernate.jndi.class" value="bitronix.tm.jndi.BitronixInitialContextFactory"/>
                        <property name = "hibernate.transaction.factory_class" value = "org.hibernate.transaction.JTATransactionFactory"/>
                        <property name = "hibernate.transaction.manager_lookup_class" value = "org.hibernate.transaction.BTMTransactionManagerLookup"/>
                        <property name = "hibernate.cache.region.factory_class" value = "org.hibernate.cache.ehcache.EhCacheRegionFactory"/>
                        <property name = "hibernate.cache.use_second_level_cache" value = "true"/>
                        <property name = "hibernate.cache.use_query_cache" value = "true"/>
                        <property name = "hibernate.cache.provider_configuration_file_resource_path" value = "/ehcache.xml"/>
                        <property name = "hibernate.cache.provider_class" value = "net.sf.ehcache.hibernate.EhCacheProvider" />
                </properties>
        </persistence-unit>
</persistence>

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Ludovic Orban
Sent: Friday, June 08, 2012 2:43 PM
To: [hidden email]
Subject: Re: [btm-user] tomcat 7.0.26 and bitronix

I don't know what's wrong with your Tomcat logs but as a simple suggestion, have you tried starting it from a DOS box with "catalina.bat run"?

I also wonder why you're using an old version of BTM and not the latest 2.1.3. You should consider using the latest version as quite a few new features and bug fixes made into it.

Finally, I spotted one mistake in your resources.properties config:
you've configured
resource.ds1.className=oracle.jdbc.pool.OracleDataSource but oracle.jdbc.pool.OracleDataSource does not implement javax.sql.XADataSource. BTM should refuse to boot with such mistake and I suppose that's what prevented Tomcat from starting up but still doesn't explain why that did not get logged. You should use resource.ds1.className=oracle.jdbc.xa.client.OracleXADataSource
instead.



On Fri, Jun 8, 2012 at 4:07 PM, Ralph Carlson <[hidden email]> wrote:

> Does bitronix work with apache-tomcat-7.0.26? I am having trouble
> getting it to work, I have not yet deployed any apps to tomcat, only
> tried to configure bitronix with clean tomcat install
>
> I am using windows 7 with 32 bit jdk
>
>
>
> I followed the guide at: http://docs.codehaus.org/display/BTM/Tomcat
>
>
>
> Setenv.bat has this one line:
>
> set CATALINA_OPTS=-Dbtm.root=C:\apache-tomcat-7.0.26
> -Dbitronix.tm.configuration=C:\apache-tomcat-7.0.26\conf\btm-config.pr
> operties
>
>
>
> the jars in tomcat\lib are:
>
> btm-2.0.1.jar
>
> btm-tomcat55-lifecycle.jar
>
> geronimo-jta_1.1_spec-1.1.jar
>
> slf4j-api-1.6.0.jar
>
> slf4j-jdk14-1.6.0.jar
>
> classes12-10g.2.0.4.jar
>
>
>
>
>
> btm-config.properties is:
>
> 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.properti
> es
>
>
>
> server.xml and context.xml have the two lines added in their
> respective files for BTMLifecycleListener and
> bitronixUserTransactionObjectFactory
>
>
>
> resources.properties is:
>
> resource.ds1.className=oracle.jdbc.pool.OracleDataSource
>
> resource.ds1.uniqueName=jdbc/mccAppDBPool
>
> resource.ds1.maxPoolSize=10
>
> resource.ds1.allowLocalTransactions=true
>
> resource.ds1.testQuery=SELECT 1 FROM DUAL
>
> resource.ds1.driverProperties.user=test
>
> resource.ds1.driverProperties.password=test
>
> resource.ds1.driverProperties.URL=jdbc:oracle:thin:@localhost:1521:tes
> t
>
>
>
> here is the logs for tomcat, shutsdown after showing the server id,
> there is not other tomcat log entries:
>
>
>
>
>
> Jun 8, 2012 10:05:45 AM org.apache.catalina.core.AprLifecycleListener
> init
>
> INFO: The APR based Apache Tomcat Native library which allows optimal
> performance in production environments was not found on the
> java.library.path: C:\Program Files (x86)\Java\jdk1.6.0_31-32bit\bin
>
> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>
> INFO: Initializing ProtocolHandler ["http-bio-8080"]
>
> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>
> INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
>
> Jun 8, 2012 10:05:45 AM org.apache.catalina.startup.Catalina load
>
> INFO: Initialization processed in 329 ms
>
> Jun 8, 2012 10:05:45 AM
> bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent
>
> INFO: Starting Bitronix Transaction Manager
>
> Jun 8, 2012 10:05:45 AM bitronix.tm.BitronixTransactionManager
> logVersion
>
> INFO: Bitronix Transaction Manager version 2.0.1
>
> Jun 8, 2012 10:05:45 AM bitronix.tm.Configuration buildServerIdArray
>
> INFO: JVM unique ID: <tomcat-btm-node0>
>
>

---------------------------------------------------------------------
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
|  
Report Content as Inappropriate

Re: tomcat 7.0.26 and bitronix

ewestfal
You don't happen to also have some of the jars (like jta-1.1.jar or the
btm jar) which that guide asked you to copy into Tomcat's lib directory
in your web application's WEB-INF/lib directory as well do you?

Thanks,
Eric

On 6/8/12 4:41 PM, Ralph Carlson wrote:

> I have my app deployed (cxf, hibernate, ejb3 on tomcat 7 JTA), yet it doesn't work, I am getting this class cast exception,
> any ideas on where to start with this? Does it need to be an XA transaction manager?
>
> Caused by: java.lang.ClassCastException: bitronix.tm.BitronixTransactionManager cannot be cast to javax.transaction.TransactionManager
> at org.hibernate.service.jta.platform.internal.BitronixJtaPlatform.locateTransactionManager(BitronixJtaPlatform.java:44)
> ... 52 more
>
>
>
>
>
> Currently my cxf config looks like this:
>
> <beans xmlns = "http://www.springframework.org/schema/beans" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws = "http://cxf.apache.org/jaxws" xsi:schemaLocation = "
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>      <import resource = "classpath:META-INF/cxf/cxf.xml"/>
>      <import resource = "classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>      <import resource = "classpath:META-INF/cxf/cxf-servlet.xml"/>
>      <jaxws:endpoint
>          id = "Authentication"
>          implementor = "com.company. Authenticator"
>          address = "/Authenticator"/>
>
> </beans>
>
> Persistence.xml looks like:
> <persistence xmlns = "http://java.sun.com/xml/ns/persistence"  version = "1.0">
>          <persistence-unit name = "java:myjpa" transaction-type = "JTA">
>                  <provider>org.hibernate.ejb.HibernatePersistence</provider>
>                  <jta-data-source>jdbc/mccAppDBPool</jta-data-source>
>                  <class>com.company.Users</class>
>                  <class>com.company.UsersRoles</class>
>                  <properties>
>                          <property name = "hibernate.dialect" value = "org.hibernate.dialect.Oracle10gDialect"/>
>                          <property name = "hibernate.max_fetch_depth" value = "0"/>
>                          <property name = "hibernate.show_sql" value = "true"/>
>                          <property name = "hibernate.connection.isolation" value = "2"/>
>                          <property name = "hibernate.format_sql" value = "true"/>
>                          <property name = "hibernate.cache.region_prefix" value=""/>
>                          <property name = "hibernate.jndi.class" value="bitronix.tm.jndi.BitronixInitialContextFactory"/>
>                          <property name = "hibernate.transaction.factory_class" value = "org.hibernate.transaction.JTATransactionFactory"/>
>                          <property name = "hibernate.transaction.manager_lookup_class" value = "org.hibernate.transaction.BTMTransactionManagerLookup"/>
>                          <property name = "hibernate.cache.region.factory_class" value = "org.hibernate.cache.ehcache.EhCacheRegionFactory"/>
>                          <property name = "hibernate.cache.use_second_level_cache" value = "true"/>
>                          <property name = "hibernate.cache.use_query_cache" value = "true"/>
>                          <property name = "hibernate.cache.provider_configuration_file_resource_path" value = "/ehcache.xml"/>
>                          <property name = "hibernate.cache.provider_class" value = "net.sf.ehcache.hibernate.EhCacheProvider" />
>                  </properties>
>          </persistence-unit>
> </persistence>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Ludovic Orban
> Sent: Friday, June 08, 2012 2:43 PM
> To: [hidden email]
> Subject: Re: [btm-user] tomcat 7.0.26 and bitronix
>
> I don't know what's wrong with your Tomcat logs but as a simple suggestion, have you tried starting it from a DOS box with "catalina.bat run"?
>
> I also wonder why you're using an old version of BTM and not the latest 2.1.3. You should consider using the latest version as quite a few new features and bug fixes made into it.
>
> Finally, I spotted one mistake in your resources.properties config:
> you've configured
> resource.ds1.className=oracle.jdbc.pool.OracleDataSource but oracle.jdbc.pool.OracleDataSource does not implement javax.sql.XADataSource. BTM should refuse to boot with such mistake and I suppose that's what prevented Tomcat from starting up but still doesn't explain why that did not get logged. You should use resource.ds1.className=oracle.jdbc.xa.client.OracleXADataSource
> instead.
>
>
>
> On Fri, Jun 8, 2012 at 4:07 PM, Ralph Carlson<[hidden email]>  wrote:
>> Does bitronix work with apache-tomcat-7.0.26? I am having trouble
>> getting it to work, I have not yet deployed any apps to tomcat, only
>> tried to configure bitronix with clean tomcat install
>>
>> I am using windows 7 with 32 bit jdk
>>
>>
>>
>> I followed the guide at: http://docs.codehaus.org/display/BTM/Tomcat
>>
>>
>>
>> Setenv.bat has this one line:
>>
>> set CATALINA_OPTS=-Dbtm.root=C:\apache-tomcat-7.0.26
>> -Dbitronix.tm.configuration=C:\apache-tomcat-7.0.26\conf\btm-config.pr
>> operties
>>
>>
>>
>> the jars in tomcat\lib are:
>>
>> btm-2.0.1.jar
>>
>> btm-tomcat55-lifecycle.jar
>>
>> geronimo-jta_1.1_spec-1.1.jar
>>
>> slf4j-api-1.6.0.jar
>>
>> slf4j-jdk14-1.6.0.jar
>>
>> classes12-10g.2.0.4.jar
>>
>>
>>
>>
>>
>> btm-config.properties is:
>>
>> 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.properti
>> es
>>
>>
>>
>> server.xml and context.xml have the two lines added in their
>> respective files for BTMLifecycleListener and
>> bitronixUserTransactionObjectFactory
>>
>>
>>
>> resources.properties is:
>>
>> resource.ds1.className=oracle.jdbc.pool.OracleDataSource
>>
>> resource.ds1.uniqueName=jdbc/mccAppDBPool
>>
>> resource.ds1.maxPoolSize=10
>>
>> resource.ds1.allowLocalTransactions=true
>>
>> resource.ds1.testQuery=SELECT 1 FROM DUAL
>>
>> resource.ds1.driverProperties.user=test
>>
>> resource.ds1.driverProperties.password=test
>>
>> resource.ds1.driverProperties.URL=jdbc:oracle:thin:@localhost:1521:tes
>> t
>>
>>
>>
>> here is the logs for tomcat, shutsdown after showing the server id,
>> there is not other tomcat log entries:
>>
>>
>>
>>
>>
>> Jun 8, 2012 10:05:45 AM org.apache.catalina.core.AprLifecycleListener
>> init
>>
>> INFO: The APR based Apache Tomcat Native library which allows optimal
>> performance in production environments was not found on the
>> java.library.path: C:\Program Files (x86)\Java\jdk1.6.0_31-32bit\bin
>>
>> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>>
>> INFO: Initializing ProtocolHandler ["http-bio-8080"]
>>
>> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>>
>> INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
>>
>> Jun 8, 2012 10:05:45 AM org.apache.catalina.startup.Catalina load
>>
>> INFO: Initialization processed in 329 ms
>>
>> Jun 8, 2012 10:05:45 AM
>> bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent
>>
>> INFO: Starting Bitronix Transaction Manager
>>
>> Jun 8, 2012 10:05:45 AM bitronix.tm.BitronixTransactionManager
>> logVersion
>>
>> INFO: Bitronix Transaction Manager version 2.0.1
>>
>> Jun 8, 2012 10:05:45 AM bitronix.tm.Configuration buildServerIdArray
>>
>> INFO: JVM unique ID:<tomcat-btm-node0>
>>
>>
>
> ---------------------------------------------------------------------
> 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
>
>

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

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: tomcat 7.0.26 and bitronix

Ralph Carlson
yes, that solved that issue, however my entity mangager is null after EntityManager em = emf.createEntityManager()

I see some stuff online about KnowledgeFactory and org.hibernate.Environment but
not enough details to work out how to get Bitronix and/or hibernate to connect to the database automatically
they reference "Environment" and "KnowledgeBaseFactory", I assume this is org.hibernate.Environment but
I have no idea where KnowledgeBaseFactory comes from or what to set (its now in any of my current jars)
________________________________________
From: Eric Westfall [[hidden email]]
Sent: Friday, June 08, 2012 4:53 PM
To: [hidden email]
Cc: Ralph Carlson
Subject: Re: [btm-user] tomcat 7.0.26 and bitronix

You don't happen to also have some of the jars (like jta-1.1.jar or the
btm jar) which that guide asked you to copy into Tomcat's lib directory
in your web application's WEB-INF/lib directory as well do you?

Thanks,
Eric

On 6/8/12 4:41 PM, Ralph Carlson wrote:

> I have my app deployed (cxf, hibernate, ejb3 on tomcat 7 JTA), yet it doesn't work, I am getting this class cast exception,
> any ideas on where to start with this? Does it need to be an XA transaction manager?
>
> Caused by: java.lang.ClassCastException: bitronix.tm.BitronixTransactionManager cannot be cast to javax.transaction.TransactionManager
>       at org.hibernate.service.jta.platform.internal.BitronixJtaPlatform.locateTransactionManager(BitronixJtaPlatform.java:44)
>       ... 52 more
>
>
>
>
>
> Currently my cxf config looks like this:
>
> <beans xmlns = "http://www.springframework.org/schema/beans" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:jaxws = "http://cxf.apache.org/jaxws" xsi:schemaLocation = "
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
>      <import resource = "classpath:META-INF/cxf/cxf.xml"/>
>      <import resource = "classpath:META-INF/cxf/cxf-extension-soap.xml"/>
>      <import resource = "classpath:META-INF/cxf/cxf-servlet.xml"/>
>      <jaxws:endpoint
>          id = "Authentication"
>          implementor = "com.company. Authenticator"
>          address = "/Authenticator"/>
>
> </beans>
>
> Persistence.xml looks like:
> <persistence xmlns = "http://java.sun.com/xml/ns/persistence"  version = "1.0">
>          <persistence-unit name = "java:myjpa" transaction-type = "JTA">
>                  <provider>org.hibernate.ejb.HibernatePersistence</provider>
>                  <jta-data-source>jdbc/mccAppDBPool</jta-data-source>
>                  <class>com.company.Users</class>
>                  <class>com.company.UsersRoles</class>
>                  <properties>
>                          <property name = "hibernate.dialect" value = "org.hibernate.dialect.Oracle10gDialect"/>
>                          <property name = "hibernate.max_fetch_depth" value = "0"/>
>                          <property name = "hibernate.show_sql" value = "true"/>
>                          <property name = "hibernate.connection.isolation" value = "2"/>
>                          <property name = "hibernate.format_sql" value = "true"/>
>                          <property name = "hibernate.cache.region_prefix" value=""/>
>                          <property name = "hibernate.jndi.class" value="bitronix.tm.jndi.BitronixInitialContextFactory"/>
>                          <property name = "hibernate.transaction.factory_class" value = "org.hibernate.transaction.JTATransactionFactory"/>
>                          <property name = "hibernate.transaction.manager_lookup_class" value = "org.hibernate.transaction.BTMTransactionManagerLookup"/>
>                          <property name = "hibernate.cache.region.factory_class" value = "org.hibernate.cache.ehcache.EhCacheRegionFactory"/>
>                          <property name = "hibernate.cache.use_second_level_cache" value = "true"/>
>                          <property name = "hibernate.cache.use_query_cache" value = "true"/>
>                          <property name = "hibernate.cache.provider_configuration_file_resource_path" value = "/ehcache.xml"/>
>                          <property name = "hibernate.cache.provider_class" value = "net.sf.ehcache.hibernate.EhCacheProvider" />
>                  </properties>
>          </persistence-unit>
> </persistence>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On Behalf Of Ludovic Orban
> Sent: Friday, June 08, 2012 2:43 PM
> To: [hidden email]
> Subject: Re: [btm-user] tomcat 7.0.26 and bitronix
>
> I don't know what's wrong with your Tomcat logs but as a simple suggestion, have you tried starting it from a DOS box with "catalina.bat run"?
>
> I also wonder why you're using an old version of BTM and not the latest 2.1.3. You should consider using the latest version as quite a few new features and bug fixes made into it.
>
> Finally, I spotted one mistake in your resources.properties config:
> you've configured
> resource.ds1.className=oracle.jdbc.pool.OracleDataSource but oracle.jdbc.pool.OracleDataSource does not implement javax.sql.XADataSource. BTM should refuse to boot with such mistake and I suppose that's what prevented Tomcat from starting up but still doesn't explain why that did not get logged. You should use resource.ds1.className=oracle.jdbc.xa.client.OracleXADataSource
> instead.
>
>
>
> On Fri, Jun 8, 2012 at 4:07 PM, Ralph Carlson<[hidden email]>  wrote:
>> Does bitronix work with apache-tomcat-7.0.26? I am having trouble
>> getting it to work, I have not yet deployed any apps to tomcat, only
>> tried to configure bitronix with clean tomcat install
>>
>> I am using windows 7 with 32 bit jdk
>>
>>
>>
>> I followed the guide at: http://docs.codehaus.org/display/BTM/Tomcat
>>
>>
>>
>> Setenv.bat has this one line:
>>
>> set CATALINA_OPTS=-Dbtm.root=C:\apache-tomcat-7.0.26
>> -Dbitronix.tm.configuration=C:\apache-tomcat-7.0.26\conf\btm-config.pr
>> operties
>>
>>
>>
>> the jars in tomcat\lib are:
>>
>> btm-2.0.1.jar
>>
>> btm-tomcat55-lifecycle.jar
>>
>> geronimo-jta_1.1_spec-1.1.jar
>>
>> slf4j-api-1.6.0.jar
>>
>> slf4j-jdk14-1.6.0.jar
>>
>> classes12-10g.2.0.4.jar
>>
>>
>>
>>
>>
>> btm-config.properties is:
>>
>> 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.properti
>> es
>>
>>
>>
>> server.xml and context.xml have the two lines added in their
>> respective files for BTMLifecycleListener and
>> bitronixUserTransactionObjectFactory
>>
>>
>>
>> resources.properties is:
>>
>> resource.ds1.className=oracle.jdbc.pool.OracleDataSource
>>
>> resource.ds1.uniqueName=jdbc/mccAppDBPool
>>
>> resource.ds1.maxPoolSize=10
>>
>> resource.ds1.allowLocalTransactions=true
>>
>> resource.ds1.testQuery=SELECT 1 FROM DUAL
>>
>> resource.ds1.driverProperties.user=test
>>
>> resource.ds1.driverProperties.password=test
>>
>> resource.ds1.driverProperties.URL=jdbc:oracle:thin:@localhost:1521:tes
>> t
>>
>>
>>
>> here is the logs for tomcat, shutsdown after showing the server id,
>> there is not other tomcat log entries:
>>
>>
>>
>>
>>
>> Jun 8, 2012 10:05:45 AM org.apache.catalina.core.AprLifecycleListener
>> init
>>
>> INFO: The APR based Apache Tomcat Native library which allows optimal
>> performance in production environments was not found on the
>> java.library.path: C:\Program Files (x86)\Java\jdk1.6.0_31-32bit\bin
>>
>> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>>
>> INFO: Initializing ProtocolHandler ["http-bio-8080"]
>>
>> Jun 8, 2012 10:05:45 AM org.apache.coyote.AbstractProtocol init
>>
>> INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
>>
>> Jun 8, 2012 10:05:45 AM org.apache.catalina.startup.Catalina load
>>
>> INFO: Initialization processed in 329 ms
>>
>> Jun 8, 2012 10:05:45 AM
>> bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent
>>
>> INFO: Starting Bitronix Transaction Manager
>>
>> Jun 8, 2012 10:05:45 AM bitronix.tm.BitronixTransactionManager
>> logVersion
>>
>> INFO: Bitronix Transaction Manager version 2.0.1
>>
>> Jun 8, 2012 10:05:45 AM bitronix.tm.Configuration buildServerIdArray
>>
>> INFO: JVM unique ID:<tomcat-btm-node0>
>>
>>
>
> ---------------------------------------------------------------------
> 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
>
>



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

    http://xircles.codehaus.org/manage_email


Loading...