tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Àlex Soto <asot...@gmail.com>
Subject Re: XA datasource in tomee.xml
Date Mon, 21 Jul 2014 16:45:24 GMT
Well I have copied the resource from Trevor and got the configuration from issue don't know
if It is Ok for Trevor to use dbcp.
@trevor Can you try with dbcp instead of dbcp-alternative?

Enviat des del meu iPhone

El 21/07/2014, a les 18.00, Romain Manni-Bucau <rmannibucau@gmail.com> va escriure:
> @Alex: Why not DataSourceCreator = dbcp?
> 
> 
> 
> Romain Manni-Bucau
> Twitter: @rmannibucau
> Blog: http://rmannibucau.wordpress.com/
> LinkedIn: http://fr.linkedin.com/in/rmannibucau
> Github: https://github.com/rmannibucau
> 
> 
> 2014-07-21 17:57 GMT+02:00 Trevor Stevens <tstevens@me.com>:
> 
>> Hmm, well I assumed that this would work but it failed with exceptions at
>> startup.
>> 
>> Caused by: java.lang.ClassCastException: Cannot cast
>> org.apache.openejb.resource.jdbc.managed.xa.ManagedXADataSource to
>> javax.sql.XADataSource
>> 
>>  <Resource id="test" type="DataSource">
>>    XaDataSource testxa
>>    DataSourceCreator dbcp-alternative
>>  </Resource>
>> 
>>  <Resource id="testax" type="DataSource">
>>      JdbcDriver com.mysql.jdbc.jdbc2.optional.MysqlXADataSource
>>      JdbcUrl jdbc:mysql://localhost/testdb?autoReconnect=true
>>      UserName test
>>      Password test
>>      JtaManaged true
>>  </Resource>
>> 
>> 
>> Trevor Stevenststevens@me.com
>> 
>> 
>> On Jul 21, 2014, at 10:59 AM, Alex Soto <asotobu@gmail.com> wrote:
>> 
>> It seems that this approach TOMEE-1169 only works for TomEE 1.7.0.
>> 
>> If you want to use tomee.xml approach you may need to translate system
>> properties to tomee.xml, so for example:
>> 
>> setProperty("db1XA", "new://Resource?type=DataSource");
>> setProperty("db1XA.XaDataSource", "db1XAUnderlying");
>> setProperty("db1XA.DataSourceCreator", "dbcp-alternative"
>> 
>> 
>> Needs to be translated to:
>> 
>> <tomee      >
>> <Resource id="db1XA" type="DataSource"      >
>> XaDataSource db1XAunderlying
>> DataSourceCreator dbcp-alternative
>> </Resource      >
>> 
>> Here there is an answer of Romain about this topic
>> 
>> http://tomee-openejb.979440.n4.nabble.com/Is-Tomee-not-support-XADataSource-td4642705.html
>> 
>> Don't know if it helps you :)
>> 
>> 
>> 
>> 2014-07-21 16:47 GMT+02:00 Trevor Stevens <tstevens@me.com      >:
>> 
>>> What is the correct syntax to create an XA datasource within
>> tomee.xml? I
>>> have tried to follow the advice on some previous mailing list
>> posts and
>>> also using the changes introduced in
>>> https://issues.apache.org/jira/browse/TOMEE-1169 without luck.
>>> 
>>> Trevor Stevenststevens@me.com
>> 
>> 
>> --
>> +----------------------------------------------------------+
>> Alex Soto Bueno - Computer Engineer
>> www.lordofthejars.com
>> +----------------------------------------------------------+
>> 
>> 

Mime
View raw message