You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by gilbertoca <gi...@gmail.com> on 2016/04/01 20:38:59 UTC

org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Hi, all!

I'm working on a Java EE 7 project(state government) and in this stage
looking for the so called "Instant Developer Experience" [1] and learning at
the same time using javaee7-samples repository in the github[2]. Fortunately
I've found the tomee-embedded-maven-plugin and with help of Romain
Manni-Bucau [3] I've made a good progress on it. Until now I was working
with h2 database with this config - web.xml:
[code]
    <data-source>
        <name>gaceDataSource</name>
        <class-name>org.h2.jdbcx.JdbcDataSource</class-name>
        <url>jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1</url>
        <user>gace_user</user>
        <password>gace_user</password>
        <transactional>true</transactional>
        <isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
        <initial-pool-size>2</initial-pool-size>
        <max-pool-size>10</max-pool-size>
        <min-pool-size>5</min-pool-size>
        <max-statements>0</max-statements>
    </data-source>  
[/code]

But our production database is a PostgreSQL server (9.4). So, configuring
the data-source element in the web.xml for it we the exception mentioned in
the title:

[code]
    <data-source>
        <name>gaceDataSource</name>
        <class-name>org.postgresql.xa.PGXADataSource</class-name>
        <url>jdbc:postgresql://srv-banco-new:5433/teste</url>
        <user>gace_user</user>
        <password>gace_user</password>
        <transactional>true</transactional>
        <isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
        <initial-pool-size>2</initial-pool-size>
        <max-pool-size>10</max-pool-size>
        <min-pool-size>5</min-pool-size>
        <max-statements>0</max-statements>
    </data-source>    
[/code]

The full tomee log is here:
https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
Is anyone having the same problem? Is there any compatibility issue with the
topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
discussion help a little[4]. 

Regards

PS.: the app deploy smoothly in wildfly, glassfish and payara.


[1] http://opk.sourceforge.net/instant_developer_experience.html
[2]
https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
[3]
https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
[4] http://stackoverflow.com/q/2279913/269514



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2016-04-05 16:06 GMT+02:00 gilbertoca <gi...@gmail.com>:
> Romain Manni-Bucau wrote
>> Hello
>>
>> this is a bug, we only support DataSource (mainly cause it brings a
>> good pooling compare to native (xa)datasource)
>>
>> => https://issues.apache.org/jira/browse/TOMEE-1767
>
> Thank you. I will build it locally(until the M4 release) and try.
> Other thing that is strange: it creates a data-source (using the internal
> hsqldb) even if the data-source name is not the default one. If something
> happens, for example it doesn't find the h2/postgres driver, it continues
> loading and creates a data-source and link to my one, this way hiding the
> problem.
>

Should dig in this particular case but normally we don't hide a
missing class or thing like that but we have auto configuration (see
next)

> By the way, what's the name of the default data-source in tomee?
>

Which one would you like? If use by injection then it works :D.
Basically we check what the application needs (means we miss in this
heuristic the datasource looked up through JNDI directly since we pick
up @Resource and JPA datasources). If there and matching we use what
you gave us otherwise we create a default one. By convention name
should be openejb:Resource/Default Managed DataSource but if not
"needed" then we don't cerate it so you can't looked it up since it is
not there.

Another good thing we have - to be complete with names - is you can
create "foo" and say that foo will be used for "bar" and "dummy" too.
It is useful to not have N pools for the application but a single one
and optimize resources.

>
>
> Romain Manni-Bucau wrote
>> 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;
>
>> gilbertoca@
>
>> &gt;:
>>> Romain Manni-Bucau wrote
>>>> Hi
>>>
>>> You again  ! Wow, thank you!
>>>
>>>
>>> Romain Manni-Bucau wrote
>>>> you need to add the property DataSourceCreator=dbcp cause default
>>>> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.
>>>
>>> Nop, doesn't make any difference with the property -
>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
>>> .
>>>
>>> Maybe I've not set it up correctly.
>>> The web.xml file -
>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
>>> .
>>>
>>>
>>> Romain Manni-Bucau wrote
>>>> Also check http://tomee.apache.org/datasource-config.html for tomee
>>>> datasource configuration for real life application configuration
>>>> (web.xml or @DataSourceDefinition doesn't define pooling if additional
>>>> properties are for the pool or the datasource and it misses some
>>>> pooling configuration like real life eviction
>>>
>>> Romain, I'm not native English and I, in advance, apologize for any
>>> offense.
>>> I don't want to offend anyone, mainly you. And the google translate is
>>> not
>>> helping much  .
>>>
>>> Are you saying that this fantastic spec feature/standard is a toy - just
>>> for
>>> test and "hello world" apps?
>>>
>>
>> For most cases yep. Said otherwise: it gives developpers the
>> responsability of production which works in some companies but most of
>> the time it is the guarantee to make it wrong.
>>
>>> I don't understand the resistance in making the Java EE more developer
>>> friendly.
>>
>> That's not exactly it, making EE dev friendly is very good, making dev
>> responsible of production depends the company so encouraging such
>> practise is IMO bad cause it is the best way to prevent ops guys to go
>> their job (of course tomee allows to change it ;))
>>
>>> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
>>> https://issues.jboss.org/browse/WFLY-2727
>>>
>>
>> AFAIK this is tested in tomee but with a normal datasource, not an XA one.
>>
>>> I hope TomEE project can change/break this way of thinking.
>>>
>>> Regards,
>>> Gilberto
>>>
>>>
>>> Romain Manni-Bucau wrote
>>>>  so you get what you can
>>>> with this API + it is in the application which is rarely what you want
>>>> to be able to move between environments or you need a custom
>>>> datasource implementation which is rarely what we want to implement
>>>> ;))
>>>>
>>>>
>>>> Romain Manni-Bucau
>>>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>>>>
>>>>
>>>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
>>>
>>>> gilbertoca@
>>>
>>>> &gt;:
>>>>> Hi, all!
>>>>>
>>>>> I'm working on a Java EE 7 project(state government) and in this stage
>>>>> looking for the so called "Instant Developer Experience" [1] and
>>>>> learning
>>>>> at
>>>>> the same time using javaee7-samples repository in the github[2].
>>>>> Fortunately
>>>>> I've found the tomee-embedded-maven-plugin and with help of Romain
>>>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
>>>>> working
>>>>> with h2 database with this config - web.xml:
>>>>> [code]
>>>>>
>>>>
>> <data-source>
>>>>>
>>>>
>> <name>
>>>> gaceDataSource
>>>>
>> </name>
>>>>>
>>>>
>> <class-name>
>>>> org.h2.jdbcx.JdbcDataSource
>>>>
>> </class-name>
>>>>>
>>>>
>> <url>
>>>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
>>>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
>>>>
>> </url>
>>>>>
>>>>
>> <user>
>>>> gace_user
>>>>
>> </user>
>>>>>
>>>>
>> <password>
>>>> gace_user
>>>>
>> </password>
>>>>>
>>>>
>> <transactional>
>>>> true
>>>>
>> </transactional>
>>>>>
>>>>
>> <isolation-level>
>>>> TRANSACTION_READ_COMMITTED
>>>>
>> </isolation-level>
>>>>>
>>>>
>> <initial-pool-size>
>>>> 2
>>>>
>> </initial-pool-size>
>>>>>
>>>>
>> <max-pool-size>
>>>> 10
>>>>
>> </max-pool-size>
>>>>>
>>>>
>> <min-pool-size>
>>>> 5
>>>>
>> </min-pool-size>
>>>>>
>>>>
>> <max-statements>
>>>> 0
>>>>
>> </max-statements>
>>>>>
>>>>
>> </data-source>
>>>>> [/code]
>>>>>
>>>>> But our production database is a PostgreSQL server (9.4). So,
>>>>> configuring
>>>>> the data-source element in the web.xml for it we the exception
>>>>> mentioned
>>>>> in
>>>>> the title:
>>>>>
>>>>> [code]
>>>>>
>>>>
>> <data-source>
>>>>>
>>>>
>> <name>
>>>> gaceDataSource
>>>>
>> </name>
>>>>>
>>>>
>> <class-name>
>>>> org.postgresql.xa.PGXADataSource
>>>>
>> </class-name>
>>>>>
>>>>
>> <url>
>>>> jdbc:postgresql://srv-banco-new:5433/teste
>>>>
>> </url>
>>>>>
>>>>
>> <user>
>>>> gace_user
>>>>
>> </user>
>>>>>
>>>>
>> <password>
>>>> gace_user
>>>>
>> </password>
>>>>>
>>>>
>> <transactional>
>>>> true
>>>>
>> </transactional>
>>>>>
>>>>
>> <isolation-level>
>>>> TRANSACTION_READ_COMMITTED
>>>>
>> </isolation-level>
>>>>>
>>>>
>> <initial-pool-size>
>>>> 2
>>>>
>> </initial-pool-size>
>>>>>
>>>>
>> <max-pool-size>
>>>> 10
>>>>
>> </max-pool-size>
>>>>>
>>>>
>> <min-pool-size>
>>>> 5
>>>>
>> </min-pool-size>
>>>>>
>>>>
>> <max-statements>
>>>> 0
>>>>
>> </max-statements>
>>>>>
>>>>
>> </data-source>
>>>>> [/code]
>>>>>
>>>>> The full tomee log is here:
>>>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
>>>>> Is anyone having the same problem? Is there any compatibility issue
>>>>> with
>>>>> the
>>>>> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
>>>>> discussion help a little[4].
>>>>>
>>>>> Regards
>>>>>
>>>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>>>>>
>>>>>
>>>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
>>>>> [2]
>>>>> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
>>>>> [3]
>>>>> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
>>>>> [4] http://stackoverflow.com/q/2279913/269514
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
>>>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>
>
> Romain Manni-Bucau wrote
>> Hello
>>
>> this is a bug, we only support DataSource (mainly cause it brings a
>> good pooling compare to native (xa)datasource)
>>
>> => https://issues.apache.org/jira/browse/TOMEE-1767
>>
>> 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;
>
>> gilbertoca@
>
>> &gt;:
>>> Romain Manni-Bucau wrote
>>>> Hi
>>>
>>> You again  ! Wow, thank you!
>>>
>>>
>>> Romain Manni-Bucau wrote
>>>> you need to add the property DataSourceCreator=dbcp cause default
>>>> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.
>>>
>>> Nop, doesn't make any difference with the property -
>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
>>> .
>>>
>>> Maybe I've not set it up correctly.
>>> The web.xml file -
>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
>>> .
>>>
>>>
>>> Romain Manni-Bucau wrote
>>>> Also check http://tomee.apache.org/datasource-config.html for tomee
>>>> datasource configuration for real life application configuration
>>>> (web.xml or @DataSourceDefinition doesn't define pooling if additional
>>>> properties are for the pool or the datasource and it misses some
>>>> pooling configuration like real life eviction
>>>
>>> Romain, I'm not native English and I, in advance, apologize for any
>>> offense.
>>> I don't want to offend anyone, mainly you. And the google translate is
>>> not
>>> helping much  .
>>>
>>> Are you saying that this fantastic spec feature/standard is a toy - just
>>> for
>>> test and "hello world" apps?
>>>
>>
>> For most cases yep. Said otherwise: it gives developpers the
>> responsability of production which works in some companies but most of
>> the time it is the guarantee to make it wrong.
>>
>>> I don't understand the resistance in making the Java EE more developer
>>> friendly.
>>
>> That's not exactly it, making EE dev friendly is very good, making dev
>> responsible of production depends the company so encouraging such
>> practise is IMO bad cause it is the best way to prevent ops guys to go
>> their job (of course tomee allows to change it ;))
>>
>>> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
>>> https://issues.jboss.org/browse/WFLY-2727
>>>
>>
>> AFAIK this is tested in tomee but with a normal datasource, not an XA one.
>>
>>> I hope TomEE project can change/break this way of thinking.
>>>
>>> Regards,
>>> Gilberto
>>>
>>>
>>> Romain Manni-Bucau wrote
>>>>  so you get what you can
>>>> with this API + it is in the application which is rarely what you want
>>>> to be able to move between environments or you need a custom
>>>> datasource implementation which is rarely what we want to implement
>>>> ;))
>>>>
>>>>
>>>> Romain Manni-Bucau
>>>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>>>>
>>>>
>>>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
>>>
>>>> gilbertoca@
>>>
>>>> &gt;:
>>>>> Hi, all!
>>>>>
>>>>> I'm working on a Java EE 7 project(state government) and in this stage
>>>>> looking for the so called "Instant Developer Experience" [1] and
>>>>> learning
>>>>> at
>>>>> the same time using javaee7-samples repository in the github[2].
>>>>> Fortunately
>>>>> I've found the tomee-embedded-maven-plugin and with help of Romain
>>>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
>>>>> working
>>>>> with h2 database with this config - web.xml:
>>>>> [code]
>>>>>
>>>>
>> <data-source>
>>>>>
>>>>
>> <name>
>>>> gaceDataSource
>>>>
>> </name>
>>>>>
>>>>
>> <class-name>
>>>> org.h2.jdbcx.JdbcDataSource
>>>>
>> </class-name>
>>>>>
>>>>
>> <url>
>>>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
>>>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
>>>>
>> </url>
>>>>>
>>>>
>> <user>
>>>> gace_user
>>>>
>> </user>
>>>>>
>>>>
>> <password>
>>>> gace_user
>>>>
>> </password>
>>>>>
>>>>
>> <transactional>
>>>> true
>>>>
>> </transactional>
>>>>>
>>>>
>> <isolation-level>
>>>> TRANSACTION_READ_COMMITTED
>>>>
>> </isolation-level>
>>>>>
>>>>
>> <initial-pool-size>
>>>> 2
>>>>
>> </initial-pool-size>
>>>>>
>>>>
>> <max-pool-size>
>>>> 10
>>>>
>> </max-pool-size>
>>>>>
>>>>
>> <min-pool-size>
>>>> 5
>>>>
>> </min-pool-size>
>>>>>
>>>>
>> <max-statements>
>>>> 0
>>>>
>> </max-statements>
>>>>>
>>>>
>> </data-source>
>>>>> [/code]
>>>>>
>>>>> But our production database is a PostgreSQL server (9.4). So,
>>>>> configuring
>>>>> the data-source element in the web.xml for it we the exception
>>>>> mentioned
>>>>> in
>>>>> the title:
>>>>>
>>>>> [code]
>>>>>
>>>>
>> <data-source>
>>>>>
>>>>
>> <name>
>>>> gaceDataSource
>>>>
>> </name>
>>>>>
>>>>
>> <class-name>
>>>> org.postgresql.xa.PGXADataSource
>>>>
>> </class-name>
>>>>>
>>>>
>> <url>
>>>> jdbc:postgresql://srv-banco-new:5433/teste
>>>>
>> </url>
>>>>>
>>>>
>> <user>
>>>> gace_user
>>>>
>> </user>
>>>>>
>>>>
>> <password>
>>>> gace_user
>>>>
>> </password>
>>>>>
>>>>
>> <transactional>
>>>> true
>>>>
>> </transactional>
>>>>>
>>>>
>> <isolation-level>
>>>> TRANSACTION_READ_COMMITTED
>>>>
>> </isolation-level>
>>>>>
>>>>
>> <initial-pool-size>
>>>> 2
>>>>
>> </initial-pool-size>
>>>>>
>>>>
>> <max-pool-size>
>>>> 10
>>>>
>> </max-pool-size>
>>>>>
>>>>
>> <min-pool-size>
>>>> 5
>>>>
>> </min-pool-size>
>>>>>
>>>>
>> <max-statements>
>>>> 0
>>>>
>> </max-statements>
>>>>>
>>>>
>> </data-source>
>>>>> [/code]
>>>>>
>>>>> The full tomee log is here:
>>>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
>>>>> Is anyone having the same problem? Is there any compatibility issue
>>>>> with
>>>>> the
>>>>> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
>>>>> discussion help a little[4].
>>>>>
>>>>> Regards
>>>>>
>>>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>>>>>
>>>>>
>>>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
>>>>> [2]
>>>>> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
>>>>> [3]
>>>>> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
>>>>> [4] http://stackoverflow.com/q/2279913/269514
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
>>>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678087.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by gilbertoca <gi...@gmail.com>.
Romain Manni-Bucau wrote
> Hello
> 
> this is a bug, we only support DataSource (mainly cause it brings a
> good pooling compare to native (xa)datasource)
> 
> => https://issues.apache.org/jira/browse/TOMEE-1767

