Thank you for your feedbacks.

I had actually already tried a configuration with a "url" parameter. With
this configuration :

  <Resource
> factory="org.apache.tomcat.jdbc.naming.GenericNamingResourcesFactory"
> name="jdbc/mydatasource-xa" password="password"
> type="oracle.jdbc.xa.client.OracleXADataSource" user="userName"
> url="jdbc:oracle:thin:@myHost:1522:myDataBase" />
>


>   <Resource abandonWhenPercentageFull="50" auth="Container"
> dataSourceJNDI="mydatasource-xa"
> factory="org.apache.tomcat.jdbc.pool.DataSourceFactory" initialSize="5"
> jdbcInterceptors="ResetAbandonedTimer" logAbandoned="true" maxActive="20"
> maxAge="0" maxIdle="10" maxWait="0" minEvictableIdleTimeMillis="120000"
> minIdle="5" name="jdbc/mydatasource" removeAbandoned="true"
> removeAbandonedTimeout="600" testOnBorrow="true"
> timeBetweenEvictionRunsMillis="30000" type="javax.sql.XADataSource"
> validationInterval="30000" validationQuery="select 1 from dual" />


I have the following exception :

2014-08-29 12:11:40,151 [default-startStop-1] WARN
>  org.apache.naming.NamingContext- Unexpected exception resolving reference
> java.sql.SQLException: Invalid Oracle URL specified:
> OracleDataSource.makeURL
> at oracle.jdbc.pool.OracleDataSource.makeURL(OracleDataSource.java:1277)
>  at oracle.jdbc.pool.OracleDataSource.getURL(OracleDataSource.java:1025)
> at
> oracle.jdbc.xa.client.OracleXADataSource.getPooledConnection(OracleXADataSource.java:205)
>  at
> oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:156)
> at
> oracle.jdbc.xa.client.OracleXADataSource.getXAConnection(OracleXADataSource.java:101)
>  at
> org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDataSource(PooledConnection.java:218)
> at
> org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:180)
>  at
> org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:701)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:635)
>  at
> org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:486)
> at
> org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:144)
>  at
> org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:116)
> at
> org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:103)
>  at
> org.apache.tomcat.jdbc.pool.DataSourceFactory.createDataSource(DataSourceFactory.java:554)
> at
> org.apache.tomcat.jdbc.pool.DataSourceFactory.getObjectInstance(DataSourceFactory.java:242)
>  at
> org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:141)


The configuration described in Tomcat Expert is really special, i start
wondering if it is specific to Derby or not.

Do you think we have to define two different ressources (one to describe a
connection and one to set a pool)  when you want to use a XA datasource
with Oracle ?

Regards.
Sylvain


On Wed, Aug 27, 2014 at 2:03 PM, Stefan Mayr <ste...@mayr-stefan.de> wrote:

> Am 27.08.2014 11:05, schrieb Sylvain Goulmy:
>
>  Hi all,
>>
>> I'm trying to setup a XA Datasource configuration in Tomcat 7 with an
>> Oracle database.
>>
>> I have spent a long time trying to set that configuration up without any
>> success.
>>
>> I have read the  following blog entry which is i think the only ressource
>> that deals with this subject :
>>
>> http://www.tomcatexpert.com/blog/2010/04/01/configuring-
>> jdbc-pool-high-concurrency
>>
>> with the "Pooling connections from other data sources" paragraph.
>>
>> Here is the configuration i have done in my context.xml file :
>>
>>    <Resource
>>
>>> factory="org.apache.tomcat.jdbc.naming.GenericNamingResourcesFactory"
>>> name="jdbc/mydatasource-xa" password="password"
>>> type="oracle.jdbc.xa.client.OracleXADataSource" user="userName"
>>> databaseName="databaseName" serverName="myDatabaseHost"
>>> portNumber="1522" />
>>>
>>>  ...
>
>  and here is the exception i have when the application starts :
>>
>> 2014-08-27 08:25:49,748 [default-startStop-1] ERROR
>>
>>> org.apache.tomcat.jdbc.pool.ConnectionPool- Unable to create initial
>>> connections of pool.
>>> java.sql.SQLException: Invalid Oracle URL specified:
>>> OracleDataSource.makeURL
>>>   at oracle.jdbc.pool.OracleDataSource.makeURL(
>>> OracleDataSource.java:1277)
>>> at oracle.jdbc.pool.OracleDataSource.getURL(OracleDataSource.java:1025)
>>>
>>
> The JDBC-Driver cannot create the JDBC-URL from these parameters: use url
> instead of serverName, databaseName, portNumber e.g.
> url="jdbc:oracle:thin:@myhost:1521/orcl or add a driverType, e.g.
> driverType="thin"
>
> see http://www.orafaq.com/wiki/JDBC for URLs and
> http://docs.oracle.com/cd/E18283_01/appdev.112/e13995/oracle/jdbc/pool/
> OracleDataSource.html for the possible parameters and default values.
>
> Regards,
>
>         Stefan
>
> --
> Mayr Stefan
>
> Hausen - Gassenaecker 10
> 82269 Geltendorf
>
> Tel.: 08193 - 9979469
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

Reply via email to