problems configuring btm in tomcat 6

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

problems configuring btm in tomcat 6

stefanoB
Hello

I have to port an application developed for WebSphere 5 to Tomcat (6.0.xx); the first step is integrate btm into Tomcat to leave unchanged the transaction management.
I'm using eclipse Helios, Tomcat 6.0.16, btm 2.1.0, Oracle 10 and i've followed instruction at http://docs.codehaus.org/display/BTM/Tomcat13, i've read various post that seemed related to my problem, but i'm not been able to make it work yet. I'm not much experienced and i've never used jta, so it might be a problem related to Tomcat or eclipse ; any hint will be helpfull.

1. all not all the libraries listed inside the guide are present inside the package i've downloaded, in detail the btm 2.1 lib folder contains geronimo-jms_1.1_spec-1.0.1.jar (not geronimo-jta_1.0.1B_spec-1.0.1.jar), and i haven't found slf4j-jdk14-1.5.2.jar.

2. If i put the following resource inside (server's) context.xml

<Resource name="jdbc/NraDbA"
     auth="Container"
     type="javax.sql.DataSource"
     factory="bitronix.tm.resource.ResourceObjectFactory"
     uniqueName="jdbc/NraDbA" />

Tomcat give me some errors at startup and the jndi fails to find the resurce with uniquename jdbc/NraDbA. Below i've put the log of tomcat startup in case someone notices something unusual :

AVVERTENZA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.
24-mar-2011 14.43.53 org.apache.tomcat.util.digester.SetPropertiesRule begin
AVVERTENZA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.j2ee.server:NRA' did not find a matching property.
24-mar-2011 14.43.53 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:  (removed to keep the post short as possible)
24-mar-2011 14.43.53 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
24-mar-2011 14.43.53 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 519 ms
24-mar-2011 14.43.53 bitronix.tm.integration.tomcat55.BTMLifecycleListener lifecycleEvent
INFO: Starting Bitronix Transaction Manager
24-mar-2011 14.43.54 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
24-mar-2011 14.43.54 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
24-mar-2011 14.43.55 org.apache.catalina.core.NamingContextListener addResource
AVVERTENZA: Failed to register in JMX: javax.naming.NamingException: no resource registered with uniqueName 'jdbc/NraDbA', available resources: []
...
24-mar-2011 14.43.55 org.apache.catalina.core.NamingContextListener addResource
AVVERTENZA: Failed to register in JMX: javax.naming.NamingException: no resource registered with uniqueName 'jdbc/NraDbA', available resources: []
24-mar-2011 14.43.56 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
24-mar-2011 14.43.56 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
24-mar-2011 14.43.56 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/63  config=null
24-mar-2011 14.43.56 org.apache.catalina.startup.Catalina start

if i change the resource to the following, the server start without errors but connections don't get enlisted into any transaction and each insert / update is executed separately and never rolled back
Resource name="jdbc/NraDbA"
     auth="Container"
     type="javax.sql.DataSource"
     username="username"
     password="pwd"
     driverClassName="oracle.jdbc.OracleDriver"
         url="myoracledburl"
  />

3. i've found  a post about btm and eclipse related with my problem at point 2., it stated that the enviroment varialbes had to be set into eclipse configuration; so i've added the following inside VM arguments list for debug configuration, but hasn't solved my problem :
-Dbtm.root="C:\Programmi\Apache Software Foundation\Apache Tomcat 6.0.16"
-Dbitronix.tm.configuration="C:\Programmi\Apache Software Foundation\Apache Tomcat 6.0.16\conf\btm-config.properties"

4. The following is my btm-config.properties file :
bitronix.tm.serverId=tomcat-btm-node0
bitronix.tm.journal.disk.logPart1Filename=C:/Projects/myprj_Config/logs/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=C:/Projects/myprj_Config/logs/btm2.tlog
bitronix.tm.resource.configuration=C:/Projects/myprj_Config/resources.properties

5. the following is my resources.properties :

bitronix.tm.resource.bind=true

resource.ds.className=oracle.jdbc.xa.client.OracleXADataSource
resource.ds.uniqueName=jdbc/NraDba
resource.ds.minPoolSize=0
resource.ds.maxPoolSize=5
resource.ds.testQuery=SELECT 1 FROM DUAL
resource.ds.driverProperties.userName=username
resource.ds.driverProperties.password=password
resource.ds.driverProperties.url=urltomydb
resource.ds.driverProperties.pooling=true

my time is getting short , so thank you in advance for any help you could provide. If you need any more information or configuration files to narrow the problem i'll gladly provide them .
Thank you in advance
Stefano




Reply | Threaded
Open this post in threaded view
|

Re: problems configuring btm in tomcat 6

Ludovic Orban-2
You've been looking at the old version 1.3 documentation, the one for 2.x is at http://docs.codehaus.org/display/BTM/Tomcat2x

geronimo-jta_1.0.1B_spec-1.0.1.jar can be replaced by jta-1.1.jar or any other jar containing the javax.transaction.* packages.

The bundled SLF4J version changed to 1.6.0, but any version over 1.5.0 will work. You may have to download missing implementations from http://docs.codehaus.org/display/BTM/DebugLogging2x or http://repo2.maven.org/maven2/org/slf4j/ if you want to upgrade.

You have to configure your resources in context.xml, otherwise BTM won't recognize them as you noticed. The thing to know is that the <Resource> elements you add there are links to resources defined in the resources.properties file so that one has to be configured and loaded.

Your config files all look okay at first sight so I suspect BTM's config isn't picked up for some reason.

This log in particular:

Failed to register in JMX: javax.naming.NamingException: no resource registered with uniqueName 'jdbc/NraDbA', available resources: []

clearly shows that your <Resource> definitions in context.xml failed because the 'jdbc/NraDbA' resource could not be found, and actually no single resource got configured is what "available resources: []" says.

There's a good chance that the -Dbitronix.tm.configuration="C:\Programmi\Apache Software Foundation\ApacheTomcat 6.0.16\conf\btm-config.properties" command line option you added doesn't have any effect for some reason, probably because it's misplaced.

I see that you added bitronix.tm.serverId=tomcat-btm-node0 in your config which means you should get these logs when Tomcat starts up:

INFO: Bitronix Transaction Manager version 2.1.0
INFO: JVM unique ID: <tomcat-btm-node0>

but if you get instead:

INFO: Bitronix Transaction Manager version 2.1.0
WARNING: 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!).
INFO: JVM unique ID: <1.2.3.4>