Thank you. I will build it locally(until the M4 release) and try.
Other thing that is strange: it creates a data-source (using the internal
hsqldb) even if the data-source name is not the default one. If something
happens, for example it doesn't find the h2/postgres driver, it continues
loading and creates a data-source and link to my one, this way hiding the
problem. 

By the way, what's the name of the default data-source in tomee?



Romain Manni-Bucau wrote
> 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;

> gilbertoca@

> &gt;:
>> Romain Manni-Bucau wrote
>>> Hi
>>
>> You again  ! Wow, thank you!
>>
>>
>> Romain Manni-Bucau wrote
>>> you need to add the property DataSourceCreator=dbcp cause default
>>> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.
>>
>> Nop, doesn't make any difference with the property -
>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
>> .
>>
>> Maybe I've not set it up correctly.
>> The web.xml file -
>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
>> .
>>
>>
>> Romain Manni-Bucau wrote
>>> Also check http://tomee.apache.org/datasource-config.html for tomee
>>> datasource configuration for real life application configuration
>>> (web.xml or @DataSourceDefinition doesn't define pooling if additional
>>> properties are for the pool or the datasource and it misses some
>>> pooling configuration like real life eviction
>>
>> Romain, I'm not native English and I, in advance, apologize for any
>> offense.
>> I don't want to offend anyone, mainly you. And the google translate is
>> not
>> helping much  .
>>
>> Are you saying that this fantastic spec feature/standard is a toy - just
>> for
>> test and "hello world" apps?
>>
> 
> For most cases yep. Said otherwise: it gives developpers the
> responsability of production which works in some companies but most of
> the time it is the guarantee to make it wrong.
> 
>> I don't understand the resistance in making the Java EE more developer
>> friendly.
> 
> That's not exactly it, making EE dev friendly is very good, making dev
> responsible of production depends the company so encouraging such
> practise is IMO bad cause it is the best way to prevent ops guys to go
> their job (of course tomee allows to change it ;))
> 
>> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
>> https://issues.jboss.org/browse/WFLY-2727
>>
> 
> AFAIK this is tested in tomee but with a normal datasource, not an XA one.
> 
>> I hope TomEE project can change/break this way of thinking.
>>
>> Regards,
>> Gilberto
>>
>>
>> Romain Manni-Bucau wrote
>>>  so you get what you can
>>> with this API + it is in the application which is rarely what you want
>>> to be able to move between environments or you need a custom
>>> datasource implementation which is rarely what we want to implement
>>> ;))
>>>
>>>
>>> Romain Manni-Bucau
>>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>>>
>>>
>>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
>>
>>> gilbertoca@
>>
>>> &gt;:
>>>> Hi, all!
>>>>
>>>> I'm working on a Java EE 7 project(state government) and in this stage
>>>> looking for the so called "Instant Developer Experience" [1] and
>>>> learning
>>>> at
>>>> the same time using javaee7-samples repository in the github[2].
>>>> Fortunately
>>>> I've found the tomee-embedded-maven-plugin and with help of Romain
>>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
>>>> working
>>>> with h2 database with this config - web.xml:
>>>> [code]
>>>>
>>> 
> <data-source>
>>>>
>>> 
> <name>
>>> gaceDataSource
>>> 
> </name>
>>>>
>>> 
> <class-name>
>>> org.h2.jdbcx.JdbcDataSource
>>> 
> </class-name>
>>>>
>>> 
> <url>
>>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
>>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
>>> 
> </url>
>>>>
>>> 
> <user>
>>> gace_user
>>> 
> </user>
>>>>
>>> 
> <password>
>>> gace_user
>>> 
> </password>
>>>>
>>> 
> <transactional>
>>> true
>>> 
> </transactional>
>>>>
>>> 
> <isolation-level>
>>> TRANSACTION_READ_COMMITTED
>>> 
> </isolation-level>
>>>>
>>> 
> <initial-pool-size>
>>> 2
>>> 
> </initial-pool-size>
>>>>
>>> 
> <max-pool-size>
>>> 10
>>> 
> </max-pool-size>
>>>>
>>> 
> <min-pool-size>
>>> 5
>>> 
> </min-pool-size>
>>>>
>>> 
> <max-statements>
>>> 0
>>> 
> </max-statements>
>>>>
>>> 
> </data-source>
>>>> [/code]
>>>>
>>>> But our production database is a PostgreSQL server (9.4). So,
>>>> configuring
>>>> the data-source element in the web.xml for it we the exception
>>>> mentioned
>>>> in
>>>> the title:
>>>>
>>>> [code]
>>>>
>>> 
> <data-source>
>>>>
>>> 
> <name>
>>> gaceDataSource
>>> 
> </name>
>>>>
>>> 
> <class-name>
>>> org.postgresql.xa.PGXADataSource
>>> 
> </class-name>
>>>>
>>> 
> <url>
>>> jdbc:postgresql://srv-banco-new:5433/teste
>>> 
> </url>
>>>>
>>> 
> <user>
>>> gace_user
>>> 
> </user>
>>>>
>>> 
> <password>
>>> gace_user
>>> 
> </password>
>>>>
>>> 
> <transactional>
>>> true
>>> 
> </transactional>
>>>>
>>> 
> <isolation-level>
>>> TRANSACTION_READ_COMMITTED
>>> 
> </isolation-level>
>>>>
>>> 
> <initial-pool-size>
>>> 2
>>> 
> </initial-pool-size>
>>>>
>>> 
> <max-pool-size>
>>> 10
>>> 
> </max-pool-size>
>>>>
>>> 
> <min-pool-size>
>>> 5
>>> 
> </min-pool-size>
>>>>
>>> 
> <max-statements>
>>> 0
>>> 
> </max-statements>
>>>>
>>> 
> </data-source>
>>>> [/code]
>>>>
>>>> The full tomee log is here:
>>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
>>>> Is anyone having the same problem? Is there any compatibility issue
>>>> with
>>>> the
>>>> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
>>>> discussion help a little[4].
>>>>
>>>> Regards
>>>>
>>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>>>>
>>>>
>>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
>>>> [2]
>>>> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
>>>> [3]
>>>> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
>>>> [4] http://stackoverflow.com/q/2279913/269514
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
>>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.


Romain Manni-Bucau wrote
> Hello
> 
> this is a bug, we only support DataSource (mainly cause it brings a
> good pooling compare to native (xa)datasource)
> 
> => https://issues.apache.org/jira/browse/TOMEE-1767
> 
> 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;

> gilbertoca@

