Siemback, Chris | 12 Jul 14:27 2011

Tomcat Pool and XA datasource

Hello all,

Has anyone ever been able to successfully setup an Oracle XA datasource using the newer Tomcat Pool and
running Tomcat 7?  It appears the Tomcat Pool is attempting to cast the oracle XA data source to a
java.sql.Driver - which it isn't.  This needs to be an XA datasource.  Anyone have luck with this - no working
examples that I can find?  Here's the versions/info/error:

Software:
Tomcat 7.0.16
Tomcat Pool 1.1.0.1 http://people.apache.org/~fhanik/jdbc-pool/v1.1.0.1/apache-tomcat-jdbc-1.1.0.1-bin.zip
Oracle 11 (ojdbc6.jar)

Context.xml contents:
<Resource
                                auth="Container"
                                type="javax.sql.XADataSource"
                                factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
                                driverClassName="oracle.jdbc.xa.client.OracleXADataSource"
                                name="jdbc/mydatabase"
                                username="username"
                                password="password"
                                url="jdbc:oracle:thin: <at> localhost:1521:XE" />

Exception:

SEVERE: Servlet.service() for servlet [jsp] in context with path [] threw exception
[javax.servlet.ServletException: javax.naming.NamingException:
oracle.jdbc.xa.client.OracleXADataSource cannot be cast to java.sql.Driver] with root cause
javax.naming.NamingException: oracle.jdbc.xa.client.OracleXADataSource cannot be cast to java.sql.Driver
                at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
(Continue reading)

Filip Hanik - Dev Lists | 13 Jul 22:46 2011

Re: Tomcat Pool and XA datasource

you've misconfigured it. the driverClassName would have to be a driver.
Using XA data sources needs to create the datasource for those connections first.

There is an example towards the bottom of

http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency

Filip

On 7/12/2011 6:27 AM, Siemback, Chris wrote:
> Hello all,
>
> Has anyone ever been able to successfully setup an Oracle XA datasource using the newer Tomcat Pool and
running Tomcat 7?  It appears the Tomcat Pool is attempting to cast the oracle XA data source to a
java.sql.Driver - which it isn't.  This needs to be an XA datasource.  Anyone have luck with this - no working
examples that I can find?  Here's the versions/info/error:
>
> Software:
> Tomcat 7.0.16
> Tomcat Pool 1.1.0.1 http://people.apache.org/~fhanik/jdbc-pool/v1.1.0.1/apache-tomcat-jdbc-1.1.0.1-bin.zip
> Oracle 11 (ojdbc6.jar)
>
>
> Context.xml contents:
> <Resource
>                                  auth="Container"
>                                  type="javax.sql.XADataSource"
>                                  factory="org.apache.tomcat.jdbc.pool.DataSourceFactory"
>                                  driverClassName="oracle.jdbc.xa.client.OracleXADataSource"
>                                  name="jdbc/mydatabase"
(Continue reading)

Siemback, Chris | 14 Jul 13:52 2011

RE: Tomcat Pool and XA datasource

Fabulous doc - thanks Filip!  The examples are very helpful and that's the most thorough description of the
pool options available.  I've yet to test the XA commit/rollback functionality, but the pool itself is up
now.  Thanks for your assistance, it was extremely helpful.

Cheers,

Chris

-----Original Message-----
From: Filip Hanik - Dev Lists [mailto:devlists <at> hanik.com] 
Sent: Wednesday, July 13, 2011 3:47 PM
To: Tomcat Users List
Subject: Re: Tomcat Pool and XA datasource

you've misconfigured it. the driverClassName would have to be a driver.
Using XA data sources needs to create the datasource for those connections first.

There is an example towards the bottom of

http://www.tomcatexpert.com/blog/2010/04/01/configuring-jdbc-pool-high-concurrency

Filip

On 7/12/2011 6:27 AM, Siemback, Chris wrote:
> Hello all,
>
> Has anyone ever been able to successfully setup an Oracle XA datasource using the newer Tomcat Pool and
running Tomcat 7?  It appears the Tomcat Pool is attempting to cast the oracle XA data source to a
java.sql.Driver - which it isn't.  This needs to be an XA datasource.  Anyone have luck with this - no working
examples that I can find?  Here's the versions/info/error:
(Continue reading)


Gmane