this definitely means BTM did not find its config file. I would concentrate on that first.



2011/3/24 stefanoB <[hidden email]>

Hello

I have to port an application developed for WebSphere 5 to Tomcat (6.0.xx);
the first step is integrate btm into Tomcat to leave unchanged the
transaction management.
I'm using eclipse Helios, Tomcat 6.0.16, btm 2.1.0, Oracle 10 and i've
followed instruction at http://docs.codehaus.org/display/BTM/Tomcat13, i've
read various post that seemed related to my problem, but i'm not been able
to make it work yet. I'm not much experienced and i've never used jta, so it
might be a problem related to Tomcat or eclipse ; any hint will be helpfull.

1. all not all the libraries listed inside the guide are present inside the
package i've downloaded, in detail the btm 2.1 lib folder contains
geronimo-jms_1.1_spec-1.0.1.jar (not geronimo-jta_1.0.1B_spec-1.0.1.jar),
and i haven't found slf4j-jdk14-1.5.2.jar.

2. If i put the following resource inside (server's) context.xml

<Resource name="jdbc/NraDbA"
    auth="Container"
    type="javax.sql.DataSource"
    factory="bitronix.tm.resource.ResourceObjectFactory"
    uniqueName="jdbc/NraDbA" />

Tomcat give me some errors at startup and the jndi fails to find the resurce
with uniquename jdbc/NraDbA. Below i've put the log of tomcat startup in
case someone notices something unusual :

AVVERTENZA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
property 'debug' to '0' did not find a matching property.
24-mar-2011 14.43.53 org.apache.tomcat.util.digester.SetPropertiesRule begin
AVVERTENZA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting
property 'source' to 'org.eclipse.jst.j2ee.server:NRA' did not find a
matching property.
24-mar-2011 14.43.53 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:  (removed to keep the post short as possible)
24-mar-2011 14.43.53 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8084
24-mar-2011 14.43.53 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 519 ms
24-mar-2011 14.43.53 bitronix.tm.integration.tomcat55.BTMLifecycleListener
lifecycleEvent
INFO: Starting Bitronix Transaction Manager
24-mar-2011 14.43.54 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
24-mar-2011 14.43.54 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.16
24-mar-2011 14.43.55 org.apache.catalina.core.NamingContextListener
addResource
AVVERTENZA: Failed to register in JMX: javax.naming.NamingException: no
resource registered with uniqueName 'jdbc/NraDbA', available resources: []
...
24-mar-2011 14.43.55 org.apache.catalina.core.NamingContextListener
addResource
AVVERTENZA: Failed to register in JMX: javax.naming.NamingException: no
resource registered with uniqueName 'jdbc/NraDbA', available resources: []
24-mar-2011 14.43.56 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8084
24-mar-2011 14.43.56 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
24-mar-2011 14.43.56 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/63  config=null
24-mar-2011 14.43.56 org.apache.catalina.startup.Catalina start

if i change the resource to the following, the server start without errors
but connections don't get enlisted into any transaction and each insert /
update is executed separately and never rolled back
Resource name="jdbc/NraDbA"
    auth="Container"
    type="javax.sql.DataSource"
    username="username"
    password="pwd"
    driverClassName="oracle.jdbc.OracleDriver"
        url="myoracledburl"
       />

3. i've found  a post about btm and eclipse related with my problem at point
2., it stated that the enviroment varialbes had to be set into eclipse
configuration; so i've added the following inside VM arguments list for
debug configuration, but hasn't solved my problem :
-Dbtm.root="C:\Programmi\Apache Software Foundation\Apache Tomcat 6.0.16"
-Dbitronix.tm.configuration="C:\Programmi\Apache Software Foundation\Apache
Tomcat 6.0.16\conf\btm-config.properties"

4. The following is my btm-config.properties file :
bitronix.tm.serverId=tomcat-btm-node0
bitronix.tm.journal.disk.logPart1Filename=C:/Projects/myprj_Config/logs/btm1.tlog
bitronix.tm.journal.disk.logPart2Filename=C:/Projects/myprj_Config/logs/btm2.tlog
bitronix.tm.resource.configuration=C:/Projects/myprj_Config/resources.properties

5. the following is my resources.properties :

bitronix.tm.resource.bind=true

resource.ds.className=oracle.jdbc.xa.client.OracleXADataSource
resource.ds.uniqueName=jdbc/NraDba
resource.ds.minPoolSize=0
resource.ds.maxPoolSize=5
resource.ds.testQuery=SELECT 1 FROM DUAL
resource.ds.driverProperties.userName=username
resource.ds.driverProperties.password=password
resource.ds.driverProperties.url=urltomydb
resource.ds.driverProperties.pooling=true

my time is getting short , so thank you in advance for any help you could
provide. If you need any more information or configuration files to narrow
the problem i'll gladly provide them .
Thank you in advance
Stefano





--
View this message in context: http://old.nabble.com/problems-configuring-btm-in-tomcat-6-tp31229249p31229249.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



Reply | Threaded
Open this post in threaded view
|

Re: problems configuring btm in tomcat 6

stefanoB
hello

thank you for your support, i'm been able to integrate btm on a clean machine but not on the first one, so it must be an environment problem (there was also a couple of incorrect property names inside the resource file : url instead of URL, username instead of user).

Now i'm having another problem : when i try to create a statement/preparedstatement i get an Oracle exception. Below i've post the code and the stacktrace, could you give any hints about the problem please? Should i use an xaconnection?
thank you in advance for any help.
Note: i've casted to BitronixTransactionManager instead of UserTransaction because Tomcat, at startup, showed the following warning, but it keep coming, i don't understand what i'm doing wrong :

1. Tomcat Log
INFO: Starting Bitronix Transaction Manager
29-mar-2011 11.16.46 bitronix.tm.BitronixTransactionManager logVersion
INFO: Bitronix Transaction Manager version 2.1.0
29-mar-2011 11.16.46 bitronix.tm.Configuration buildServerIdArray
INFO: JVM unique ID: <tomcat-btm-node0>
29-mar-2011 11.16.46 bitronix.tm.journal.DiskJournal open
WARNING: active log file is unclean, did you call BitronixTransactionManager.shutdown() at the end of the last run?
29-mar-2011 11.16.46 bitronix.tm.resource.ResourceLoader init
INFO: reading resources configuration from D:\Programmi\tomcat6016\conf\resources.properties
29-mar-2011 11.16.47 bitronix.tm.recovery.Recoverer run
INFO: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 1 resource(s) [jdbc/NraDba] (restricted to serverId 'tomcat-btm-node0')


2. code

BitronixTransactionManager ut=null;
try {

...
        String sDataSource = p.getProperty("dataSource", "");

        InitialContext ctx = new InitialContext();
        ds = (DataSource) ctx.lookup(sDataSource);
        ut = (BitronixTransactionManager) ctx.lookup(costanti.JNDI_XA_TANSACTION);
        ut.begin();
       
        conn = ds.getConnection();
        sql = "SELECT id_parametri, valore FROM parametri ";
        PreparedStatement ps = conn.prepareStatement(sql);//i got an error here

...
        ut.commit();
}catch(Exception e) {
ut.rollback();
...}
finally{
if(ut != null)ut.shutdown();
}


3. stacktrace

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/NraDba in state ACCESSIBLE with usage count 1 wrapping oracle.jdbc.xa.client.OracleXAConnection@1eea7f0 on oracle.jdbc.driver.OracleConnection@15386c2
        at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:86)
        at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:243)
        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:585)
        at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:63)
        at $Proxy0.prepareStatement(Unknown Source)
        at org.apache.jsp.autentica.login_jsp._jspService(login_jsp.java:112)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:595)