> &gt;:
>> Romain Manni-Bucau wrote
>>> Hi
>>
>> You again  ! Wow, thank you!
>>
>>
>> Romain Manni-Bucau wrote
>>> you need to add the property DataSourceCreator=dbcp cause default
>>> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.
>>
>> Nop, doesn't make any difference with the property -
>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
>> .
>>
>> Maybe I've not set it up correctly.
>> The web.xml file -
>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
>> .
>>
>>
>> Romain Manni-Bucau wrote
>>> Also check http://tomee.apache.org/datasource-config.html for tomee
>>> datasource configuration for real life application configuration
>>> (web.xml or @DataSourceDefinition doesn't define pooling if additional
>>> properties are for the pool or the datasource and it misses some
>>> pooling configuration like real life eviction
>>
>> Romain, I'm not native English and I, in advance, apologize for any
>> offense.
>> I don't want to offend anyone, mainly you. And the google translate is
>> not
>> helping much  .
>>
>> Are you saying that this fantastic spec feature/standard is a toy - just
>> for
>> test and "hello world" apps?
>>
> 
> For most cases yep. Said otherwise: it gives developpers the
> responsability of production which works in some companies but most of
> the time it is the guarantee to make it wrong.
> 
>> I don't understand the resistance in making the Java EE more developer
>> friendly.
> 
> That's not exactly it, making EE dev friendly is very good, making dev
> responsible of production depends the company so encouraging such
> practise is IMO bad cause it is the best way to prevent ops guys to go
> their job (of course tomee allows to change it ;))
> 
>> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
>> https://issues.jboss.org/browse/WFLY-2727
>>
> 
> AFAIK this is tested in tomee but with a normal datasource, not an XA one.
> 
>> I hope TomEE project can change/break this way of thinking.
>>
>> Regards,
>> Gilberto
>>
>>
>> Romain Manni-Bucau wrote
>>>  so you get what you can
>>> with this API + it is in the application which is rarely what you want
>>> to be able to move between environments or you need a custom
>>> datasource implementation which is rarely what we want to implement
>>> ;))
>>>
>>>
>>> Romain Manni-Bucau
>>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>>>
>>>
>>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
>>
>>> gilbertoca@
>>
>>> &gt;:
>>>> Hi, all!
>>>>
>>>> I'm working on a Java EE 7 project(state government) and in this stage
>>>> looking for the so called "Instant Developer Experience" [1] and
>>>> learning
>>>> at
>>>> the same time using javaee7-samples repository in the github[2].
>>>> Fortunately
>>>> I've found the tomee-embedded-maven-plugin and with help of Romain
>>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
>>>> working
>>>> with h2 database with this config - web.xml:
>>>> [code]
>>>>
>>> 
> <data-source>
>>>>
>>> 
> <name>
>>> gaceDataSource
>>> 
> </name>
>>>>
>>> 
> <class-name>
>>> org.h2.jdbcx.JdbcDataSource
>>> 
> </class-name>
>>>>
>>> 
> <url>
>>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
>>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
>>> 
> </url>
>>>>
>>> 
> <user>
>>> gace_user
>>> 
> </user>
>>>>
>>> 
> <password>
>>> gace_user
>>> 
> </password>
>>>>
>>> 
> <transactional>
>>> true
>>> 
> </transactional>
>>>>
>>> 
> <isolation-level>
>>> TRANSACTION_READ_COMMITTED
>>> 
> </isolation-level>
>>>>
>>> 
> <initial-pool-size>
>>> 2
>>> 
> </initial-pool-size>
>>>>
>>> 
> <max-pool-size>
>>> 10
>>> 
> </max-pool-size>
>>>>
>>> 
> <min-pool-size>
>>> 5
>>> 
> </min-pool-size>
>>>>
>>> 
> <max-statements>
>>> 0
>>> 
> </max-statements>
>>>>
>>> 
> </data-source>
>>>> [/code]
>>>>
>>>> But our production database is a PostgreSQL server (9.4). So,
>>>> configuring
>>>> the data-source element in the web.xml for it we the exception
>>>> mentioned
>>>> in
>>>> the title:
>>>>
>>>> [code]
>>>>
>>> 
> <data-source>
>>>>
>>> 
> <name>
>>> gaceDataSource
>>> 
> </name>
>>>>
>>> 
> <class-name>
>>> org.postgresql.xa.PGXADataSource
>>> 
> </class-name>
>>>>
>>> 
> <url>
>>> jdbc:postgresql://srv-banco-new:5433/teste
>>> 
> </url>
>>>>
>>> 
> <user>
>>> gace_user
>>> 
> </user>
>>>>
>>> 
> <password>
>>> gace_user
>>> 
> </password>
>>>>
>>> 
> <transactional>
>>> true
>>> 
> </transactional>
>>>>
>>> 
> <isolation-level>
>>> TRANSACTION_READ_COMMITTED
>>> 
> </isolation-level>
>>>>
>>> 
> <initial-pool-size>
>>> 2
>>> 
> </initial-pool-size>
>>>>
>>> 
> <max-pool-size>
>>> 10
>>> 
> </max-pool-size>
>>>>
>>> 
> <min-pool-size>
>>> 5
>>> 
> </min-pool-size>
>>>>
>>> 
> <max-statements>
>>> 0
>>> 
> </max-statements>
>>>>
>>> 
> </data-source>
>>>> [/code]
>>>>
>>>> The full tomee log is here:
>>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
>>>> Is anyone having the same problem? Is there any compatibility issue
>>>> with
>>>> the
>>>> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
>>>> discussion help a little[4].
>>>>
>>>> Regards
>>>>
>>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>>>>
>>>>
>>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
>>>> [2]
>>>> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
>>>> [3]
>>>> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
>>>> [4] http://stackoverflow.com/q/2279913/269514
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
>>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678087.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Answering quickly (so excuse the lack of details) to try to give few hints:

- looks like a setXXX on pg directly which is invalid
- maybe check SkipXXX variable on the resource to avoid to inherit from
some defaults which can pollute the resource creation
- ensure there is no conflicts between pool setXXX and pg setXXX (yep the
datasource config design is awesome isn't it? :D)

What you can do is to wrap the datasource and define some unconflictable
properties in your wrapper (setGilbertXXX(xxx) for instance ;)).




Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-04-15 14:58 GMT+02:00 gilbertoca <gi...@gmail.com>:

> Romain Manni-Bucau wrote
> > Hello
> >
> > this is a bug, we only support DataSource (mainly cause it brings a
> > good pooling compare to native (xa)datasource)
> >
> > => https://issues.apache.org/jira/browse/TOMEE-1767
>
> Hi, just a following up on this topic.
> I've tested it with latest build - working without the need of
> DataSourceCreator property, very good work.
> But, changing the config using server, port and database name elements
> breaks the patch. You can see the log here
>
> https://gist.github.com/gilbertoca/1a593dbb72ae6e82966c20ad77995b1b#file-tomee-embedded-log
> the web.xml used is just below the code in the comment.
>
> Thank you again.
>
>
> Romain Manni-Bucau wrote
> > 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;
>
> > gilbertoca@
>
> > &gt;:
> >> Romain Manni-Bucau wrote
> >>> Hi
> >>
> >> You again  ! Wow, thank you!
> >>
> >>
> >> Romain Manni-Bucau wrote
> >>> you need to add the property DataSourceCreator=dbcp cause default
> >>> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.
> >>
> >> Nop, doesn't make any difference with the property -
> >>
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
> >> .
> >>
> >> Maybe I've not set it up correctly.
> >> The web.xml file -
> >>
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
> >> .
> >>
> >>
> >> Romain Manni-Bucau wrote
> >>> Also check http://tomee.apache.org/datasource-config.html for tomee
> >>> datasource configuration for real life application configuration
> >>> (web.xml or @DataSourceDefinition doesn't define pooling if additional
> >>> properties are for the pool or the datasource and it misses some
> >>> pooling configuration like real life eviction
> >>
> >> Romain, I'm not native English and I, in advance, apologize for any
> >> offense.
> >> I don't want to offend anyone, mainly you. And the google translate is
> >> not
> >> helping much  .
> >>
> >> Are you saying that this fantastic spec feature/standard is a toy - just
> >> for
> >> test and "hello world" apps?
> >>
> >
> > For most cases yep. Said otherwise: it gives developpers the
> > responsability of production which works in some companies but most of
> > the time it is the guarantee to make it wrong.
> >
> >> I don't understand the resistance in making the Java EE more developer
> >> friendly.
> >
> > That's not exactly it, making EE dev friendly is very good, making dev
> > responsible of production depends the company so encouraging such
> > practise is IMO bad cause it is the best way to prevent ops guys to go
> > their job (of course tomee allows to change it ;))
> >
> >> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
> >> https://issues.jboss.org/browse/WFLY-2727
> >>
> >
> > AFAIK this is tested in tomee but with a normal datasource, not an XA
> one.
> >
> >> I hope TomEE project can change/break this way of thinking.
> >>
> >> Regards,
> >> Gilberto
> >>
> >>
> >> Romain Manni-Bucau wrote
> >>>  so you get what you can
> >>> with this API + it is in the application which is rarely what you want
> >>> to be able to move between environments or you need a custom
> >>> datasource implementation which is rarely what we want to implement
> >>> ;))
> >>>
> >>>
> >>> Romain Manni-Bucau
> >>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
> >>>
> >>>
> >>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
> >>
> >>> gilbertoca@
> >>
> >>> &gt;:
> >>>> Hi, all!
> >>>>
> >>>> I'm working on a Java EE 7 project(state government) and in this stage
> >>>> looking for the so called "Instant Developer Experience" [1] and
> >>>> learning
> >>>> at
> >>>> the same time using javaee7-samples repository in the github[2].
> >>>> Fortunately
> >>>> I've found the tomee-embedded-maven-plugin and with help of Romain
> >>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
> >>>> working
> >>>> with h2 database with this config - web.xml:
> >>>> [code]
> >>>>
> >>>
> > <data-source>
> >>>>
> >>>
> > <name>
> >>> gaceDataSource
> >>>
> > </name>
> >>>>
> >>>
> > <class-name>
> >>> org.h2.jdbcx.JdbcDataSource
> >>>
> > </class-name>
> >>>>
> >>>
> > <url>
> >>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
> >>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
> >>>
> > </url>
> >>>>
> >>>
> > <user>
> >>> gace_user
> >>>
> > </user>
> >>>>
> >>>
> > <password>
> >>> gace_user
> >>>
> > </password>
> >>>>
> >>>
> > <transactional>
> >>> true
> >>>
> > </transactional>
> >>>>
> >>>
> > <isolation-level>
> >>> TRANSACTION_READ_COMMITTED
> >>>
> > </isolation-level>
> >>>>
> >>>
> > <initial-pool-size>
> >>> 2
> >>>
> > </initial-pool-size>
> >>>>
> >>>
> > <max-pool-size>
> >>> 10
> >>>
> > </max-pool-size>
> >>>>
> >>>
> > <min-pool-size>
> >>> 5
> >>>
> > </min-pool-size>
> >>>>
> >>>
> > <max-statements>
> >>> 0
> >>>
> > </max-statements>
> >>>>
> >>>
> > </data-source>
> >>>> [/code]
> >>>>
> >>>> But our production database is a PostgreSQL server (9.4). So,
> >>>> configuring
> >>>> the data-source element in the web.xml for it we the exception
> >>>> mentioned
> >>>> in
> >>>> the title:
> >>>>
> >>>> [code]
> >>>>
> >>>
> > <data-source>
> >>>>
> >>>
> > <name>
> >>> gaceDataSource
> >>>
> > </name>
> >>>>
> >>>
> > <class-name>
> >>> org.postgresql.xa.PGXADataSource
> >>>
> > </class-name>
> >>>>
> >>>
> > <url>
> >>> jdbc:postgresql://srv-banco-new:5433/teste
> >>>
> > </url>
> >>>>
> >>>
> > <user>
> >>> gace_user
> >>>
> > </user>
> >>>>
> >>>
> > <password>
> >>> gace_user
> >>>
> > </password>
> >>>>
> >>>
> > <transactional>
> >>> true
> >>>
> > </transactional>
> >>>>
> >>>
> > <isolation-level>
> >>> TRANSACTION_READ_COMMITTED
> >>>
> > </isolation-level>
> >>>>
> >>>
> > <initial-pool-size>
> >>> 2
> >>>
> > </initial-pool-size>
> >>>>
> >>>
> > <max-pool-size>
> >>> 10
> >>>
> > </max-pool-size>
> >>>>
> >>>
> > <min-pool-size>
> >>> 5
> >>>
> > </min-pool-size>
> >>>>
> >>>
> > <max-statements>
> >>> 0
> >>>
> > </max-statements>
> >>>>
> >>>
> > </data-source>
> >>>> [/code]
> >>>>
> >>>> The full tomee log is here:
> >>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
> >>>> Is anyone having the same problem? Is there any compatibility issue
> >>>> with
> >>>> the
> >>>> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
> >>>> discussion help a little[4].
> >>>>
> >>>> Regards
> >>>>
> >>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
> >>>>
> >>>>
> >>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
> >>>> [2]
> >>>>
> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
> >>>> [3]
> >>>>
> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
> >>>> [4] http://stackoverflow.com/q/2279913/269514
> >>>>
> >>>>
> >>>>
> >>>> --
> >>>> View this message in context:
> >>>>
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
> >>>> Sent from the TomEE Users mailing list archive at Nabble.com.
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
> >> Sent from the TomEE Users mailing list archive at Nabble.com.
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678157.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by Romain Manni-Bucau <rm...@gmail.com>.
2016-04-15 15:52 GMT+02:00 gilbertoca <gi...@gmail.com>:

