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 
   MaxWait 1
   UserName username
   Password password 
/Resource

Unfortunately, tomee single mindedly tries to load the hsqldb and then
report a vague issue

java.sql.SQLSyntaxErrorException: user lacks privilege or object not found:
USERS
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
at org.hsqldb.jdbc.Util.sqlException(Unknown Source)

If I put the resource in the tomee.xml in conf folder Sometimes it works.

Environment: Windows 7 ; Eclipse : Tomee 1.5.2

Tested as a war on tomee 1.5.2  - the error still exists.

A similar problem is reported here 
http://openejb.979440.n4.nabble.com/Unable-to-configure-MYSQL-resource-in-tomee-xml-td4659538i20.html
and here
https://issues.apache.org/jira/browse/TOMEE-924

- any ideas? Resolutions?

Thanks and Regards.



--
View this message in context: 
http://openejb.979440.n4.nabble.com/MySQL-resource-in-Tomee-1-5-2-tp4665872.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


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 type=javax.sql.DataSource
JdbcDriver com.mysql.jdbc.Driver
JdbcUrl jdbc:mysql://localhost:3306/localdb
MaxActive 100
MaxIdle 30
MaxWait 1
UserName username
Password password
 /Resource

 Unfortunately, tomee single mindedly tries to load the hsqldb and then
 report a vague issue

 java.sql.SQLSyntaxErrorException: user lacks privilege or object not found:
 USERS
 at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
 at org.hsqldb.jdbc.Util.sqlException(Unknown Source)

 If I put the resource in the tomee.xml in conf folder Sometimes it works.

 Environment: Windows 7 ; Eclipse : Tomee 1.5.2

 Tested as a war on tomee 1.5.2  - the error still exists.

 A similar problem is reported here

 http://openejb.979440.n4.nabble.com/Unable-to-configure-MYSQL-resource-in-tomee-xml-td4659538i20.html
 and here
 https://issues.apache.org/jira/browse/TOMEE-924

 - any ideas? Resolutions?

 Thanks and Regards.



 --
 View this message in context:
 http://openejb.979440.n4.nabble.com/MySQL-resource-in-Tomee-1-5-2-tp4665872.html
 Sent from the OpenEJB User mailing list archive at Nabble.com.



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 
  Password ...
  JtaManaged true
  jmxEnabled true
  LogSql false
/Resource

--- ha-jdbc-cluster.xml ---

?xml version=1.0 encoding=UTF-8?
ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1
sync id=full
   property name=fetchSize1000/property
/sync
sync id=diff
   property name=fetchSize1000/property
   property name=versionPatternversion/property
/sync
state id=simple/
cluster dialect=derby balancer=simple default-sync=full
meta-data-cache=lazy transaction-mode=parallel
database id=db1 weight=1
location=org.apache.tomcat.jdbc.pool.DataSource
user.../user
password.../password
property name=serverNamemcms/property
property name=databaseNamemcms/property
property
name=driverorg.apache.derby.jdbc.EmbeddedDriver/property
property
name=urljdbc:derby:c:/javadb/databases/mcms;create=true/property
property name=InitialSize10/property
property name=MaxActive100/property
property name=MaxIdle30/property
property name=MaxWait1/property
property name=minIdle10/property
property name=suspectTimeout60/property
property name=removeAbandonedtrue/property
property name=removeAbandonedTimeout180/property
property name=timeBetweenEvictionRunsMillis3/property
property
name=jdbcInterceptorsStatementCache(max=128)/property
/database
database id=db2 weight=2
location=org.apache.tomcat.jdbc.pool.DataSource
user.../user
password.../password
property name=serverNamemcms/property
property name=databaseNamemcms/property
property
name=driverorg.apache.derby.jdbc.EmbeddedDriver/property
property
name=urljdbc:derby:c:/javadb/databases/mcmsdev;create=true/property
property name=InitialSize10/property
property name=MaxActive100/property
property name=MaxIdle30/property
property name=MaxWait1/property
property name=minIdle10/property
property name=suspectTimeout60/property
property name=removeAbandonedtrue/property
property name=removeAbandonedTimeout180/property
property name=timeBetweenEvictionRunsMillis3/property
property
name=jdbcInterceptorsStatementCache(max=128)/property
/database
/cluster
/ha-jdbc


which results in the following in the log:


INFO: Creating Resource(id=jdbc/mcmsJta)

Nov 02, 2013 9:15:03 AM
org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly
INFO: Disabling testOnBorrow since no validation query is provided

Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
logUnusedProperties
WARNING: Property factory not supported by jdbc/mcmsJta

Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
logUnusedProperties
WARNING: Property cluster not supported by jdbc/mcmsJta

Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
createRecipe