Caused by: bitronix.tm.internal.BitronixSystemException: cannot enlist an XAResourceHolderState with uniqueName=jdbc/NraDba XAResource=oracle.jdbc.xa.client.OracleXAResource@b5ac2c with XID a Bitronix XID [746F6D6361742D62746D2D6E6F6465300000012F0093038600000000 : 746F6D6361742D62746D2D6E6F6465300000012F0093665900000002], error=XAER_PROTO
        at bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:100)
        at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:70)
        at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:84)
        ... 27 more
Caused by: javax.transaction.xa.XAException
        at oracle.jdbc.xa.OracleXAResource.disallowLocalTxnMode(OracleXAResource.java:1045)
        at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:153)
        at bitronix.tm.internal.XAResourceHolderState.start(XAResourceHolderState.java:211)
        at bitronix.tm.internal.XAResourceManager.enlist(XAResourceManager.java:108)
        at bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:93)
        ... 29 more

Reply | Threaded
Open this post in threaded view
|

Re: problems configuring btm in tomcat 6

Ludovic Orban-2
This most likely is due to a bug in the Oracle JDBC driver.

The very first thing you should do is to upgrade to the very latest 11g driver (even if you're using v10.x database) and try again to see if that helps.


2011/3/29 stefanoB <[hidden email]>

hello

thank you for your support, i'm been able to integrate btm on a clean
machine but not on the first one, so it must be an environment problem
(there was also a couple of incorrect property names inside the resource
file : url instead of URL, username instead of user).

Now i'm having another problem : when i try to create a
statement/preparedstatement i get an Oracle exception. Below i've post the
code and the stacktrace, could you give any hints about the problem please?
Should i use an xaconnection?
thank you in advance for any help.
Note: i've casted to BitronixTransactionManager instead of UserTransaction
because Tomcat, at startup, showed the following warning, but it keep
coming, i don't understand what i'm doing wrong :

1. Tomcat Log
INFO: Starting Bitronix Transaction Manager
29-mar-2011 11.16.46 bitronix.tm.BitronixTransactionManager logVersion
INFO: Bitronix Transaction Manager version 2.1.0
29-mar-2011 11.16.46 bitronix.tm.Configuration buildServerIdArray
INFO: JVM unique ID: <tomcat-btm-node0>
29-mar-2011 11.16.46 bitronix.tm.journal.DiskJournal open
WARNING: active log file is unclean, did you call
BitronixTransactionManager.shutdown() at the end of the last run?
29-mar-2011 11.16.46 bitronix.tm.resource.ResourceLoader init
INFO: reading resources configuration from
D:\Programmi\tomcat6016\conf\resources.properties
29-mar-2011 11.16.47 bitronix.tm.recovery.Recoverer run
INFO: recovery committed 0 dangling transaction(s) and rolled back 0 aborted
transaction(s) on 1 resource(s) [jdbc/NraDba] (restricted to serverId
'tomcat-btm-node0')


2. code

BitronixTransactionManager ut=null;
try {

...
       String sDataSource = p.getProperty("dataSource", "");

       InitialContext ctx = new InitialContext();
       ds = (DataSource) ctx.lookup(sDataSource);
       ut = (BitronixTransactionManager) ctx.lookup(costanti.JNDI_XA_TANSACTION);
       ut.begin();

       conn = ds.getConnection();
       sql = "SELECT id_parametri, valore FROM parametri ";
       PreparedStatement ps = conn.prepareStatement(sql);//i got an error here

...
       ut.commit();
}catch(Exception e) {
ut.rollback();
...}
finally{
if(ut != null)ut.shutdown();
}


3. stacktrace

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a
JdbcPooledConnection from datasource jdbc/NraDba in state ACCESSIBLE with
usage count 1 wrapping oracle.jdbc.xa.client.OracleXAConnection@1eea7f0 on
oracle.jdbc.driver.OracleConnection@15386c2
       at
bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:86)
       at
bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:243)
       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:585)
       at
bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:63)
       at $Proxy0.prepareStatement(Unknown Source)
       at org.apache.jsp.autentica.login_jsp._jspService(login_jsp.java:112)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
       at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
       at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:595)
Caused by: bitronix.tm.internal.BitronixSystemException: cannot enlist an
XAResourceHolderState with uniqueName=jdbc/NraDba
XAResource=oracle.jdbc.xa.client.OracleXAResource@b5ac2c with XID a Bitronix
XID [746F6D6361742D62746D2D6E6F6465300000012F0093038600000000 :
746F6D6361742D62746D2D6E6F6465300000012F0093665900000002], error=XAER_PROTO
       at
bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:100)
       at
bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:70)
       at
bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:84)
       ... 27 more
Caused by: javax.transaction.xa.XAException
       at
oracle.jdbc.xa.OracleXAResource.disallowLocalTxnMode(OracleXAResource.java:1045)
       at oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java:153)
       at
bitronix.tm.internal.XAResourceHolderState.start(XAResourceHolderState.java:211)
       at
bitronix.tm.internal.XAResourceManager.enlist(XAResourceManager.java:108)
       at
bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:93)
       ... 29 more


--
View this message in context: http://old.nabble.com/problems-configuring-btm-in-tomcat-6-tp31229249p31265972.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