> Romain Manni-Bucau wrote
> > looks like my comments are still relevant ;). guess some values are not
> > correctly set going to the datasource.
>
> I know, that's the issue I'm reporting.
>
>
> Romain Manni-Bucau wrote
> > I would encourage you to ensure
> > password is propagated as expected on the datasource.
>
> I've just set it up in the web.xml - the only place I config the
> data-source. I don't understand what I can do to ensure
> password is propagated since this is a TomEE's server role.
>
>
Did you check the value which was actually set? TomEE passthrough the
values so if the setter is not setPassword you need to use properties to
set the password (if setPwd then use pwd=xxx in properties).


>
> Romain Manni-Bucau wrote
> > Romain Manni-Bucau
> > @rmannibucau &lt;https://twitter.com/rmannibucau&gt; |  Blog
> > &lt;http://rmannibucau.wordpress.com&gt; | Github
> > &lt;https://github.com/rmannibucau&gt; |
> > LinkedIn &lt;https://www.linkedin.com/in/rmannibucau&gt; | Tomitriber
> > &lt;http://www.tomitribe.com&gt; | JavaEE Factory
> > &lt;https://javaeefactory-rmannibucau.rhcloud.com&gt;
> >
> > 2016-04-15 15:19 GMT+02:00 gilbertoca &lt;
>
> > gilbertoca@
>
> > &gt;:
> >
> >> Sorry, but made a mistake: did the test using org.postgresql.Driver and
> >> not
> >> the DataSource one.
> >> Using the XA DataSource, using url I get this error
> >>
> >>
> https://gist.github.com/gilbertoca/08222891c14ce6363af0b8a4c451d8d2#file-xa-data-source-url
> >> .
> >> And using using server, port and database name elements I get this one
> >>
> >>
> https://gist.github.com/gilbertoca/8492b3af9009f822eac7ded7e66935d5#file-xa-data-source-server-port-and-database-name
> >> .
> >>
> >> Sorry again
> >>
> >>
> >> gilbertoca wrote
> >> >
> >> > Romain Manni-Bucau wrote
> >> >> Hello
> >> >>
> >> >> this is a bug, we only support DataSource (mainly cause it brings a
> >> >> good pooling compare to native (xa)datasource)
> >> >>
> >> >> => https://issues.apache.org/jira/browse/TOMEE-1767
> >> > Hi, just a following up on this topic.
> >> > I've tested it with latest build - working without the need of
> >> > DataSourceCreator property, very good work.
> >> > But, changing the config using server, port and database name elements
> >> > breaks the patch. You can see the log here
> >> >
> >>
> https://gist.github.com/gilbertoca/1a593dbb72ae6e82966c20ad77995b1b#file-tomee-embedded-log
> >> > the web.xml used is just below the code in the comment.
> >> >
> >> > Thank you again.
> >> > Romain Manni-Bucau wrote
> >> >> 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;
> >>
> >> >> gilbertoca@
> >>
> >> >> &gt;:
> >> >>> Romain Manni-Bucau wrote
> >> >>>> Hi
> >> >>>
> >> >>> You again  ! Wow, thank you!
> >> >>>
> >> >>>
> >> >>> Romain Manni-Bucau wrote
> >> >>>> you need to add the property DataSourceCreator=dbcp cause default
> >> >>>> pooling (tomcat to be aligned on tomcat backbone) doesn't support
> >> it.
> >> >>>
> >> >>> Nop, doesn't make any difference with the property -
> >> >>>
> >>
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
> >> >>> .
> >> >>>
> >> >>> Maybe I've not set it up correctly.
> >> >>> The web.xml file -
> >> >>>
> >>
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
> >> >>> .
> >> >>>
> >> >>>
> >> >>> Romain Manni-Bucau wrote
> >> >>>> Also check http://tomee.apache.org/datasource-config.html for
> tomee
> >> >>>> datasource configuration for real life application configuration
> >> >>>> (web.xml or @DataSourceDefinition doesn't define pooling if
> >> additional
> >> >>>> properties are for the pool or the datasource and it misses some
> >> >>>> pooling configuration like real life eviction
> >> >>>
> >> >>> Romain, I'm not native English and I, in advance, apologize for any
> >> >>> offense.
> >> >>> I don't want to offend anyone, mainly you. And the google translate
> >> is
> >> >>> not
> >> >>> helping much  .
> >> >>>
> >> >>> Are you saying that this fantastic spec feature/standard is a toy -
> >> just
> >> >>> for
> >> >>> test and "hello world" apps?
> >> >>>
> >> >>
> >> >> For most cases yep. Said otherwise: it gives developpers the
> >> >> responsability of production which works in some companies but most
> of
> >> >> the time it is the guarantee to make it wrong.
> >> >>
> >> >>> I don't understand the resistance in making the Java EE more
> >> developer
> >> >>> friendly.
> >> >>
> >> >> That's not exactly it, making EE dev friendly is very good, making
> dev
> >> >> responsible of production depends the company so encouraging such
> >> >> practise is IMO bad cause it is the best way to prevent ops guys to
> go
> >> >> their job (of course tomee allows to change it ;))
> >> >>
> >> >>> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
> >> >>> https://issues.jboss.org/browse/WFLY-2727
> >> >>>
> >> >>
> >> >> AFAIK this is tested in tomee but with a normal datasource, not an XA
> >> >> one.
> >> >>
> >> >>> I hope TomEE project can change/break this way of thinking.
> >> >>>
> >> >>> Regards,
> >> >>> Gilberto
> >> >>>
> >> >>>
> >> >>> Romain Manni-Bucau wrote
> >> >>>>  so you get what you can
> >> >>>> with this API + it is in the application which is rarely what you
> >> want
> >> >>>> to be able to move between environments or you need a custom
> >> >>>> datasource implementation which is rarely what we want to implement
> >> >>>> ;))
> >> >>>>
> >> >>>>
> >> >>>> Romain Manni-Bucau
> >> >>>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
> >> >>>>
> >> >>>>
> >> >>>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
> >> >>>
> >> >>>> gilbertoca@
> >> >>>
> >> >>>> &gt;:
> >> >>>>> Hi, all!
> >> >>>>>
> >> >>>>> I'm working on a Java EE 7 project(state government) and in this
> >> stage
> >> >>>>> looking for the so called "Instant Developer Experience" [1] and
> >> >>>>> learning
> >> >>>>> at
> >> >>>>> the same time using javaee7-samples repository in the github[2].
> >> >>>>> Fortunately
> >> >>>>> I've found the tomee-embedded-maven-plugin and with help of Romain
> >> >>>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
> >> >>>>> working
> >> >>>>> with h2 database with this config - web.xml:
> >> >>>>> [code]
> >> >>>>>
> >> >>>>
> >> >>
> > <data-source>
> >> >>>>>
> >> >>>>
> >> >>
> > <name>
> >> >>>> gaceDataSource
> >> >>>>
> >> >>
> > </name>
> >> >>>>>
> >> >>>>
> >> >>
> > <class-name>
> >> >>>> org.h2.jdbcx.JdbcDataSource
> >> >>>>
> >> >>
> > </class-name>
> >> >>>>>
> >> >>>>
> >> >>
> > <url>
> >> >>>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
> >> >>>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
> >> >>>>
> >> >>
> > </url>
> >> >>>>>
> >> >>>>
> >> >>
> > <user>
> >> >>>> gace_user
> >> >>>>
> >> >>
> > </user>
> >> >>>>>
> >> >>>>
> >> >>
> > <password>
> >> >>>> gace_user
> >> >>>>
> >> >>
> > </password>
> >> >>>>>
> >> >>>>
> >> >>
> > <transactional>
> >> >>>> true
> >> >>>>
> >> >>
> > </transactional>
> >> >>>>>
> >> >>>>
> >> >>
> > <isolation-level>
> >> >>>> TRANSACTION_READ_COMMITTED
> >> >>>>
> >> >>
> > </isolation-level>
> >> >>>>>
> >> >>>>
> >> >>
> > <initial-pool-size>
> >> >>>> 2
> >> >>>>
> >> >>
> > </initial-pool-size>
> >> >>>>>
> >> >>>>
> >> >>
> > <max-pool-size>
> >> >>>> 10
> >> >>>>
> >> >>
> > </max-pool-size>
> >> >>>>>
> >> >>>>
> >> >>
> > <min-pool-size>
> >> >>>> 5
> >> >>>>
> >> >>
> > </min-pool-size>
> >> >>>>>
> >> >>>>
> >> >>
> > <max-statements>
> >> >>>> 0
> >> >>>>
> >> >>
> > </max-statements>
> >> >>>>>
> >> >>>>
> >> >>
> > </data-source>
> >> >>>>> [/code]
> >> >>>>>
> >> >>>>> But our production database is a PostgreSQL server (9.4). So,
> >> >>>>> configuring
> >> >>>>> the data-source element in the web.xml for it we the exception
> >> >>>>> mentioned
> >> >>>>> in
> >> >>>>> the title:
> >> >>>>>
> >> >>>>> [code]
> >> >>>>>
> >> >>>>
> >> >>
> > <data-source>
> >> >>>>>
> >> >>>>
> >> >>
> > <name>
> >> >>>> gaceDataSource
> >> >>>>
> >> >>
> > </name>
> >> >>>>>
> >> >>>>
> >> >>
> > <class-name>
> >> >>>> org.postgresql.xa.PGXADataSource
> >> >>>>
> >> >>
> > </class-name>
> >> >>>>>
> >> >>>>
> >> >>
> > <url>
> >> >>>> jdbc:postgresql://srv-banco-new:5433/teste
> >> >>>>
> >> >>
> > </url>
> >> >>>>>
> >> >>>>
> >> >>
> > <user>
> >> >>>> gace_user
> >> >>>>
> >> >>
> > </user>
> >> >>>>>
> >> >>>>
> >> >>
> > <password>
> >> >>>> gace_user
> >> >>>>
> >> >>
> > </password>
> >> >>>>>
> >> >>>>
> >> >>
> > <transactional>
> >> >>>> true
> >> >>>>
> >> >>
> > </transactional>
> >> >>>>>
> >> >>>>
> >> >>
> > <isolation-level>
> >> >>>> TRANSACTION_READ_COMMITTED
> >> >>>>
> >> >>
> > </isolation-level>
> >> >>>>>
> >> >>>>
> >> >>
> > <initial-pool-size>
> >> >>>> 2
> >> >>>>
> >> >>
> > </initial-pool-size>
> >> >>>>>
> >> >>>>
> >> >>
> > <max-pool-size>
> >> >>>> 10
> >> >>>>
> >> >>
> > </max-pool-size>
> >> >>>>>
> >> >>>>
> >> >>
> > <min-pool-size>
> >> >>>> 5
> >> >>>>
> >> >>
> > </min-pool-size>
> >> >>>>>
> >> >>>>
> >> >>
> > <max-statements>
> >> >>>> 0
> >> >>>>
> >> >>
> > </max-statements>
> >> >>>>>
> >> >>>>
> >> >>
> > </data-source>
> >> >>>>> [/code]
> >> >>>>>
> >> >>>>> The full tomee log is here:
> >> >>>>>
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
> >> >>>>> Is anyone having the same problem? Is there any compatibility
> issue
> >> >>>>> with
> >> >>>>> the
> >> >>>>> topic EE.5.18.3 (page 132) of the EE platform spec. This
> >> stackoverflow
> >> >>>>> discussion help a little[4].
> >> >>>>>
> >> >>>>> Regards
> >> >>>>>
> >> >>>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
> >> >>>>>
> >> >>>>>
> >> >>>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
> >> >>>>> [2]
> >> >>>>>
> >>
> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
> >> >>>>> [3]
> >> >>>>>
> >>
> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
> >> >>>>> [4] http://stackoverflow.com/q/2279913/269514
> >> >>>>>
> >> >>>>>
> >> >>>>>
> >> >>>>> --
> >> >>>>> View this message in context:
> >> >>>>>
> >>
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
> >> >>>>> Sent from the TomEE Users mailing list archive at Nabble.com.
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>>
> >> >>> --
> >> >>> View this message in context:
> >> >>>
> >>
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
> >> >>> Sent from the TomEE Users mailing list archive at Nabble.com.
> >>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678159.html
> >> Sent from the TomEE Users mailing list archive at Nabble.com.
> >>
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678161.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by gilbertoca <gi...@gmail.com>.
Romain Manni-Bucau wrote
> looks like my comments are still relevant ;). guess some values are not
> correctly set going to the datasource. 

