Thanks again for you help,
I finally managed to make it works on TomEE 1.7 and 7.
This is the changes I had to do:
- Remove the database related properties from the persistence.xml
- Replace <non-jta-data-source> tag by
<jta-data-source>myDatasource</jta-data-source> in persistence.xml
- Put the mysql connector jar in my server /lib
- In my server /conf/tomee.xml I have add myDatasource configuration as a
resource
<Resource id="myDatasource" type="DataSource">
JdbcDriver com.mysql.jdbc.Driver
JdbcUrl jdbc:mysql://localhost:3306/notes_eleves
UserName root
</Resource>
- Put @XmlRootElement(name = "eleve") over my Eleve entity (this seems to be
only mandatory on TomEE 1.7)
By the way i have read the http://tomee.apache.org/datasource-config.html
<http://tomee.apache.org/datasource-config.html> and it says that "A
DataSource can be declared via xml in the <tomee-home>/conf/tomee.xml file
or in a WEB-INF/resources.xml file using a declaration like the following.
All properties in the element body are optional." Should the
WEB-INF/resources.xml be taken in account using EE ? because I tried to use
this (/src/main/resources/META-INF/resources.xml) but it seems to be ignore
--
View this message in context:
http://tomee-openejb.979440.n4.nabble.com/JavaEE-eclipseLink-TomEE-gives-java-sql-SQLSyntaxErrorException-user-lacks-privilege-or-object-not-fd-tp4679015p4679023.html
Sent from the TomEE Users mailing list archive at Nabble.com.