now, my app is not connecting to my database, and it is trying to use
default database connection (hsqldb, which is probably the non-jta database
which is configured automatically by tomee, if/when 'no' non-jta database
is configured/specified in tomee.xml via Resource ... /.

Should I move the Resource .../ from tomee.xml to (webapp)
META-INF/context.xml as recommended here[2]?


[1] http://ha-jdbc.github.io/
[2] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/4707f208/


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.

still getting errors, but they are related to ha-jdbc, now.


On Sat, Nov 2, 2013 at 9:49 AM, Howard W. Smith, Jr. smithh032...@gmail.com
 wrote:

 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 
   Password ...
   JtaManaged true
   jmxEnabled true
   LogSql false
 /Resource

 --- ha-jdbc-cluster.xml ---

 ?xml version=1.0 encoding=UTF-8?
 ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1
 sync id=full
property name=fetchSize1000/property
 /sync
 sync id=diff
property name=fetchSize1000/property
property name=versionPatternversion/property
 /sync
 state id=simple/
 cluster dialect=derby balancer=simple default-sync=full
 meta-data-cache=lazy transaction-mode=parallel
 database id=db1 weight=1
 location=org.apache.tomcat.jdbc.pool.DataSource
 user.../user
 password.../password
 property name=serverNamemcms/property
 property name=databaseNamemcms/property
 property
 name=driverorg.apache.derby.jdbc.EmbeddedDriver/property
 property
 name=urljdbc:derby:c:/javadb/databases/mcms;create=true/property
 property name=InitialSize10/property
 property name=MaxActive100/property
 property name=MaxIdle30/property
 property name=MaxWait1/property
 property name=minIdle10/property
 property name=suspectTimeout60/property
 property name=removeAbandonedtrue/property
 property name=removeAbandonedTimeout180/property
 property name=timeBetweenEvictionRunsMillis3/property
 property
 name=jdbcInterceptorsStatementCache(max=128)/property
 /database
 database id=db2 weight=2
 location=org.apache.tomcat.jdbc.pool.DataSource
 user.../user
 password.../password
 property name=serverNamemcms/property
 property name=databaseNamemcms/property
 property
 name=driverorg.apache.derby.jdbc.EmbeddedDriver/property
 property
 name=urljdbc:derby:c:/javadb/databases/mcmsdev;create=true/property
 property name=InitialSize10/property
 property name=MaxActive100/property
 property name=MaxIdle30/property
 property name=MaxWait1/property
 property name=minIdle10/property
 property name=suspectTimeout60/property
 property name=removeAbandonedtrue/property
 property name=removeAbandonedTimeout180/property
 property name=timeBetweenEvictionRunsMillis3/property
 property
 name=jdbcInterceptorsStatementCache(max=128)/property
 /database
 /cluster
 /ha-jdbc


 which results in the following in the log:


 INFO: Creating Resource(id=jdbc/mcmsJta)

 Nov 02, 2013 9:15:03 AM
 org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly
 INFO: Disabling testOnBorrow since no validation query is provided

 Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
 logUnusedProperties
 WARNING: Property factory not supported by jdbc/mcmsJta

 Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
 logUnusedProperties
 WARNING: Property cluster not supported by jdbc/mcmsJta

 Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
 createRecipe


 now, my app is not connecting to my database, and it is trying to use
 default database connection (hsqldb, which is probably the non-jta database
 which is configured automatically by tomee, if/when 'no' non-jta database
 is configured/specified in tomee.xml via Resource ... /.

 Should I move the Resource .../ from tomee.xml to (webapp)
 META-INF/context.xml as recommended here[2]?


 [1] http://ha-jdbc.github.io/
 [2] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/4707f208/




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
   jmxEnabled true
   LogSql false
 /Resource

 and had to rename filename from ha-jdbc-cluster.xml to ha-jdbc-null.xml.

 still getting errors, but they are related to ha-jdbc, now.


 On Sat, Nov 2, 2013 at 9:49 AM, Howard W. Smith, Jr. 
 smithh032...@gmail.com
  wrote:

  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 
Password ...
JtaManaged true
jmxEnabled true
LogSql false
  /Resource
 
  --- ha-jdbc-cluster.xml ---
 
  ?xml version=1.0 encoding=UTF-8?
  ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1
  sync id=full
 property name=fetchSize1000/property
  /sync
  sync id=diff
 property name=fetchSize1000/property
 property name=versionPatternversion/property
  /sync
  state id=simple/
  cluster dialect=derby balancer=simple default-sync=full
  meta-data-cache=lazy transaction-mode=parallel
  database id=db1 weight=1
  location=org.apache.tomcat.jdbc.pool.DataSource
  user.../user
  password.../password
  property name=serverNamemcms/property
  property name=databaseNamemcms/property
  property
  name=driverorg.apache.derby.jdbc.EmbeddedDriver/property
  property
  name=urljdbc:derby:c:/javadb/databases/mcms;create=true/property
  property name=InitialSize10/property
  property name=MaxActive100/property
  property name=MaxIdle30/property
  property name=MaxWait1/property
  property name=minIdle10/property
  property name=suspectTimeout60/property
  property name=removeAbandonedtrue/property
  property name=removeAbandonedTimeout180/property
  property
 name=timeBetweenEvictionRunsMillis3/property
  property
  name=jdbcInterceptorsStatementCache(max=128)/property
  /database
  database id=db2 weight=2
  location=org.apache.tomcat.jdbc.pool.DataSource
  user.../user
  password.../password
  property name=serverNamemcms/property
  property name=databaseNamemcms/property
  property
  name=driverorg.apache.derby.jdbc.EmbeddedDriver/property
  property
  name=urljdbc:derby:c:/javadb/databases/mcmsdev;create=true/property
  property name=InitialSize10/property
  property name=MaxActive100/property
  property name=MaxIdle30/property
  property name=MaxWait1/property
  property name=minIdle10/property
  property name=suspectTimeout60/property
  property name=removeAbandonedtrue/property
  property name=removeAbandonedTimeout180/property
  property
 name=timeBetweenEvictionRunsMillis3/property
  property
  name=jdbcInterceptorsStatementCache(max=128)/property
  /database
  /cluster
  /ha-jdbc
 
 
  which results in the following in the log:
 
 
  INFO: Creating Resource(id=jdbc/mcmsJta)
 
  Nov 02, 2013 9:15:03 AM
  org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly
  INFO: Disabling testOnBorrow since no validation query is provided
 
  Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
  logUnusedProperties
  WARNING: Property factory not supported by jdbc/mcmsJta
 
  Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
  logUnusedProperties
  WARNING: Property cluster not supported by jdbc/mcmsJta
 
  Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
  createRecipe
 
 
  now, my app is not connecting to my database, and it is trying to use
  default database connection (hsqldb, which is probably the non-jta
 database
  which is configured automatically by tomee, if/when 'no' non-jta database
  is configured/specified in tomee.xml via Resource ... /.
 
  Should I move the Resource .../ from tomee.xml to (webapp)
  META-INF/context.xml as recommended here[2]?
 
 
  [1] http://ha-jdbc.github.io/
  [2] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/4707f208/
 
 



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 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.
 
  still getting errors, but they are related to ha-jdbc, now.
 
 
  On Sat, Nov 2, 2013 at 9:49 AM, Howard W. Smith, Jr. 
  smithh032...@gmail.com
   wrote:
 
   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 
 Password ...
 JtaManaged true
 jmxEnabled true
 LogSql false
   /Resource
  
   --- ha-jdbc-cluster.xml ---
  
   ?xml version=1.0 encoding=UTF-8?
   ha-jdbc xmlns=urn:ha-jdbc:cluster:2.1
   sync id=full
  property name=fetchSize1000/property
   /sync
   sync id=diff
  property name=fetchSize1000/property
  property name=versionPatternversion/property
   /sync
   state id=simple/
   cluster dialect=derby balancer=simple default-sync=full
   meta-data-cache=lazy transaction-mode=parallel
   database id=db1 weight=1
   location=org.apache.tomcat.jdbc.pool.DataSource
   user.../user
   password.../password
   property name=serverNamemcms/property
   property name=databaseNamemcms/property
   property
   name=driverorg.apache.derby.jdbc.EmbeddedDriver/property
   property
   name=urljdbc:derby:c:/javadb/databases/mcms;create=true/property
   property name=InitialSize10/property
   property name=MaxActive100/property
   property name=MaxIdle30/property
   property name=MaxWait1/property
   property name=minIdle10/property
   property name=suspectTimeout60/property
   property name=removeAbandonedtrue/property
   property name=removeAbandonedTimeout180/property
   property
  name=timeBetweenEvictionRunsMillis3/property
   property
   name=jdbcInterceptorsStatementCache(max=128)/property
   /database
   database id=db2 weight=2
   location=org.apache.tomcat.jdbc.pool.DataSource
   user.../user
   password.../password
   property name=serverNamemcms/property
   property name=databaseNamemcms/property
   property
   name=driverorg.apache.derby.jdbc.EmbeddedDriver/property
   property
  
 name=urljdbc:derby:c:/javadb/databases/mcmsdev;create=true/property
   property name=InitialSize10/property
   property name=MaxActive100/property
   property name=MaxIdle30/property
   property name=MaxWait1/property
   property name=minIdle10/property
   property name=suspectTimeout60/property
   property name=removeAbandonedtrue/property
   property name=removeAbandonedTimeout180/property
   property
  name=timeBetweenEvictionRunsMillis3/property
   property
   name=jdbcInterceptorsStatementCache(max=128)/property
   /database
   /cluster
   /ha-jdbc
  
  
   which results in the following in the log:
  
  
   INFO: Creating Resource(id=jdbc/mcmsJta)
  
   Nov 02, 2013 9:15:03 AM
   org.apache.tomee.jdbc.TomEEDataSourceCreator$TomEEDataSource readOnly
   INFO: Disabling testOnBorrow since no validation query is provided
  
   Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
   logUnusedProperties
   WARNING: Property factory not supported by jdbc/mcmsJta
  
   Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
   logUnusedProperties
   WARNING: Property cluster not supported by jdbc/mcmsJta
  
   Nov 02, 2013 9:15:03 AM org.apache.openejb.assembler.classic.Assembler
   createRecipe
  
  
   now, my app is not connecting to my database, and it is trying to use
   default database connection (hsqldb, which is probably the non-jta
  database
   which is configured automatically by tomee, if/when 'no' non-jta
 database
   is configured/specified in tomee.xml via Resource ... /.
  
   Should I move the Resource .../ from tomee.xml to (webapp)
   META-INF/context.xml as recommended here[2]?
  
  
   [1] http://ha-jdbc.github.io/
   [2]
 https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/4707f208/
  
  
 



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
res-ref-namejdbc/localDB/res-ref-name
res-typejavax.sql.DataSource/res-type
res-authContainer/res-auth
/resource-ref

In the code , I try to access it with 
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)envCtx.lookup(jdbc/SentinelDB);


If I put the resources in tomee.xml , it works fine. However, if I put it in
resources.xml in the WEB-INF folder for the app, then I get the error.




--
View this message in context: 
http://openejb.979440.n4.nabble.com/MySQL-resource-in-Tomee-1-5-2-tp4665872p4665878.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


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: 
http://openejb.979440.n4.nabble.com/MySQL-resource-in-Tomee-1-5-2-tp4665872p4665879.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


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);
 DataSource ds = (DataSource)envCtx.lookup(jdbc/SentinelDB);




 --
 View this message in context:
 http://openejb.979440.n4.nabble.com/MySQL-resource-in-Tomee-1-5-2-tp4665872p4665879.html
 Sent from the OpenEJB User mailing list archive at Nabble.com.



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 false
/Resource

and the result are the [exceptions in the log file][2].

the exceptions seem to prove that I need to add the following to Resource
.../

cluster=...
factory=...

can you please advise how I can add these two parameters to Resource .../
in tomee.xml, or should I revert to META-INF/context.xml?


[1]:
http://rmannibucau.wordpress.com/2012/11/08/avoid-properties-conflict-when-configuring-tomee-datasource/
[2]: https://gist.github.com/smithh032772/7279765#file-log3-txt




On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau
rmannibu...@gmail.comwrote:

 Why workaround? That how it works


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 offending class: javax.persistence.Entity. It will be ignored.
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\persistence-api-1.0.jar'
contains offending class: javax.persistence.Entity. It will be ignored.
Nov 02, 2013 3:27:09 PM org.apache.openejb.config.ConfigurationFactory
configureApplication
INFO: Configuring enterprise application:
D:\dev_wksd\eclipse-wksd\devel\Sentinel\war
Nov 02, 2013 3:27:09 PM org.apache.openejb.config.ConfigurationFactory
configureService
INFO: Configuring Service(id=Default JDBC Database, type=Resource,
provider-id=Default JDBC Database)
Nov 02, 2013 3:27:09 PM org.apache.openejb.config.AutoConfig
logAutoCreateResource
INFO: Auto-creating a Resource with id 'Default JDBC Database' of type
'javax.sql.DataSource for 'Sentinel'.
Nov 02, 2013 3:27:09 PM org.apache.openejb.assembler.classic.Assembler
createRecipe
INFO: Creating Resource(id=Default JDBC Database)
Nov 02, 2013 3:27:09 PM org.apache.openejb.config.AppInfoBuilder build
INFO: Enterprise application D:\dev_wksd\eclipse-wksd\devel\Sentinel\war
loaded.
Nov 02, 2013 3:27:09 PM org.apache.openejb.assembler.classic.Assembler
createApplication
INFO: Assembling app: D:\dev_wksd\eclipse-wksd\devel\Sentinel\war
Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.CdiBuilder initSingleton
INFO: Existing thread singleton service in SystemInstance():
org.apache.openejb.cdi.ThreadSingletonServiceImpl@42e3f9e3
Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.OpenEJBLifecycle
startApplication
INFO: OpenWebBeans Container is starting...
Nov 02, 2013 3:27:09 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
Nov 02, 2013 3:27:09 PM org.apache.webbeans.plugins.PluginLoader startUp
INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.BeansDeployer
validateInjectionPoints
INFO: All injection points are validated successfully.
Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.OpenEJBLifecycle
startApplication
INFO: OpenWebBeans Container has started, it took 3 ms.
Nov 02, 2013 3:27:09 PM org.apache.openejb.assembler.classic.Assembler
createApplication
INFO: Deployed Application(path=D:\dev_wksd\eclipse-wksd\devel\Sentinel\war)
Nov 02, 2013 3:27:10 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Shiro environment
Nov 02, 2013 3:27:10 PM org.apache.catalina.startup.HostConfig
deployDirectory
INFO: Deploying web application directory
D:\dev_wksd\eclipse-wksd\devel\server\apache-tomee-plus-1.5.2\webapps\docs
Nov 02, 2013 3:27:10 PM org.apache.tomee.catalina.TomcatWebAppBuilder init



--
View this message in context: 
http://openejb.979440.n4.nabble.com/MySQL-resource-in-Tomee-1-5-2-tp4665872p4665882.html
Sent from the OpenEJB User mailing list archive at Nabble.com.


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

 'D:\dev_wksd\eclipse-wksd\devel\Sentinel\war\WEB-INF\lib\hibernate-jpa-2.0-api-1.0.1.Final.jar'
 contains offending class: javax.persistence.Entity. It will be ignored.
 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\persistence-api-1.0.jar'
 contains offending class: javax.persistence.Entity. It will be ignored.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.config.ConfigurationFactory
 configureApplication
 INFO: Configuring enterprise application:
 D:\dev_wksd\eclipse-wksd\devel\Sentinel\war
 Nov 02, 2013 3:27:09 PM org.apache.openejb.config.ConfigurationFactory
 configureService
 INFO: Configuring Service(id=Default JDBC Database, type=Resource,
 provider-id=Default JDBC Database)
 Nov 02, 2013 3:27:09 PM org.apache.openejb.config.AutoConfig
 logAutoCreateResource
 INFO: Auto-creating a Resource with id 'Default JDBC Database' of type
 'javax.sql.DataSource for 'Sentinel'.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.assembler.classic.Assembler
 createRecipe
 INFO: Creating Resource(id=Default JDBC Database)
 Nov 02, 2013 3:27:09 PM org.apache.openejb.config.AppInfoBuilder build
 INFO: Enterprise application D:\dev_wksd\eclipse-wksd\devel\Sentinel\war
 loaded.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.assembler.classic.Assembler
 createApplication
 INFO: Assembling app: D:\dev_wksd\eclipse-wksd\devel\Sentinel\war
 Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.CdiBuilder initSingleton
 INFO: Existing thread singleton service in SystemInstance():
 org.apache.openejb.cdi.ThreadSingletonServiceImpl@42e3f9e3
 Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.OpenEJBLifecycle
 startApplication
 INFO: OpenWebBeans Container is starting...
 Nov 02, 2013 3:27:09 PM org.apache.webbeans.plugins.PluginLoader startUp
 INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
 Nov 02, 2013 3:27:09 PM org.apache.webbeans.plugins.PluginLoader startUp
 INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
 Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.BeansDeployer
 validateInjectionPoints
 INFO: All injection points are validated successfully.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.OpenEJBLifecycle
 startApplication
 INFO: OpenWebBeans Container has started, it took 3 ms.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.assembler.classic.Assembler
 createApplication
 INFO: Deployed
 Application(path=D:\dev_wksd\eclipse-wksd\devel\Sentinel\war)
 Nov 02, 2013 3:27:10 PM org.apache.catalina.core.ApplicationContext log
 INFO: Initializing Shiro environment
 Nov 02, 2013 3:27:10 PM org.apache.catalina.startup.HostConfig
 deployDirectory
 INFO: Deploying web application directory
 D:\dev_wksd\eclipse-wksd\devel\server\apache-tomee-plus-1.5.2\webapps\docs
 Nov 02, 2013 3:27:10 PM org.apache.tomee.catalina.TomcatWebAppBuilder init



 --
 View this message in context:
 http://openejb.979440.n4.nabble.com/MySQL-resource-in-Tomee-1-5-2-tp4665872p4665882.html
 Sent from the OpenEJB User mailing list archive at Nabble.com.



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 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 offending class: javax.persistence.Entity. It will be ignored.
 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\persistence-api-1.0.jar'
 contains offending class: javax.persistence.Entity. It will be ignored.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.config.ConfigurationFactory
 configureApplication
 INFO: Configuring enterprise application:
 D:\dev_wksd\eclipse-wksd\devel\Sentinel\war
 Nov 02, 2013 3:27:09 PM org.apache.openejb.config.ConfigurationFactory
 configureService
 INFO: Configuring Service(id=Default JDBC Database, type=Resource,
 provider-id=Default JDBC Database)
 Nov 02, 2013 3:27:09 PM org.apache.openejb.config.AutoConfig
 logAutoCreateResource
 INFO: Auto-creating a Resource with id 'Default JDBC Database' of type
 'javax.sql.DataSource for 'Sentinel'.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.assembler.classic.Assembler
 createRecipe
 INFO: Creating Resource(id=Default JDBC Database)
 Nov 02, 2013 3:27:09 PM org.apache.openejb.config.AppInfoBuilder build
 INFO: Enterprise application D:\dev_wksd\eclipse-wksd\devel\Sentinel\war
 loaded.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.assembler.classic.Assembler
 createApplication
 INFO: Assembling app: D:\dev_wksd\eclipse-wksd\devel\Sentinel\war
 Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.CdiBuilder initSingleton
 INFO: Existing thread singleton service in SystemInstance():
 org.apache.openejb.cdi.ThreadSingletonServiceImpl@42e3f9e3
 Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.OpenEJBLifecycle
 startApplication
 INFO: OpenWebBeans Container is starting...
 Nov 02, 2013 3:27:09 PM org.apache.webbeans.plugins.PluginLoader startUp
 INFO: Adding OpenWebBeansPlugin : [CdiPlugin]
 Nov 02, 2013 3:27:09 PM org.apache.webbeans.plugins.PluginLoader startUp
 INFO: Adding OpenWebBeansPlugin : [OpenWebBeansJsfPlugin]
 Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.BeansDeployer
 validateInjectionPoints
 INFO: All injection points are validated successfully.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.cdi.OpenEJBLifecycle
 startApplication
 INFO: OpenWebBeans Container has started, it took 3 ms.
 Nov 02, 2013 3:27:09 PM org.apache.openejb.assembler.classic.Assembler
 createApplication
 INFO: Deployed
 Application(path=D:\dev_wksd\eclipse-wksd\devel\Sentinel\war)
 Nov 02, 2013 3:27:10 PM org.apache.catalina.core.ApplicationContext log
 INFO: Initializing Shiro environment
 Nov 02, 2013 3:27:10 PM org.apache.catalina.startup.HostConfig
 deployDirectory
 INFO: Deploying web application directory
 D:\dev_wksd\eclipse-wksd\devel\server\apache-tomee-plus-1.5.2\webapps\docs
 Nov 02, 2013 3:27:10 PM org.apache.tomee.catalina.TomcatWebAppBuilder init



 --
 View this message in context:
 http://openejb.979440.n4.nabble.com/MySQL-resource-in-Tomee-1-5-2-tp4665872p4665882.html
 Sent from the OpenEJB User mailing list archive at Nabble.com.




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
 using xxx as property attribute (factory for instance)
 Le 2 nov. 2013 18:10, Howard W. Smith, Jr. smithh032...@gmail.com a
 écrit :

  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 false
  /Resource
 
  and the result are the [exceptions in the log file][2].
 
  the exceptions seem to prove that I need to add the following to
 Resource
  .../
 
  cluster=...
  factory=...
 
  can you please advise how I can add these two parameters to Resource
 .../
  in tomee.xml, or should I revert to META-INF/context.xml?
 
 
  [1]:
 
 
 http://rmannibucau.wordpress.com/2012/11/08/avoid-properties-conflict-when-configuring-tomee-datasource/
  [2]: https://gist.github.com/smithh032772/7279765#file-log3-txt
 
 
 
 
  On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau
  rmannibu...@gmail.comwrote:
 
   Why workaround? That how it works
 



[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]
https://github.com/matzew/tomee/blob/trunk/examples/jpa-hibernate/src/test/resources/META-INF/persistence.xml


From the LOG (note the 'PersistenceUnit(name=movie-unit-TEST' and the
'PersistenceUnit(name=movie-unit'):




INFO - Configuring PersistenceUnit(name=movie-unit-TEST,
provider=org.hibernate.ejb.HibernatePersistence)
INFO - Auto-creating a Resource with id 'movieDatabaseNonJta' of type
'DataSource for 'movie-unit-TEST'.
INFO - Configuring Service(id=movieDatabaseNonJta, type=Resource,
provider-id=movieDatabase)
INFO - Creating Resource(id=movieDatabaseNonJta)
INFO - Adjusting PersistenceUnit movie-unit-TEST non-jta-data-source to
Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
INFO - Configuring PersistenceUnit(name=movie-unit,
provider=org.hibernate.ejb.HibernatePersistence)
INFO - Adjusting PersistenceUnit movie-unit non-jta-data-source to
Resource ID 'movieDatabaseNonJta' from 'movieDatabaseUnmanaged'
INFO - Enterprise application
/Users/matzew/TEMP/TomEEFix/examples/jpa-hibernate loaded.
INFO - Assembling app: /Users/matzew/TEMP/TomEEFix/examples/jpa-hibernate
INFO - HV01: Hibernate Validator 4.3.0.Final
INFO - HV02: Ignoring XML configuration.
INFO - HV02: Ignoring XML configuration.
INFO - HCANN01: Hibernate Commons Annotations {4.0.1.Final}
INFO - HHH000412: Hibernate Core {4.1.8.Final}
INFO - HHH000206: hibernate.properties not found
INFO - HHH21: Bytecode provider name : javassist
INFO - HHH000204: Processing PersistenceUnitInfo [
name: movie-unit-TEST
...]
INFO - HHH000130: Instantiating explicit connection provider:
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
INFO - HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect
INFO - HHH000268: Transaction strategy:
org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
INFO - HHH000397: Using ASTQueryTranslatorFactory
INFO - HHH000227: Running hbm2ddl schema export
INFO - HHH000230: Schema export complete
INFO - PersistenceUnit(name=movie-unit-TEST,
provider=org.hibernate.ejb.HibernatePersistence) - provider time 2143ms
INFO - HHH000204: Processing PersistenceUnitInfo [
name: movie-unit
...]
INFO - HHH000130: Instantiating explicit connection provider:
org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
INFO - HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect
INFO - HHH000268: Transaction strategy:
org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
INFO - HHH000397: Using ASTQueryTranslatorFactory
INFO - HHH000227: Running hbm2ddl schema export
INFO - HHH000230: Schema export complete
INFO - PersistenceUnit(name=movie-unit,
provider=org.hibernate.ejb.HibernatePersistence) - provider time 673ms


-- 
Matthias Wessendorf

blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
twitter: http://twitter.com/mwessendorf


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]
https://github.com/apache/tomee/blob/trunk/examples/jpa-hibernate/src/main/resources/META-INF/persistence.xml#L24



org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
org.apache.openejb.OpenEJBException: Creating application failed:
/Users/matzew/TEMP/TomEE/examples/jpa-hibernate:
org.apache.openejb.OpenEJBRuntimeException:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:419)
at
javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
at org.superbiz.injection.h3jpa.MoviesTest.test(MoviesTest.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:243)
at junit.framework.TestSuite.run(TestSuite.java:238)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
at
org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
at
org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
Caused by: org.apache.openejb.OpenEJBException: Creating application
failed: /Users/matzew/TEMP/TomEE/examples/jpa-hibernate:
org.apache.openejb.OpenEJBRuntimeException:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:897)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
at
org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:415)
... 27 more
Caused by: org.apache.openejb.OpenEJBException:
org.apache.openejb.OpenEJBRuntimeException:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:758)
... 29 more
Caused by: org.apache.openejb.OpenEJBRuntimeException:
java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:117)
at
org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.init(ReloadableEntityManagerFactory.java:101)
at
org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:150)
at
org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:752)
... 29 more
Caused by: java.lang.ClassNotFoundException:
org.apache.openjpa.persistence.PersistenceProviderImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:356)

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 openejb-core instead of
openejb-core-hibernate.