I know, that's the issue I'm reporting.


Romain Manni-Bucau wrote
> I would encourage you to ensure
> password is propagated as expected on the datasource.

I've just set it up in the web.xml - the only place I config the
data-source. I don't understand what I can do to ensure
password is propagated since this is a TomEE's server role.


Romain Manni-Bucau wrote
> Romain Manni-Bucau
> @rmannibucau &lt;https://twitter.com/rmannibucau&gt; |  Blog
> &lt;http://rmannibucau.wordpress.com&gt; | Github
> &lt;https://github.com/rmannibucau&gt; |
> LinkedIn &lt;https://www.linkedin.com/in/rmannibucau&gt; | Tomitriber
> &lt;http://www.tomitribe.com&gt; | JavaEE Factory
> &lt;https://javaeefactory-rmannibucau.rhcloud.com&gt;
> 
> 2016-04-15 15:19 GMT+02:00 gilbertoca &lt;

> gilbertoca@

> &gt;:
> 
>> Sorry, but made a mistake: did the test using org.postgresql.Driver and
>> not
>> the DataSource one.
>> Using the XA DataSource, using url I get this error
>>
>> https://gist.github.com/gilbertoca/08222891c14ce6363af0b8a4c451d8d2#file-xa-data-source-url
>> .
>> And using using server, port and database name elements I get this one
>>
>> https://gist.github.com/gilbertoca/8492b3af9009f822eac7ded7e66935d5#file-xa-data-source-server-port-and-database-name
>> .
>>
>> Sorry again
>>
>>
>> gilbertoca wrote
>> >
>> > Romain Manni-Bucau wrote
>> >> Hello
>> >>
>> >> this is a bug, we only support DataSource (mainly cause it brings a
>> >> good pooling compare to native (xa)datasource)
>> >>
>> >> => https://issues.apache.org/jira/browse/TOMEE-1767
>> > Hi, just a following up on this topic.
>> > I've tested it with latest build - working without the need of
>> > DataSourceCreator property, very good work.
>> > But, changing the config using server, port and database name elements
>> > breaks the patch. You can see the log here
>> >
>> https://gist.github.com/gilbertoca/1a593dbb72ae6e82966c20ad77995b1b#file-tomee-embedded-log
>> > the web.xml used is just below the code in the comment.
>> >
>> > Thank you again.
>> > Romain Manni-Bucau wrote
>> >> 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;
>>
>> >> gilbertoca@
>>
>> >> &gt;:
>> >>> Romain Manni-Bucau wrote
>> >>>> Hi
>> >>>
>> >>> You again  ! Wow, thank you!
>> >>>
>> >>>
>> >>> Romain Manni-Bucau wrote
>> >>>> you need to add the property DataSourceCreator=dbcp cause default
>> >>>> pooling (tomcat to be aligned on tomcat backbone) doesn't support
>> it.
>> >>>
>> >>> Nop, doesn't make any difference with the property -
>> >>>
>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
>> >>> .
>> >>>
>> >>> Maybe I've not set it up correctly.
>> >>> The web.xml file -
>> >>>
>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
>> >>> .
>> >>>
>> >>>
>> >>> Romain Manni-Bucau wrote
>> >>>> Also check http://tomee.apache.org/datasource-config.html for tomee
>> >>>> datasource configuration for real life application configuration
>> >>>> (web.xml or @DataSourceDefinition doesn't define pooling if
>> additional
>> >>>> properties are for the pool or the datasource and it misses some
>> >>>> pooling configuration like real life eviction
>> >>>
>> >>> Romain, I'm not native English and I, in advance, apologize for any
>> >>> offense.
>> >>> I don't want to offend anyone, mainly you. And the google translate
>> is
>> >>> not
>> >>> helping much  .
>> >>>
>> >>> Are you saying that this fantastic spec feature/standard is a toy -
>> just
>> >>> for
>> >>> test and "hello world" apps?
>> >>>
>> >>
>> >> For most cases yep. Said otherwise: it gives developpers the
>> >> responsability of production which works in some companies but most of
>> >> the time it is the guarantee to make it wrong.
>> >>
>> >>> I don't understand the resistance in making the Java EE more
>> developer
>> >>> friendly.
>> >>
>> >> That's not exactly it, making EE dev friendly is very good, making dev
>> >> responsible of production depends the company so encouraging such
>> >> practise is IMO bad cause it is the best way to prevent ops guys to go
>> >> their job (of course tomee allows to change it ;))
>> >>
>> >>> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
>> >>> https://issues.jboss.org/browse/WFLY-2727
>> >>>
>> >>
>> >> AFAIK this is tested in tomee but with a normal datasource, not an XA
>> >> one.
>> >>
>> >>> I hope TomEE project can change/break this way of thinking.
>> >>>
>> >>> Regards,
>> >>> Gilberto
>> >>>
>> >>>
>> >>> Romain Manni-Bucau wrote
>> >>>>  so you get what you can
>> >>>> with this API + it is in the application which is rarely what you
>> want
>> >>>> to be able to move between environments or you need a custom
>> >>>> datasource implementation which is rarely what we want to implement
>> >>>> ;))
>> >>>>
>> >>>>
>> >>>> Romain Manni-Bucau
>> >>>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>> >>>>
>> >>>>
>> >>>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
>> >>>
>> >>>> gilbertoca@
>> >>>
>> >>>> &gt;:
>> >>>>> Hi, all!
>> >>>>>
>> >>>>> I'm working on a Java EE 7 project(state government) and in this
>> stage
>> >>>>> looking for the so called "Instant Developer Experience" [1] and
>> >>>>> learning
>> >>>>> at
>> >>>>> the same time using javaee7-samples repository in the github[2].
>> >>>>> Fortunately
>> >>>>> I've found the tomee-embedded-maven-plugin and with help of Romain
>> >>>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
>> >>>>> working
>> >>>>> with h2 database with this config - web.xml:
>> >>>>> [code]
>> >>>>>
>> >>>>
>> >> 
> <data-source>
>> >>>>>
>> >>>>
>> >> 
> <name>
>> >>>> gaceDataSource
>> >>>>
>> >> 
> </name>
>> >>>>>
>> >>>>
>> >> 
> <class-name>
>> >>>> org.h2.jdbcx.JdbcDataSource
>> >>>>
>> >> 
> </class-name>
>> >>>>>
>> >>>>
>> >> 
> <url>
>> >>>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
>> >>>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
>> >>>>
>> >> 
> </url>
>> >>>>>
>> >>>>
>> >> 
> <user>
>> >>>> gace_user
>> >>>>
>> >> 
> </user>
>> >>>>>
>> >>>>
>> >> 
> <password>
>> >>>> gace_user
>> >>>>
>> >> 
> </password>
>> >>>>>
>> >>>>
>> >> 
> <transactional>
>> >>>> true
>> >>>>
>> >> 
> </transactional>
>> >>>>>
>> >>>>
>> >> 
> <isolation-level>
>> >>>> TRANSACTION_READ_COMMITTED
>> >>>>
>> >> 
> </isolation-level>
>> >>>>>
>> >>>>
>> >> 
> <initial-pool-size>
>> >>>> 2
>> >>>>
>> >> 
> </initial-pool-size>
>> >>>>>
>> >>>>
>> >> 
> <max-pool-size>
>> >>>> 10
>> >>>>
>> >> 
> </max-pool-size>
>> >>>>>
>> >>>>
>> >> 
> <min-pool-size>
>> >>>> 5
>> >>>>
>> >> 
> </min-pool-size>
>> >>>>>
>> >>>>
>> >> 
> <max-statements>
>> >>>> 0
>> >>>>
>> >> 
> </max-statements>
>> >>>>>
>> >>>>
>> >> 
> </data-source>
>> >>>>> [/code]
>> >>>>>
>> >>>>> But our production database is a PostgreSQL server (9.4). So,
>> >>>>> configuring
>> >>>>> the data-source element in the web.xml for it we the exception
>> >>>>> mentioned
>> >>>>> in
>> >>>>> the title:
>> >>>>>
>> >>>>> [code]
>> >>>>>
>> >>>>
>> >> 
> <data-source>
>> >>>>>
>> >>>>
>> >> 
> <name>
>> >>>> gaceDataSource
>> >>>>
>> >> 
> </name>
>> >>>>>
>> >>>>
>> >> 
> <class-name>
>> >>>> org.postgresql.xa.PGXADataSource
>> >>>>
>> >> 
> </class-name>
>> >>>>>
>> >>>>
>> >> 
> <url>
>> >>>> jdbc:postgresql://srv-banco-new:5433/teste
>> >>>>
>> >> 
> </url>
>> >>>>>
>> >>>>
>> >> 
> <user>
>> >>>> gace_user
>> >>>>
>> >> 
> </user>
>> >>>>>
>> >>>>
>> >> 
> <password>
>> >>>> gace_user
>> >>>>
>> >> 
> </password>
>> >>>>>
>> >>>>
>> >> 
> <transactional>
>> >>>> true
>> >>>>
>> >> 
> </transactional>
>> >>>>>
>> >>>>
>> >> 
> <isolation-level>
>> >>>> TRANSACTION_READ_COMMITTED
>> >>>>
>> >> 
> </isolation-level>
>> >>>>>
>> >>>>
>> >> 
> <initial-pool-size>
>> >>>> 2
>> >>>>
>> >> 
> </initial-pool-size>
>> >>>>>
>> >>>>
>> >> 
> <max-pool-size>
>> >>>> 10
>> >>>>
>> >> 
> </max-pool-size>
>> >>>>>
>> >>>>
>> >> 
> <min-pool-size>
>> >>>> 5
>> >>>>
>> >> 
> </min-pool-size>
>> >>>>>
>> >>>>
>> >> 
> <max-statements>
>> >>>> 0
>> >>>>
>> >> 
> </max-statements>
>> >>>>>
>> >>>>
>> >> 
> </data-source>
>> >>>>> [/code]
>> >>>>>
>> >>>>> The full tomee log is here:
>> >>>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
>> >>>>> Is anyone having the same problem? Is there any compatibility issue
>> >>>>> with
>> >>>>> the
>> >>>>> topic EE.5.18.3 (page 132) of the EE platform spec. This
>> stackoverflow
>> >>>>> discussion help a little[4].
>> >>>>>
>> >>>>> Regards
>> >>>>>
>> >>>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>> >>>>>
>> >>>>>
>> >>>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
>> >>>>> [2]
>> >>>>>
>> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
>> >>>>> [3]
>> >>>>>
>> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
>> >>>>> [4] http://stackoverflow.com/q/2279913/269514
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> View this message in context:
>> >>>>>
>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
>> >>>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> --
>> >>> View this message in context:
>> >>>
>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
>> >>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678159.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678161.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by Romain Manni-Bucau <rm...@gmail.com>.
looks like my comments are still relevant ;). guess some values are not
correctly set going to the datasource. I would encourage you to ensure
password is propagated as expected on the datasource.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-04-15 15:19 GMT+02:00 gilbertoca <gi...@gmail.com>:

> Sorry, but made a mistake: did the test using org.postgresql.Driver and not
> the DataSource one.
> Using the XA DataSource, using url I get this error
>
> https://gist.github.com/gilbertoca/08222891c14ce6363af0b8a4c451d8d2#file-xa-data-source-url
> .
> And using using server, port and database name elements I get this one
>
> https://gist.github.com/gilbertoca/8492b3af9009f822eac7ded7e66935d5#file-xa-data-source-server-port-and-database-name
> .
>
> Sorry again
>
>
> gilbertoca wrote
> >
> > Romain Manni-Bucau wrote
> >> Hello
> >>
> >> this is a bug, we only support DataSource (mainly cause it brings a
> >> good pooling compare to native (xa)datasource)
> >>
> >> => https://issues.apache.org/jira/browse/TOMEE-1767
> > Hi, just a following up on this topic.
> > I've tested it with latest build - working without the need of
> > DataSourceCreator property, very good work.
> > But, changing the config using server, port and database name elements
> > breaks the patch. You can see the log here
> >
> https://gist.github.com/gilbertoca/1a593dbb72ae6e82966c20ad77995b1b#file-tomee-embedded-log
> > the web.xml used is just below the code in the comment.
> >
> > Thank you again.
> > Romain Manni-Bucau wrote
> >> 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;
>
> >> gilbertoca@
>
> >> &gt;:
> >>> Romain Manni-Bucau wrote
> >>>> Hi
> >>>
> >>> You again  ! Wow, thank you!
> >>>
> >>>
> >>> Romain Manni-Bucau wrote
> >>>> you need to add the property DataSourceCreator=dbcp cause default
> >>>> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.
> >>>
> >>> Nop, doesn't make any difference with the property -
> >>>
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
> >>> .
> >>>
> >>> Maybe I've not set it up correctly.
> >>> The web.xml file -
> >>>
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
> >>> .
> >>>
> >>>
> >>> Romain Manni-Bucau wrote
> >>>> Also check http://tomee.apache.org/datasource-config.html for tomee
> >>>> datasource configuration for real life application configuration
> >>>> (web.xml or @DataSourceDefinition doesn't define pooling if additional
> >>>> properties are for the pool or the datasource and it misses some
> >>>> pooling configuration like real life eviction
> >>>
> >>> Romain, I'm not native English and I, in advance, apologize for any
> >>> offense.
> >>> I don't want to offend anyone, mainly you. And the google translate is
> >>> not
> >>> helping much  .
> >>>
> >>> Are you saying that this fantastic spec feature/standard is a toy -
> just
> >>> for
> >>> test and "hello world" apps?
> >>>
> >>
> >> For most cases yep. Said otherwise: it gives developpers the
> >> responsability of production which works in some companies but most of
> >> the time it is the guarantee to make it wrong.
> >>
> >>> I don't understand the resistance in making the Java EE more developer
> >>> friendly.
> >>
> >> That's not exactly it, making EE dev friendly is very good, making dev
> >> responsible of production depends the company so encouraging such
> >> practise is IMO bad cause it is the best way to prevent ops guys to go
> >> their job (of course tomee allows to change it ;))
> >>
> >>> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
> >>> https://issues.jboss.org/browse/WFLY-2727
> >>>
> >>
> >> AFAIK this is tested in tomee but with a normal datasource, not an XA
> >> one.
> >>
> >>> I hope TomEE project can change/break this way of thinking.
> >>>
> >>> Regards,
> >>> Gilberto
> >>>
> >>>
> >>> Romain Manni-Bucau wrote
> >>>>  so you get what you can
> >>>> with this API + it is in the application which is rarely what you want
> >>>> to be able to move between environments or you need a custom
> >>>> datasource implementation which is rarely what we want to implement
> >>>> ;))
> >>>>
> >>>>
> >>>> Romain Manni-Bucau
> >>>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
> >>>>
> >>>>
> >>>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
> >>>
> >>>> gilbertoca@
> >>>
> >>>> &gt;:
> >>>>> Hi, all!
> >>>>>
> >>>>> I'm working on a Java EE 7 project(state government) and in this
> stage
> >>>>> looking for the so called "Instant Developer Experience" [1] and
> >>>>> learning
> >>>>> at
> >>>>> the same time using javaee7-samples repository in the github[2].
> >>>>> Fortunately
> >>>>> I've found the tomee-embedded-maven-plugin and with help of Romain
> >>>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
> >>>>> working
> >>>>> with h2 database with this config - web.xml:
> >>>>> [code]
> >>>>>
> >>>>
> >> <data-source>
> >>>>>
> >>>>
> >> <name>
> >>>> gaceDataSource
> >>>>
> >> </name>
> >>>>>
> >>>>
> >> <class-name>
> >>>> org.h2.jdbcx.JdbcDataSource
> >>>>
> >> </class-name>
> >>>>>
> >>>>
> >> <url>
> >>>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
> >>>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
> >>>>
> >> </url>
> >>>>>
> >>>>
> >> <user>
> >>>> gace_user
> >>>>
> >> </user>
> >>>>>
> >>>>
> >> <password>
> >>>> gace_user
> >>>>
> >> </password>
> >>>>>
> >>>>
> >> <transactional>
> >>>> true
> >>>>
> >> </transactional>
> >>>>>
> >>>>
> >> <isolation-level>
> >>>> TRANSACTION_READ_COMMITTED
> >>>>
> >> </isolation-level>
> >>>>>
> >>>>
> >> <initial-pool-size>
> >>>> 2
> >>>>
> >> </initial-pool-size>
> >>>>>
> >>>>
> >> <max-pool-size>
> >>>> 10
> >>>>
> >> </max-pool-size>
> >>>>>
> >>>>
> >> <min-pool-size>
> >>>> 5
> >>>>
> >> </min-pool-size>
> >>>>>
> >>>>
> >> <max-statements>
> >>>> 0
> >>>>
> >> </max-statements>
> >>>>>
> >>>>
> >> </data-source>
> >>>>> [/code]
> >>>>>
> >>>>> But our production database is a PostgreSQL server (9.4). So,
> >>>>> configuring
> >>>>> the data-source element in the web.xml for it we the exception
> >>>>> mentioned
> >>>>> in
> >>>>> the title:
> >>>>>
> >>>>> [code]
> >>>>>
> >>>>
> >> <data-source>
> >>>>>
> >>>>
> >> <name>
> >>>> gaceDataSource
> >>>>
> >> </name>
> >>>>>
> >>>>
> >> <class-name>
> >>>> org.postgresql.xa.PGXADataSource
> >>>>
> >> </class-name>
> >>>>>
> >>>>
> >> <url>
> >>>> jdbc:postgresql://srv-banco-new:5433/teste
> >>>>
> >> </url>
> >>>>>
> >>>>
> >> <user>
> >>>> gace_user
> >>>>
> >> </user>
> >>>>>
> >>>>
> >> <password>
> >>>> gace_user
> >>>>
> >> </password>
> >>>>>
> >>>>
> >> <transactional>
> >>>> true
> >>>>
> >> </transactional>
> >>>>>
> >>>>
> >> <isolation-level>
> >>>> TRANSACTION_READ_COMMITTED
> >>>>
> >> </isolation-level>
> >>>>>
> >>>>
> >> <initial-pool-size>
> >>>> 2
> >>>>
> >> </initial-pool-size>
> >>>>>
> >>>>
> >> <max-pool-size>
> >>>> 10
> >>>>
> >> </max-pool-size>
> >>>>>
> >>>>
> >> <min-pool-size>
> >>>> 5
> >>>>
> >> </min-pool-size>
> >>>>>
> >>>>
> >> <max-statements>
> >>>> 0
> >>>>
> >> </max-statements>
> >>>>>
> >>>>
> >> </data-source>
> >>>>> [/code]
> >>>>>
> >>>>> The full tomee log is here:
> >>>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
> >>>>> Is anyone having the same problem? Is there any compatibility issue
> >>>>> with
> >>>>> the
> >>>>> topic EE.5.18.3 (page 132) of the EE platform spec. This
> stackoverflow
> >>>>> discussion help a little[4].
> >>>>>
> >>>>> Regards
> >>>>>
> >>>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
> >>>>>
> >>>>>
> >>>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
> >>>>> [2]
> >>>>>
> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
> >>>>> [3]
> >>>>>
> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
> >>>>> [4] http://stackoverflow.com/q/2279913/269514
> >>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> View this message in context:
> >>>>>
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
> >>>>> Sent from the TomEE Users mailing list archive at Nabble.com.
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
> >>> Sent from the TomEE Users mailing list archive at Nabble.com.
>
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678159.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by gilbertoca <gi...@gmail.com>.
Sorry, but made a mistake: did the test using org.postgresql.Driver and not
the DataSource one.
Using the XA DataSource, using url I get this error
https://gist.github.com/gilbertoca/08222891c14ce6363af0b8a4c451d8d2#file-xa-data-source-url
.
And using using server, port and database name elements I get this one
https://gist.github.com/gilbertoca/8492b3af9009f822eac7ded7e66935d5#file-xa-data-source-server-port-and-database-name
.

Sorry again


gilbertoca wrote
> 
> Romain Manni-Bucau wrote
>> Hello
>> 
>> this is a bug, we only support DataSource (mainly cause it brings a
>> good pooling compare to native (xa)datasource)
>> 
>> => https://issues.apache.org/jira/browse/TOMEE-1767
> Hi, just a following up on this topic.
> I've tested it with latest build - working without the need of
> DataSourceCreator property, very good work.
> But, changing the config using server, port and database name elements
> breaks the patch. You can see the log here
> https://gist.github.com/gilbertoca/1a593dbb72ae6e82966c20ad77995b1b#file-tomee-embedded-log
> the web.xml used is just below the code in the comment.
> 
> Thank you again.
> Romain Manni-Bucau wrote
>> 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;

>> gilbertoca@