Reply | Threaded
Open this post in threaded view
|

Re: problems configuring btm in tomcat 6

stefanoB
i've updated jdbc drivers from ojdbc14 to ojdbc5, but it has only changed the error:
1. when tomcat starts i get a recovery exception:
29-mar-2011 12.35.27 bitronix.tm.recovery.Recoverer recoverAllResources
AVVERTENZA: error running recovery on resource 'jdbc/NraDba', resource marked as failed (background recoverer will retry recovery) (error=XAER_RMERR)
javax.transaction.xa.XAException
        at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:709)
        at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:93)
        at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:58)
        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:254)
        at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
        at bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:64)
        at bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:62)
        at bitronix.tm.integration.tomcat55.BTMLifecycleListener.lifecycleEvent(BTMLifecycleListener.java:18)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.StandardServer.start(StandardServer.java:701)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
        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:585)
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
29-mar-2011 12.35.27 bitronix.tm.recovery.Recoverer run
INFO: recovery committed 0 dangling transaction(s) and rolled back 0 aborted transaction(s) on 0 resource(s) [] (restricted to serverId 'tomcat-btm-node0')

2. when i try to get a connection i get another exception (with older drivers this happened at statement creation):
java.sql.SQLException: unable to get a connection from pool of a PoolingDataSource containing an XAPool of resource jdbc/NraDba with 1 connection(s) (1 still available) -failed-
        at bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:201)
        at org.apache.jsp.autentica.login_jsp._jspService(login_jsp.java:105)
        at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:595)
Caused by: bitronix.tm.internal.BitronixRuntimeException: incremental recovery failed when trying to acquire a connection from failed resource 'jdbc/NraDba'
        at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:103)
        at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:91)
        at bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:197)
        ... 20 more