Hope it helps
JLouis



2013/11/3 Matthias Wessendorf mat...@apache.org

 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]

 https://github.com/apache/tomee/blob/trunk/examples/jpa-hibernate/src/main/resources/META-INF/persistence.xml#L24



 org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
 org.apache.openejb.OpenEJBException: Creating application failed:
 /Users/matzew/TEMP/TomEE/examples/jpa-hibernate:
 org.apache.openejb.OpenEJBRuntimeException:
 java.lang.ClassNotFoundException:
 org.apache.openjpa.persistence.PersistenceProviderImpl:
 java.lang.ClassNotFoundException:
 org.apache.openjpa.persistence.PersistenceProviderImpl
 at

 org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:419)
 at
 javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
 at org.superbiz.injection.h3jpa.MoviesTest.test(MoviesTest.java:37)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:601)
 at junit.framework.TestCase.runTest(TestCase.java:168)
 at junit.framework.TestCase.runBare(TestCase.java:134)
 at junit.framework.TestResult$1.protect(TestResult.java:110)
 at junit.framework.TestResult.runProtected(TestResult.java:128)
 at junit.framework.TestResult.run(TestResult.java:113)
 at junit.framework.TestCase.run(TestCase.java:124)
 at junit.framework.TestSuite.runTest(TestSuite.java:243)
 at junit.framework.TestSuite.run(TestSuite.java:238)
 at

 org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
 at

 org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
 at

 org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
 at

 org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at

 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 at

 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:601)
 at

 org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
 at

 org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
 at

 org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
 at

 org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
 at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
 Caused by: org.apache.openejb.OpenEJBException: Creating application
 failed: /Users/matzew/TEMP/TomEE/examples/jpa-hibernate:
 org.apache.openejb.OpenEJBRuntimeException:
 java.lang.ClassNotFoundException:
 org.apache.openjpa.persistence.PersistenceProviderImpl:
 java.lang.ClassNotFoundException:
 org.apache.openjpa.persistence.PersistenceProviderImpl
 at

 org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:897)
 at

 org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
 at

 org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:415)
 ... 27 more
 Caused by: org.apache.openejb.OpenEJBException:
 org.apache.openejb.OpenEJBRuntimeException:
 java.lang.ClassNotFoundException:
 org.apache.openjpa.persistence.PersistenceProviderImpl:
 java.lang.ClassNotFoundException:
 org.apache.openjpa.persistence.PersistenceProviderImpl
 at

 org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:758)
 ... 29 more
 Caused by: org.apache.openejb.OpenEJBRuntimeException:
 java.lang.ClassNotFoundException:
 org.apache.openjpa.persistence.PersistenceProviderImpl
 at

 org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.createDelegate(ReloadableEntityManagerFactory.java:117)
 at

 org.apache.openejb.assembler.classic.ReloadableEntityManagerFactory.init(ReloadableEntityManagerFactory.java:101)
 at

 org.apache.openejb.assembler.classic.PersistenceBuilder.createEntityManagerFactory(PersistenceBuilder.java:150)
 at

 org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:752)
 

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 default provider
other than OpenJPA, but I'm not sure how you would package that.