>> &gt;:
>>> Romain Manni-Bucau wrote
>>>> Hi
>>>
>>> You again  ! Wow, thank you!
>>>
>>>
>>> Romain Manni-Bucau wrote
>>>> you need to add the property DataSourceCreator=dbcp cause default
>>>> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.
>>>
>>> Nop, doesn't make any difference with the property -
>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
>>> .
>>>
>>> Maybe I've not set it up correctly.
>>> The web.xml file -
>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
>>> .
>>>
>>>
>>> Romain Manni-Bucau wrote
>>>> Also check http://tomee.apache.org/datasource-config.html for tomee
>>>> datasource configuration for real life application configuration
>>>> (web.xml or @DataSourceDefinition doesn't define pooling if additional
>>>> properties are for the pool or the datasource and it misses some
>>>> pooling configuration like real life eviction
>>>
>>> Romain, I'm not native English and I, in advance, apologize for any
>>> offense.
>>> I don't want to offend anyone, mainly you. And the google translate is
>>> not
>>> helping much  .
>>>
>>> Are you saying that this fantastic spec feature/standard is a toy - just
>>> for
>>> test and "hello world" apps?
>>>
>> 
>> For most cases yep. Said otherwise: it gives developpers the
>> responsability of production which works in some companies but most of
>> the time it is the guarantee to make it wrong.
>> 
>>> I don't understand the resistance in making the Java EE more developer
>>> friendly.
>> 
>> That's not exactly it, making EE dev friendly is very good, making dev
>> responsible of production depends the company so encouraging such
>> practise is IMO bad cause it is the best way to prevent ops guys to go
>> their job (of course tomee allows to change it ;))
>> 
>>> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
>>> https://issues.jboss.org/browse/WFLY-2727
>>>
>> 
>> AFAIK this is tested in tomee but with a normal datasource, not an XA
>> one.
>> 
>>> I hope TomEE project can change/break this way of thinking.
>>>
>>> Regards,
>>> Gilberto
>>>
>>>
>>> Romain Manni-Bucau wrote
>>>>  so you get what you can
>>>> with this API + it is in the application which is rarely what you want
>>>> to be able to move between environments or you need a custom
>>>> datasource implementation which is rarely what we want to implement
>>>> ;))
>>>>
>>>>
>>>> Romain Manni-Bucau
>>>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>>>>
>>>>
>>>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
>>>
>>>> gilbertoca@
>>>
>>>> &gt;:
>>>>> Hi, all!
>>>>>
>>>>> I'm working on a Java EE 7 project(state government) and in this stage
>>>>> looking for the so called "Instant Developer Experience" [1] and
>>>>> learning
>>>>> at
>>>>> the same time using javaee7-samples repository in the github[2].
>>>>> Fortunately
>>>>> I've found the tomee-embedded-maven-plugin and with help of Romain
>>>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
>>>>> working
>>>>> with h2 database with this config - web.xml:
>>>>> [code]
>>>>>
>>>> 
>> <data-source>
>>>>>
>>>> 
>> <name>
>>>> gaceDataSource
>>>> 
>> </name>
>>>>>
>>>> 
>> <class-name>
>>>> org.h2.jdbcx.JdbcDataSource
>>>> 
>> </class-name>
>>>>>
>>>> 
>> <url>
>>>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
>>>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
>>>> 
>> </url>
>>>>>
>>>> 
>> <user>
>>>> gace_user
>>>> 
>> </user>
>>>>>
>>>> 
>> <password>
>>>> gace_user
>>>> 
>> </password>
>>>>>
>>>> 
>> <transactional>
>>>> true
>>>> 
>> </transactional>
>>>>>
>>>> 
>> <isolation-level>
>>>> TRANSACTION_READ_COMMITTED
>>>> 
>> </isolation-level>
>>>>>
>>>> 
>> <initial-pool-size>
>>>> 2
>>>> 
>> </initial-pool-size>
>>>>>
>>>> 
>> <max-pool-size>
>>>> 10
>>>> 
>> </max-pool-size>
>>>>>
>>>> 
>> <min-pool-size>
>>>> 5
>>>> 
>> </min-pool-size>
>>>>>
>>>> 
>> <max-statements>
>>>> 0
>>>> 
>> </max-statements>
>>>>>
>>>> 
>> </data-source>
>>>>> [/code]
>>>>>
>>>>> But our production database is a PostgreSQL server (9.4). So,
>>>>> configuring
>>>>> the data-source element in the web.xml for it we the exception
>>>>> mentioned
>>>>> in
>>>>> the title:
>>>>>
>>>>> [code]
>>>>>
>>>> 
>> <data-source>
>>>>>
>>>> 
>> <name>
>>>> gaceDataSource
>>>> 
>> </name>
>>>>>
>>>> 
>> <class-name>
>>>> org.postgresql.xa.PGXADataSource
>>>> 
>> </class-name>
>>>>>
>>>> 
>> <url>
>>>> jdbc:postgresql://srv-banco-new:5433/teste
>>>> 
>> </url>
>>>>>
>>>> 
>> <user>
>>>> gace_user
>>>> 
>> </user>
>>>>>
>>>> 
>> <password>
>>>> gace_user
>>>> 
>> </password>
>>>>>
>>>> 
>> <transactional>
>>>> true
>>>> 
>> </transactional>
>>>>>
>>>> 
>> <isolation-level>
>>>> TRANSACTION_READ_COMMITTED
>>>> 
>> </isolation-level>
>>>>>
>>>> 
>> <initial-pool-size>
>>>> 2
>>>> 
>> </initial-pool-size>
>>>>>
>>>> 
>> <max-pool-size>
>>>> 10
>>>> 
>> </max-pool-size>
>>>>>
>>>> 
>> <min-pool-size>
>>>> 5
>>>> 
>> </min-pool-size>
>>>>>
>>>> 
>> <max-statements>
>>>> 0
>>>> 
>> </max-statements>
>>>>>
>>>> 
>> </data-source>
>>>>> [/code]
>>>>>
>>>>> The full tomee log is here:
>>>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
>>>>> Is anyone having the same problem? Is there any compatibility issue
>>>>> with
>>>>> the
>>>>> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
>>>>> discussion help a little[4].
>>>>>
>>>>> Regards
>>>>>
>>>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>>>>>
>>>>>
>>>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
>>>>> [2]
>>>>> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
>>>>> [3]
>>>>> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
>>>>> [4] http://stackoverflow.com/q/2279913/269514
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
>>>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
>>> Sent from the TomEE Users mailing list archive at Nabble.com.





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678159.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by gilbertoca <gi...@gmail.com>.
Romain Manni-Bucau wrote
> Hello
> 
> this is a bug, we only support DataSource (mainly cause it brings a
> good pooling compare to native (xa)datasource)
> 
> => https://issues.apache.org/jira/browse/TOMEE-1767

Hi, just a following up on this topic.
I've tested it with latest build - working without the need of
DataSourceCreator property, very good work.
But, changing the config using server, port and database name elements
breaks the patch. You can see the log here
https://gist.github.com/gilbertoca/1a593dbb72ae6e82966c20ad77995b1b#file-tomee-embedded-log
the web.xml used is just below the code in the comment.

Thank you again.


Romain Manni-Bucau wrote
> 2016-04-04 15:49 GMT+02:00 gilbertoca &lt;

> gilbertoca@

> &gt;:
>> Romain Manni-Bucau wrote
>>> Hi
>>
>> You again  ! Wow, thank you!
>>
>>
>> Romain Manni-Bucau wrote
>>> you need to add the property DataSourceCreator=dbcp cause default
>>> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.
>>
>> Nop, doesn't make any difference with the property -
>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
>> .
>>
>> Maybe I've not set it up correctly.
>> The web.xml file -
>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
>> .
>>
>>
>> Romain Manni-Bucau wrote
>>> Also check http://tomee.apache.org/datasource-config.html for tomee
>>> datasource configuration for real life application configuration
>>> (web.xml or @DataSourceDefinition doesn't define pooling if additional
>>> properties are for the pool or the datasource and it misses some
>>> pooling configuration like real life eviction
>>
>> Romain, I'm not native English and I, in advance, apologize for any
>> offense.
>> I don't want to offend anyone, mainly you. And the google translate is
>> not
>> helping much  .
>>
>> Are you saying that this fantastic spec feature/standard is a toy - just
>> for
>> test and "hello world" apps?
>>
> 
> For most cases yep. Said otherwise: it gives developpers the
> responsability of production which works in some companies but most of
> the time it is the guarantee to make it wrong.
> 
>> I don't understand the resistance in making the Java EE more developer
>> friendly.
> 
> That's not exactly it, making EE dev friendly is very good, making dev
> responsible of production depends the company so encouraging such
> practise is IMO bad cause it is the best way to prevent ops guys to go
> their job (of course tomee allows to change it ;))
> 
>> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
>> https://issues.jboss.org/browse/WFLY-2727
>>
> 
> AFAIK this is tested in tomee but with a normal datasource, not an XA one.
> 
>> I hope TomEE project can change/break this way of thinking.
>>
>> Regards,
>> Gilberto
>>
>>
>> Romain Manni-Bucau wrote
>>>  so you get what you can
>>> with this API + it is in the application which is rarely what you want
>>> to be able to move between environments or you need a custom
>>> datasource implementation which is rarely what we want to implement
>>> ;))
>>>
>>>
>>> Romain Manni-Bucau
>>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>>>
>>>
>>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
>>
>>> gilbertoca@
>>
>>> &gt;:
>>>> Hi, all!
>>>>
>>>> I'm working on a Java EE 7 project(state government) and in this stage
>>>> looking for the so called "Instant Developer Experience" [1] and
>>>> learning
>>>> at
>>>> the same time using javaee7-samples repository in the github[2].
>>>> Fortunately
>>>> I've found the tomee-embedded-maven-plugin and with help of Romain
>>>> Manni-Bucau [3] I've made a good progress on it. Until now I was
>>>> working
>>>> with h2 database with this config - web.xml:
>>>> [code]
>>>>
>>> 
> <data-source>
>>>>
>>> 
> <name>
>>> gaceDataSource
>>> 
> </name>
>>>>
>>> 
> <class-name>
>>> org.h2.jdbcx.JdbcDataSource
>>> 
> </class-name>
>>>>
>>> 
> <url>
>>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
>>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
>>> 
> </url>
>>>>
>>> 
> <user>
>>> gace_user
>>> 
> </user>
>>>>
>>> 
> <password>
>>> gace_user
>>> 
> </password>
>>>>
>>> 
> <transactional>
>>> true
>>> 
> </transactional>
>>>>
>>> 
> <isolation-level>
>>> TRANSACTION_READ_COMMITTED
>>> 
> </isolation-level>
>>>>
>>> 
> <initial-pool-size>
>>> 2
>>> 
> </initial-pool-size>
>>>>
>>> 
> <max-pool-size>
>>> 10
>>> 
> </max-pool-size>
>>>>
>>> 
> <min-pool-size>
>>> 5
>>> 
> </min-pool-size>
>>>>
>>> 
> <max-statements>
>>> 0
>>> 
> </max-statements>
>>>>
>>> 
> </data-source>
>>>> [/code]
>>>>
>>>> But our production database is a PostgreSQL server (9.4). So,
>>>> configuring
>>>> the data-source element in the web.xml for it we the exception
>>>> mentioned
>>>> in
>>>> the title:
>>>>
>>>> [code]
>>>>
>>> 
> <data-source>
>>>>
>>> 
> <name>
>>> gaceDataSource
>>> 
> </name>
>>>>
>>> 
> <class-name>
>>> org.postgresql.xa.PGXADataSource
>>> 
> </class-name>
>>>>
>>> 
> <url>
>>> jdbc:postgresql://srv-banco-new:5433/teste
>>> 
> </url>
>>>>
>>> 
> <user>
>>> gace_user
>>> 
> </user>
>>>>
>>> 
> <password>
>>> gace_user
>>> 
> </password>
>>>>
>>> 
> <transactional>
>>> true
>>> 
> </transactional>
>>>>
>>> 
> <isolation-level>
>>> TRANSACTION_READ_COMMITTED
>>> 
> </isolation-level>
>>>>
>>> 
> <initial-pool-size>
>>> 2
>>> 
> </initial-pool-size>
>>>>
>>> 
> <max-pool-size>
>>> 10
>>> 
> </max-pool-size>
>>>>
>>> 
> <min-pool-size>
>>> 5
>>> 
> </min-pool-size>
>>>>
>>> 
> <max-statements>
>>> 0
>>> 
> </max-statements>
>>>>
>>> 
> </data-source>
>>>> [/code]
>>>>
>>>> The full tomee log is here:
>>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
>>>> Is anyone having the same problem? Is there any compatibility issue
>>>> with
>>>> the
>>>> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
>>>> discussion help a little[4].
>>>>
>>>> Regards
>>>>
>>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>>>>
>>>>
>>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
>>>> [2]
>>>> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
>>>> [3]
>>>> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
>>>> [4] http://stackoverflow.com/q/2279913/269514
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
>>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678157.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hello

this is a bug, we only support DataSource (mainly cause it brings a
good pooling compare to native (xa)datasource)

=> https://issues.apache.org/jira/browse/TOMEE-1767

2016-04-04 15:49 GMT+02:00 gilbertoca <gi...@gmail.com>:
> Romain Manni-Bucau wrote
>> Hi
>
> You again  ! Wow, thank you!
>
>
> Romain Manni-Bucau wrote
>> you need to add the property DataSourceCreator=dbcp cause default
>> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.
>
> Nop, doesn't make any difference with the property -
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
> .
>
> Maybe I've not set it up correctly.
> The web.xml file -
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
> .
>
>
> Romain Manni-Bucau wrote
>> Also check http://tomee.apache.org/datasource-config.html for tomee
>> datasource configuration for real life application configuration
>> (web.xml or @DataSourceDefinition doesn't define pooling if additional
>> properties are for the pool or the datasource and it misses some
>> pooling configuration like real life eviction
>
> Romain, I'm not native English and I, in advance, apologize for any offense.
> I don't want to offend anyone, mainly you. And the google translate is not
> helping much  .
>
> Are you saying that this fantastic spec feature/standard is a toy - just for
> test and "hello world" apps?
>

For most cases yep. Said otherwise: it gives developpers the
responsability of production which works in some companies but most of
the time it is the guarantee to make it wrong.

> I don't understand the resistance in making the Java EE more developer
> friendly.

That's not exactly it, making EE dev friendly is very good, making dev
responsible of production depends the company so encouraging such
practise is IMO bad cause it is the best way to prevent ops guys to go
their job (of course tomee allows to change it ;))

