MySQL resource in Tomee 1.5.2

2013-11-02 Thread asif.tmcp
I am putting resources.xml in the WEB-INF Folder, with a resource configuration. Resource id=jdbc/localDB type=javax.sql.DataSource JdbcDriver com.mysql.jdbc.Driver JdbcUrl jdbc:mysql://localhost:3306/localdb MaxActive 100 MaxIdle 30

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread Romain Manni-Bucau
Hi The error is linked to the binding of the resource: either an injection or a datasource name in persistence.xml Le 2 nov. 2013 08:50, asif.tmcp asif.t...@gmail.com a écrit : I am putting resources.xml in the WEB-INF Folder, with a resource configuration. Resource id=jdbc/localDB

HA-JDBC via tomee.xml Resource factory/cluster properties ignored

2013-11-02 Thread Howard W. Smith, Jr.
I'm trying to use HA-JDBC[1] with TomEE to have a cluster of at least 2 databases. As per documentation and forum discussion, I have the following: --- tomee.xml --- Resource id=jdbc/mcmsJta type=javax.sql.DataSource factory=net.sf.hajdbc.sql.DataSourceFactory cluster=cluster UserName

Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored

2013-11-02 Thread Howard W. Smith, Jr.
The following is the workaround: Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource UserName Password JtaManaged true jmxEnabled true LogSql false /Resource and had to rename filename from ha-jdbc-cluster.xml to ha-jdbc-null.xml.

Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored

2013-11-02 Thread Romain Manni-Bucau
Why workaround? That how it works Le 2 nov. 2013 15:48, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : The following is the workaround: Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource UserName Password JtaManaged true

Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored

2013-11-02 Thread Howard W. Smith, Jr.
now, i know, thanks! :) On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau rmannibu...@gmail.comwrote: Why workaround? That how it works Le 2 nov. 2013 15:48, Howard W. Smith, Jr. smithh032...@gmail.com a écrit : The following is the workaround: Resource id=jdbc/mcmsJta

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread asif.tmcp
Hi Romain, Thanks for taking a look. But I am Not sure what you meant .. could you please elaborate. I have the resource configuration in tomee.xml and the following in web.xml. resource-ref descriptionMySQL Connection/description

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread asif.tmcp
Sorry the code got messed up. The java code is as follows:- InitialContext ic = new InitialContext(); Context envCtx = (Context) ic.lookup(java:comp/env); DataSource ds = (DataSource)envCtx.lookup(jdbc/SentinelDB); -- View this message in context:

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread Romain Manni-Bucau
Do you have logs saying a resource is adjusted? Le 2 nov. 2013 17:16, asif.tmcp asif.t...@gmail.com a écrit : Sorry the code got messed up. The java code is as follows:- InitialContext ic = new InitialContext(); Context envCtx = (Context) ic.lookup(java:comp/env);

Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored

2013-11-02 Thread Howard W. Smith, Jr.
Per [Avoid properties conflict when configuring TomEE DataSource][1], I added ignoreDefaultValues=true to Resource in tomee.xml, Resource id=jdbc/mcmsJta type=javax.sql.DataSource JdbcDriver net.sf.hajdbc.sql.DataSource IgnoreDefaultValues true JtaManaged true jmxEnabled true LogSql

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread asif.tmcp
Nope, it just mentions creating a default database, although resources.xml exists:- Nov 02, 2013 3:27:08 PM org.apache.tomee.catalina.TomEEClassLoaderEnricher validateJarFile WARNING: jar 'D:\dev_wksd\eclipse-wksd\devel\Sentinel\war\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar' contains

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread Romain Manni-Bucau
Cause id and resource name are different Le 2 nov. 2013 20:34, asif.tmcp asif.t...@gmail.com a écrit : Nope, it just mentions creating a default database, although resources.xml exists:- Nov 02, 2013 3:27:08 PM org.apache.tomee.catalina.TomEEClassLoaderEnricher validateJarFile WARNING: jar

Re: MySQL resource in Tomee 1.5.2

2013-11-02 Thread Romain Manni-Bucau
Ps: in 1.5.2 lookup of resource in resources.xml needed to add a prefix. Thats ok on trunk Le 2 nov. 2013 20:40, Romain Manni-Bucau rmannibu...@gmail.com a écrit : Cause id and resource name are different Le 2 nov. 2013 20:34, asif.tmcp asif.t...@gmail.com a écrit : Nope, it just mentions

Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored

2013-11-02 Thread Howard W. Smith, Jr.
okay, I'm seeing what you said (not get jta as easily, when using context.xml). thanks. On Sat, Nov 2, 2013 at 3:39 PM, Romain Manni-Bucau rmannibu...@gmail.comwrote: If you use context.xml youll not get as easily jta. You can set Resource attribute class-name to the impl class and setXxx

[test resources] persistence.xml

2013-11-02 Thread Matthias Wessendorf
Hi, when running unit tests - where I have a src/test/resources/META-INF/persistence.xml file - I am wondering why the one in src/main is also included. Wouldn't the one in test be the 'right' one ? See also [1] -Matthias [1]

ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl

2013-11-02 Thread Matthias Wessendorf
Hello! On trunk, when removing the provider element of the persistence.xml ([1]) the openejb-core-hibernate module assumes that the OpenJPA impl. should be used. However, the test here fails, since it can not find the OpenJPA implementation; See stacktrace below. -Matthias [1]

Re: ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl

2013-11-02 Thread Jean-Louis MONTEIRO
Hi Matthias, The openejb-core-hibernate is just a helper pom. It aims at providing a easy way from an end user point of view to use Hibernate as the JPA provider instead of OpenJPA by default. The pom just excludes OpenJPA and includes Hibernate. If you wanna use OpenJPA, you have to use

Re: ClassNotFoundException: org.apache.openjpa.persistence.PersistenceProviderImpl

2013-11-02 Thread John D. Ament
Also, I believe this is expected behavior per EE specs. The container may have a default provider, which an app can leverage. In containers like WebLogic, you can configure a different default but that requires specific configuration. Maybe it's possible to configure OpenEJB/TomEE to have a

Re: HA-JDBC via tomee.xml Resource factory/cluster properties ignored

2013-11-02 Thread Howard W. Smith, Jr.
trying to get it done via tomee.xml, ha-jdbc-cluster.xml, and java option -Dha-jdbc... seems to help, but i definitely need help...i been reporting my progress with this on ha-jdbc forum[1]... i hope to get some help with this, soon. [1]