2014-08-27 13:05 GMT+04:00 Sylvain Goulmy <sygou...@gmail.com>:
> 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" />
>>
>
>
>>   <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" />
>
>
> 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 example at that 3rd-party site  uses Apache Derby datasource implementation,
org.apache.derby.jdbc.ClientXADataSource.

The databaseName, serverName properties apparently are properties of
that datasource implementation. I expect that the class has setters
like org.apache.derby.jdbc.ClientXADataSource.setServerName(String).

You are using Oracle datasource class.
Good news are that exception actually originates from "oracle.jdbc.xa.client.
OracleXADataSource" class, so the resource definition works.

Bad news are that apparently it needs some different configuration
properties such as URL to your server.

Best regards,
Konstantin Kolinko

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to