On Sat, Nov 2, 2013 at 7:29 PM, Jean-Louis MONTEIRO jeano...@gmail.comwrote:

 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 openejb-core instead of
 openejb-core-hibernate.

 Hope it helps
 JLouis



 2013/11/3 Matthias Wessendorf mat...@apache.org

  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]
 
 
 https://github.com/apache/tomee/blob/trunk/examples/jpa-hibernate/src/main/resources/META-INF/persistence.xml#L24
 
 
 
  org.apache.openejb.OpenEjbContainer$AssembleApplicationException:
  org.apache.openejb.OpenEJBException: Creating application failed:
  /Users/matzew/TEMP/TomEE/examples/jpa-hibernate:
  org.apache.openejb.OpenEJBRuntimeException:
  java.lang.ClassNotFoundException:
  org.apache.openjpa.persistence.PersistenceProviderImpl:
  java.lang.ClassNotFoundException:
  org.apache.openjpa.persistence.PersistenceProviderImpl
  at
 
 
 org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:419)
  at
 
 javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:56)
  at org.superbiz.injection.h3jpa.MoviesTest.test(MoviesTest.java:37)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
 
 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at
 
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:601)
  at junit.framework.TestCase.runTest(TestCase.java:168)
  at junit.framework.TestCase.runBare(TestCase.java:134)
  at junit.framework.TestResult$1.protect(TestResult.java:110)
  at junit.framework.TestResult.runProtected(TestResult.java:128)
  at junit.framework.TestResult.run(TestResult.java:113)
  at junit.framework.TestCase.run(TestCase.java:124)
  at junit.framework.TestSuite.runTest(TestSuite.java:243)
  at junit.framework.TestSuite.run(TestSuite.java:238)
  at
 
 
 org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
  at
 
 
 org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
  at
 
 
 org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
  at
 
 
 org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at
 
 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
  at
 
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:601)
  at
 
 
 org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
  at
 
 
 org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
  at
 
 
 org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
  at
 
 
 org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
  at
 org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)
  Caused by: org.apache.openejb.OpenEJBException: Creating application
  failed: /Users/matzew/TEMP/TomEE/examples/jpa-hibernate:
  org.apache.openejb.OpenEJBRuntimeException:
  java.lang.ClassNotFoundException:
  org.apache.openjpa.persistence.PersistenceProviderImpl:
  java.lang.ClassNotFoundException:
  org.apache.openjpa.persistence.PersistenceProviderImpl
  at
 
 
 org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:897)
  at
 
 
 org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:612)
  at
 
 
 org.apache.openejb.OpenEjbContainer$Provider.createEJBContainer(OpenEjbContainer.java:415)
  ... 27 more
  Caused by: org.apache.openejb.OpenEJBException:
  org.apache.openejb.OpenEJBRuntimeException:
  java.lang.ClassNotFoundException:
  org.apache.openjpa.persistence.PersistenceProviderImpl:
  java.lang.ClassNotFoundException:
  org.apache.openjpa.persistence.PersistenceProviderImpl
  at
 
 
 org.apache.openejb.assembler.classic.Assembler.createApplication(Assembler.java:758)
  ... 29 more
  Caused 

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] https://sourceforge.net/p/ha-jdbc/discussion/383396/thread/5f4dc302/



On Sat, Nov 2, 2013 at 3:44 PM, Howard W. Smith, Jr. smithh032...@gmail.com
 wrote:

 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
 using xxx as property attribute (factory for instance)
 Le 2 nov. 2013 18:10, Howard W. Smith, Jr. smithh032...@gmail.com a
 écrit :

  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 false
  /Resource
 
  and the result are the [exceptions in the log file][2].
 
  the exceptions seem to prove that I need to add the following to
 Resource
  .../
 
  cluster=...
  factory=...
 
  can you please advise how I can add these two parameters to Resource
 .../
  in tomee.xml, or should I revert to META-INF/context.xml?
 
 
  [1]:
 
 
 http://rmannibucau.wordpress.com/2012/11/08/avoid-properties-conflict-when-configuring-tomee-datasource/
  [2]: https://gist.github.com/smithh032772/7279765#file-log3-txt
 
 
 
 
  On Sat, Nov 2, 2013 at 11:09 AM, Romain Manni-Bucau
  rmannibu...@gmail.comwrote:
 
   Why workaround? That how it works