Caused by: bitronix.tm.recovery.RecoveryException: failed recovering resource jdbc/NraDba
        at bitronix.tm.recovery.IncrementalRecoverer.recover(IncrementalRecoverer.java:104)
        at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:100)
        ... 22 more
Caused by: javax.transaction.xa.XAException
        at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:709)
        at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:93)
        at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:58)
        at bitronix.tm.recovery.IncrementalRecoverer.recover(IncrementalRecoverer.java:64)
        ... 23 more



Ludovic Orban-2 wrote
This most likely is due to a bug in the Oracle JDBC driver.

The very first thing you should do is to upgrade to the very latest 11g
driver (even if you're using v10.x database) and try again to see if that
helps.
Reply | Threaded
Open this post in threaded view
|

Re: problems configuring btm in tomcat 6

Ludovic Orban-2
http://docs.codehaus.org/display/BTM/FAQ#FAQ-WhyisOraclethrowingaXAExceptionduringinitializationofmydatasource%3F

2011/3/29 stefanoB <[hidden email]>

i've updated jdbc drivers from ojdbc14 to ojdbc5, but it has only changed the
error:
1. when tomcat starts i get a recovery exception:
29-mar-2011 12.35.27 bitronix.tm.recovery.Recoverer recoverAllResources
AVVERTENZA: error running recovery on resource 'jdbc/NraDba', resource
marked as failed (background recoverer will retry recovery)
(error=XAER_RMERR)
javax.transaction.xa.XAException
       at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:709)
       at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:93)
       at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:58)
       at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:254)
       at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
       at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
       at
bitronix.tm.BitronixTransactionManager.<init>(BitronixTransactionManager.java:64)
       at
bitronix.tm.TransactionManagerServices.getTransactionManager(TransactionManagerServices.java:62)
       at
bitronix.tm.integration.tomcat55.BTMLifecycleListener.lifecycleEvent(BTMLifecycleListener.java:18)
       at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
       at org.apache.catalina.core.StandardServer.start(StandardServer.java:701)
       at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
       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:585)
       at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
       at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
29-mar-2011 12.35.27 bitronix.tm.recovery.Recoverer run
INFO: recovery committed 0 dangling transaction(s) and rolled back 0 aborted
transaction(s) on 0 resource(s) [] (restricted to serverId
'tomcat-btm-node0')

2. when i try to get a connection i get another exception (with older
drivers this happened at statement creation):
java.sql.SQLException: unable to get a connection from pool of a
PoolingDataSource containing an XAPool of resource jdbc/NraDba with 1
connection(s) (1 still available) -failed-
       at
bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:201)
       at org.apache.jsp.autentica.login_jsp._jspService(login_jsp.java:105)
       at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
       at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
       at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
       at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
       at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
       at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
       at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       at java.lang.Thread.run(Thread.java:595)
Caused by: bitronix.tm.internal.BitronixRuntimeException: incremental
recovery failed when trying to acquire a connection from failed resource
'jdbc/NraDba'
       at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:103)
       at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:91)
       at
bitronix.tm.resource.jdbc.PoolingDataSource.getConnection(PoolingDataSource.java:197)
       ... 20 more
Caused by: bitronix.tm.recovery.RecoveryException: failed recovering
resource jdbc/NraDba
       at
bitronix.tm.recovery.IncrementalRecoverer.recover(IncrementalRecoverer.java:104)
       at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:100)
       ... 22 more
Caused by: javax.transaction.xa.XAException
       at oracle.jdbc.xa.OracleXAResource.recover(OracleXAResource.java:709)
       at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:93)
       at bitronix.tm.recovery.RecoveryHelper.recover(RecoveryHelper.java:58)
       at
bitronix.tm.recovery.IncrementalRecoverer.recover(IncrementalRecoverer.java:64)
       ... 23 more




Ludovic Orban-2 wrote:
>
> This most likely is due to a bug in the Oracle JDBC driver.
>
> The very first thing you should do is to upgrade to the very latest 11g
> driver (even if you're using v10.x database) and try again to see if that
> helps.
>
>

--
View this message in context: http://old.nabble.com/problems-configuring-btm-in-tomcat-6-tp31229249p31266389.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