> See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
> https://issues.jboss.org/browse/WFLY-2727
>

AFAIK this is tested in tomee but with a normal datasource, not an XA one.

> I hope TomEE project can change/break this way of thinking.
>
> Regards,
> Gilberto
>
>
> Romain Manni-Bucau wrote
>>  so you get what you can
>> with this API + it is in the application which is rarely what you want
>> to be able to move between environments or you need a custom
>> datasource implementation which is rarely what we want to implement
>> ;))
>>
>>
>> Romain Manni-Bucau
>> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
>>
>>
>> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;
>
>> gilbertoca@
>
>> &gt;:
>>> Hi, all!
>>>
>>> I'm working on a Java EE 7 project(state government) and in this stage
>>> looking for the so called "Instant Developer Experience" [1] and learning
>>> at
>>> the same time using javaee7-samples repository in the github[2].
>>> Fortunately
>>> I've found the tomee-embedded-maven-plugin and with help of Romain
>>> Manni-Bucau [3] I've made a good progress on it. Until now I was working
>>> with h2 database with this config - web.xml:
>>> [code]
>>>
>> <data-source>
>>>
>> <name>
>> gaceDataSource
>> </name>
>>>
>> <class-name>
>> org.h2.jdbcx.JdbcDataSource
>> </class-name>
>>>
>> <url>
>> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
>>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
>> </url>
>>>
>> <user>
>> gace_user
>> </user>
>>>
>> <password>
>> gace_user
>> </password>
>>>
>> <transactional>
>> true
>> </transactional>
>>>
>> <isolation-level>
>> TRANSACTION_READ_COMMITTED
>> </isolation-level>
>>>
>> <initial-pool-size>
>> 2
>> </initial-pool-size>
>>>
>> <max-pool-size>
>> 10
>> </max-pool-size>
>>>
>> <min-pool-size>
>> 5
>> </min-pool-size>
>>>
>> <max-statements>
>> 0
>> </max-statements>
>>>
>> </data-source>
>>> [/code]
>>>
>>> But our production database is a PostgreSQL server (9.4). So, configuring
>>> the data-source element in the web.xml for it we the exception mentioned
>>> in
>>> the title:
>>>
>>> [code]
>>>
>> <data-source>
>>>
>> <name>
>> gaceDataSource
>> </name>
>>>
>> <class-name>
>> org.postgresql.xa.PGXADataSource
>> </class-name>
>>>
>> <url>
>> jdbc:postgresql://srv-banco-new:5433/teste
>> </url>
>>>
>> <user>
>> gace_user
>> </user>
>>>
>> <password>
>> gace_user
>> </password>
>>>
>> <transactional>
>> true
>> </transactional>
>>>
>> <isolation-level>
>> TRANSACTION_READ_COMMITTED
>> </isolation-level>
>>>
>> <initial-pool-size>
>> 2
>> </initial-pool-size>
>>>
>> <max-pool-size>
>> 10
>> </max-pool-size>
>>>
>> <min-pool-size>
>> 5
>> </min-pool-size>
>>>
>> <max-statements>
>> 0
>> </max-statements>
>>>
>> </data-source>
>>> [/code]
>>>
>>> The full tomee log is here:
>>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
>>> Is anyone having the same problem? Is there any compatibility issue with
>>> the
>>> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
>>> discussion help a little[4].
>>>
>>> Regards
>>>
>>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>>>
>>>
>>> [1] http://opk.sourceforge.net/instant_developer_experience.html
>>> [2]
>>> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
>>> [3]
>>> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
>>> [4] http://stackoverflow.com/q/2279913/269514
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
>>> Sent from the TomEE Users mailing list archive at Nabble.com.
>
>
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
> Sent from the TomEE Users mailing list archive at Nabble.com.

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by gilbertoca <gi...@gmail.com>.
Romain Manni-Bucau wrote
> Hi

You again  ! Wow, thank you!


Romain Manni-Bucau wrote
> you need to add the property DataSourceCreator=dbcp cause default
> pooling (tomcat to be aligned on tomcat backbone) doesn't support it.

Nop, doesn't make any difference with the property -
https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741516
.

Maybe I've not set it up correctly.
The web.xml file -
https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b#gistcomment-1741518
.


Romain Manni-Bucau wrote
> Also check http://tomee.apache.org/datasource-config.html for tomee
> datasource configuration for real life application configuration
> (web.xml or @DataSourceDefinition doesn't define pooling if additional
> properties are for the pool or the datasource and it misses some
> pooling configuration like real life eviction

Romain, I'm not native English and I, in advance, apologize for any offense.
I don't want to offend anyone, mainly you. And the google translate is not
helping much  .

Are you saying that this fantastic spec feature/standard is a toy - just for
test and "hello world" apps?

I don't understand the resistance in making the Java EE more developer
friendly. 
See here https://java.net/jira/browse/JAVAEE_SPEC-30 and here
https://issues.jboss.org/browse/WFLY-2727

I hope TomEE project can change/break this way of thinking.

Regards,
Gilberto


Romain Manni-Bucau wrote
>  so you get what you can
> with this API + it is in the application which is rarely what you want
> to be able to move between environments or you need a custom
> datasource implementation which is rarely what we want to implement
> ;))
> 
> 
> Romain Manni-Bucau
> @rmannibucau |  Blog | Github | LinkedIn | Tomitriber
> 
> 
> 2016-04-01 20:38 GMT+02:00 gilbertoca &lt;

> gilbertoca@

> &gt;:
>> Hi, all!
>>
>> I'm working on a Java EE 7 project(state government) and in this stage
>> looking for the so called "Instant Developer Experience" [1] and learning
>> at
>> the same time using javaee7-samples repository in the github[2].
>> Fortunately
>> I've found the tomee-embedded-maven-plugin and with help of Romain
>> Manni-Bucau [3] I've made a good progress on it. Until now I was working
>> with h2 database with this config - web.xml:
>> [code]
>>     
> <data-source>
>>         
> <name>
> gaceDataSource
> </name>
>>         
> <class-name>
> org.h2.jdbcx.JdbcDataSource
> </class-name>
>>         
> <url>
> jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
>> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1
> </url>
>>         
> <user>
> gace_user
> </user>
>>         
> <password>
> gace_user
> </password>
>>         
> <transactional>
> true
> </transactional>
>>         
> <isolation-level>
> TRANSACTION_READ_COMMITTED
> </isolation-level>
>>         
> <initial-pool-size>
> 2
> </initial-pool-size>
>>         
> <max-pool-size>
> 10
> </max-pool-size>
>>         
> <min-pool-size>
> 5
> </min-pool-size>
>>         
> <max-statements>
> 0
> </max-statements>
>>     
> </data-source>
>> [/code]
>>
>> But our production database is a PostgreSQL server (9.4). So, configuring
>> the data-source element in the web.xml for it we the exception mentioned
>> in
>> the title:
>>
>> [code]
>>     
> <data-source>
>>         
> <name>
> gaceDataSource
> </name>
>>         
> <class-name>
> org.postgresql.xa.PGXADataSource
> </class-name>
>>         
> <url>
> jdbc:postgresql://srv-banco-new:5433/teste
> </url>
>>         
> <user>
> gace_user
> </user>
>>         
> <password>
> gace_user
> </password>
>>         
> <transactional>
> true
> </transactional>
>>         
> <isolation-level>
> TRANSACTION_READ_COMMITTED
> </isolation-level>
>>         
> <initial-pool-size>
> 2
> </initial-pool-size>
>>         
> <max-pool-size>
> 10
> </max-pool-size>
>>         
> <min-pool-size>
> 5
> </min-pool-size>
>>         
> <max-statements>
> 0
> </max-statements>
>>     
> </data-source>
>> [/code]
>>
>> The full tomee log is here:
>> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
>> Is anyone having the same problem? Is there any compatibility issue with
>> the
>> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
>> discussion help a little[4].
>>
>> Regards
>>
>> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>>
>>
>> [1] http://opk.sourceforge.net/instant_developer_experience.html
>> [2]
>> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
>> [3]
>> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
>> [4] http://stackoverflow.com/q/2279913/269514
>>
>>
>>
>> --
>> View this message in context:
>> http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
>> Sent from the TomEE Users mailing list archive at Nabble.com.





--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050p4678069.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: org.postgresql.xa.PGXADataSource cannot be cast to java.sql.Driver [TomEE 7.0.0-M3]

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

you need to add the property DataSourceCreator=dbcp cause default
pooling (tomcat to be aligned on tomcat backbone) doesn't support it.

Also check http://tomee.apache.org/datasource-config.html for tomee
datasource configuration for real life application configuration
(web.xml or @DataSourceDefinition doesn't define pooling if additional
properties are for the pool or the datasource and it misses some
pooling configuration like real life eviction so you get what you can
with this API + it is in the application which is rarely what you want
to be able to move between environments or you need a custom
datasource implementation which is rarely what we want to implement
;))


Romain Manni-Bucau
@rmannibucau |  Blog | Github | LinkedIn | Tomitriber


2016-04-01 20:38 GMT+02:00 gilbertoca <gi...@gmail.com>:
> Hi, all!
>
> I'm working on a Java EE 7 project(state government) and in this stage
> looking for the so called "Instant Developer Experience" [1] and learning at
> the same time using javaee7-samples repository in the github[2]. Fortunately
> I've found the tomee-embedded-maven-plugin and with help of Romain
> Manni-Bucau [3] I've made a good progress on it. Until now I was working
> with h2 database with this config - web.xml:
> [code]
>     <data-source>
>         <name>gaceDataSource</name>
>         <class-name>org.h2.jdbcx.JdbcDataSource</class-name>
>         <url>jdbc:h2:file:./target/data/gaceDB;create=true;INIT=CREATE
> SCHEMA IF NOT EXISTS GACE;MODE=PostgreSQL;DB_CLOSE_DELAY=-1</url>
>         <user>gace_user</user>
>         <password>gace_user</password>
>         <transactional>true</transactional>
>         <isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
>         <initial-pool-size>2</initial-pool-size>
>         <max-pool-size>10</max-pool-size>
>         <min-pool-size>5</min-pool-size>
>         <max-statements>0</max-statements>
>     </data-source>
> [/code]
>
> But our production database is a PostgreSQL server (9.4). So, configuring
> the data-source element in the web.xml for it we the exception mentioned in
> the title:
>
> [code]
>     <data-source>
>         <name>gaceDataSource</name>
>         <class-name>org.postgresql.xa.PGXADataSource</class-name>
>         <url>jdbc:postgresql://srv-banco-new:5433/teste</url>
>         <user>gace_user</user>
>         <password>gace_user</password>
>         <transactional>true</transactional>
>         <isolation-level>TRANSACTION_READ_COMMITTED</isolation-level>
>         <initial-pool-size>2</initial-pool-size>
>         <max-pool-size>10</max-pool-size>
>         <min-pool-size>5</min-pool-size>
>         <max-statements>0</max-statements>
>     </data-source>
> [/code]
>
> The full tomee log is here:
> https://gist.github.com/gilbertoca/ad3bfff3739460434de4fc57efb2aa9b
> Is anyone having the same problem? Is there any compatibility issue with the
> topic EE.5.18.3 (page 132) of the EE platform spec. This stackoverflow
> discussion help a little[4].
>
> Regards
>
> PS.: the app deploy smoothly in wildfly, glassfish and payara.
>
>
> [1] http://opk.sourceforge.net/instant_developer_experience.html
> [2]
> https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition-webxml-pu/src/main/webapp/WEB-INF/web.xml
> [3]
> https://rmannibucau.wordpress.com/2014/04/24/ejbcontainerrunner-or-test-with-ejbcontainer-easily/#comments
> [4] http://stackoverflow.com/q/2279913/269514
>
>
>
> --
> View this message in context: http://tomee-openejb.979440.n4.nabble.com/org-postgresql-xa-PGXADataSource-cannot-be-cast-to-java-sql-Driver-TomEE-7-0-0-M3-tp4678050.html
> Sent from the TomEE Users mailing list archive at Nabble.com.