You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ob...@sonnenkinder.org on 2013/05/06 01:30:10 UTC

TomEE: org.hsqldb.HsqlException despite MySQL-Datasource

Using tomee-webprofile-1.5.2 The following exception is thrown when the 
application tries to access the database:

SEVERE: Servlet.service() for servlet [Faces Servlet] in context with 
path [/DynamicWebProject] threw exception [The bean encountered a 
non-application exception; nested exception is:
     Exception [EclipseLink-4002] (Eclipse Persistence Services - 
2.3.2.v20111125-r10461): 
org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: user lacks 
privilege or object not found: CONTACT_DATA
Error Code: -5501
Call: SELECT t1.ID, t1.company_name, t1.DESCRIPTION, t1.REMARK, 
t1.screen_name, t1.valid_from, t1.valid_until, t1.contact_data_id, 
t1.IMAGE_ID FROM contact_data t0, RESTAURANT t1 WHERE 
(((ABS((t0.LATITUDE - 0.0)) <= 0.08993216059187306) AND 
(ABS((t0.LONGITUDE - 0.0)) <= 0.09009009009009009)) AND (t0.ID = 
t1.contact_data_id))
Query: ReadAllQuery(referenceClass=Restaurant sql="SELECT t1.ID, 
t1.company_name, t1.DESCRIPTION, t1.REMARK, t1.screen_name, 
t1.valid_from, t1.valid_until, t1.contact_data_id, t1.IMAGE_ID FROM 
contact_data t0, RESTAURANT t1 WHERE (((ABS((t0.LATITUDE - ?)) <= ?) AND 
(ABS((t0.LONGITUDE - ?)) <= ?)) AND (t0.ID = t1.contact_data_id))")] 
with root cause
org.hsqldb.HsqlException: user lacks privilege or object not found: 
CONTACT_DATA

my tomee.xml looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<tomee>
   <!-- see http://tomee.apache.org/containers-and-resources.html -->

   <Resource id="MySQL" type="DataSource">
     JdbcDriver  com.mysql.jdbc.Driver
     JdbcUrl jdbc:mysql://localhost:3306/database
     UserName    root
     Password    secret
     JtaManaged true
</Resource>
</tomee>

this is the persistence.xml:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
     xmlns="http://java.sun.com/xml/ns/persistence" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://java.sun.com/xml/ns/persistence 
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">

     <persistence-unit name="DynamicWebProject" transaction-type="JTA">
     <jta-data-source>MySQL</jta-data-source>
  <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
  <exclude-unlisted-classes>false</exclude-unlisted-classes>
         <shared-cache-mode>ALL</shared-cache-mode>
         <properties>
             <property name="eclipselink.logging.exceptions" value="true"/>
         </properties>
     </persistence-unit>
</persistence>

i even added the following to my web.xml:

<resource-ref>
         <description>DB Connection</description>
         <res-ref-name>MySQL</res-ref-name>
         <res-type>javax.sql.DataSource</res-type>
     </resource-ref>

I also added mysql-connector-java-5.1.20-bin.jar, eclipselink.jar and 
javax.persistence_2.0.4.v201112161009.jar to 
apache-tomee-webprofile-1.5.2/lib and added the directory to the 
projects java built path.
Unfortunately I did not have any success yet.

Re: TomEE: org.hsqldb.HsqlException despite MySQL-Datasource

Posted by Volker Engelmann <ob...@sonnenkinder.org>.
Acutally I have the impression that the database is simply not connected as I
get the same exception when removing the resource from tomee.xml.



--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-org-hsqldb-HsqlException-despite-MySQL-Datasource-tp4662687p4662691.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: TomEE: org.hsqldb.HsqlException despite MySQL-Datasource

Posted by Volker Engelmann <ob...@sonnenkinder.org>.
Thanks for your answers.

I removed javax.persistence jar and disconnected the datasource inside
eclipse.
Actually I don't know how to stop the database engine (InnoDB in my case).



--
View this message in context: http://openejb.979440.n4.nabble.com/TomEE-org-hsqldb-HsqlException-despite-MySQL-Datasource-tp4662687p4662690.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: TomEE: org.hsqldb.HsqlException despite MySQL-Datasource

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

First remove javax.persistence jar. It is provided by the container in
javaee-api.
Le 6 mai 2013 01:30, <ob...@sonnenkinder.org> a écrit :

> Using tomee-webprofile-1.5.2 The following exception is thrown when the
> application tries to access the database:
>
> SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path
> [/DynamicWebProject] threw exception [The bean encountered a
> non-application exception; nested exception is:
>     Exception [EclipseLink-4002] (Eclipse Persistence Services -
> 2.3.2.v20111125-r10461): org.eclipse.persistence.**
> exceptions.DatabaseException
> Internal Exception: java.sql.**SQLSyntaxErrorException: user lacks
> privilege or object not found: CONTACT_DATA
> Error Code: -5501
> Call: SELECT t1.ID, t1.company_name, t1.DESCRIPTION, t1.REMARK,
> t1.screen_name, t1.valid_from, t1.valid_until, t1.contact_data_id,
> t1.IMAGE_ID FROM contact_data t0, RESTAURANT t1 WHERE (((ABS((t0.LATITUDE -
> 0.0)) <= 0.08993216059187306) AND (ABS((t0.LONGITUDE - 0.0)) <=
> 0.09009009009009009)) AND (t0.ID = t1.contact_data_id))
> Query: ReadAllQuery(referenceClass=**Restaurant sql="SELECT t1.ID,
> t1.company_name, t1.DESCRIPTION, t1.REMARK, t1.screen_name, t1.valid_from,
> t1.valid_until, t1.contact_data_id, t1.IMAGE_ID FROM contact_data t0,
> RESTAURANT t1 WHERE (((ABS((t0.LATITUDE - ?)) <= ?) AND (ABS((t0.LONGITUDE
> - ?)) <= ?)) AND (t0.ID = t1.contact_data_id))")] with root cause
> org.hsqldb.HsqlException: user lacks privilege or object not found:
> CONTACT_DATA
>
> my tomee.xml looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <tomee>
>   <!-- see http://tomee.apache.org/**containers-and-resources.html<http://tomee.apache.org/containers-and-resources.html>-->
>
>   <Resource id="MySQL" type="DataSource">
>     JdbcDriver  com.mysql.jdbc.Driver
>     JdbcUrl jdbc:mysql://localhost:3306/**database
>     UserName    root
>     Password    secret
>     JtaManaged true
> </Resource>
> </tomee>
>
> this is the persistence.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="2.0"
>     xmlns="http://java.sun.com/**xml/ns/persistence<http://java.sun.com/xml/ns/persistence>"
> xmlns:xsi="http://www.w3.org/**2001/XMLSchema-instance<http://www.w3.org/2001/XMLSchema-instance>
> "
>     xsi:schemaLocation="http://**java.sun.com/xml/ns/**persistence<http://java.sun.com/xml/ns/persistence>
> http://java.sun.com/xml/ns/**persistence/persistence_2_0.**xsd<http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd>
> ">
>
>     <persistence-unit name="DynamicWebProject" transaction-type="JTA">
>     <jta-data-source>MySQL</jta-**data-source>
>  <provider>org.eclipse.**persistence.jpa.**PersistenceProvider</provider>
>  <exclude-unlisted-classes>**false</exclude-unlisted-**classes>
>         <shared-cache-mode>ALL</**shared-cache-mode>
>         <properties>
>             <property name="eclipselink.logging.**exceptions"
> value="true"/>
>         </properties>
>     </persistence-unit>
> </persistence>
>
> i even added the following to my web.xml:
>
> <resource-ref>
>         <description>DB Connection</description>
>         <res-ref-name>MySQL</res-ref-**name>
>         <res-type>javax.sql.**DataSource</res-type>
>     </resource-ref>
>
> I also added mysql-connector-java-5.1.20-**bin.jar, eclipselink.jar and
> javax.persistence_2.0.4.**v201112161009.jar to
> apache-tomee-webprofile-1.5.2/**lib and added the directory to the
> projects java built path.
> Unfortunately I did not have any success yet.
>

Re: TomEE: org.hsqldb.HsqlException despite MySQL-Datasource

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
Is your IDE connected to the database 'prior' to TomEE starting? I think I
see this exception when my netbeans is connected to database. I usually
disconnect from database and stop database engine as well.
 On May 5, 2013 7:30 PM, <ob...@sonnenkinder.org> wrote:

> Using tomee-webprofile-1.5.2 The following exception is thrown when the
> application tries to access the database:
>
> SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path
> [/DynamicWebProject] threw exception [The bean encountered a
> non-application exception; nested exception is:
>     Exception [EclipseLink-4002] (Eclipse Persistence Services -
> 2.3.2.v20111125-r10461): org.eclipse.persistence.**
> exceptions.DatabaseException
> Internal Exception: java.sql.**SQLSyntaxErrorException: user lacks
> privilege or object not found: CONTACT_DATA
> Error Code: -5501
> Call: SELECT t1.ID, t1.company_name, t1.DESCRIPTION, t1.REMARK,
> t1.screen_name, t1.valid_from, t1.valid_until, t1.contact_data_id,
> t1.IMAGE_ID FROM contact_data t0, RESTAURANT t1 WHERE (((ABS((t0.LATITUDE -
> 0.0)) <= 0.08993216059187306) AND (ABS((t0.LONGITUDE - 0.0)) <=
> 0.09009009009009009)) AND (t0.ID = t1.contact_data_id))
> Query: ReadAllQuery(referenceClass=**Restaurant sql="SELECT t1.ID,
> t1.company_name, t1.DESCRIPTION, t1.REMARK, t1.screen_name, t1.valid_from,
> t1.valid_until, t1.contact_data_id, t1.IMAGE_ID FROM contact_data t0,
> RESTAURANT t1 WHERE (((ABS((t0.LATITUDE - ?)) <= ?) AND (ABS((t0.LONGITUDE
> - ?)) <= ?)) AND (t0.ID = t1.contact_data_id))")] with root cause
> org.hsqldb.HsqlException: user lacks privilege or object not found:
> CONTACT_DATA
>
> my tomee.xml looks like this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <tomee>
>   <!-- see http://tomee.apache.org/**containers-and-resources.html<http://tomee.apache.org/containers-and-resources.html>-->
>
>   <Resource id="MySQL" type="DataSource">
>     JdbcDriver  com.mysql.jdbc.Driver
>     JdbcUrl jdbc:mysql://localhost:3306/**database
>     UserName    root
>     Password    secret
>     JtaManaged true
> </Resource>
> </tomee>
>
> this is the persistence.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <persistence version="2.0"
>     xmlns="http://java.sun.com/**xml/ns/persistence<http://java.sun.com/xml/ns/persistence>"
> xmlns:xsi="http://www.w3.org/**2001/XMLSchema-instance<http://www.w3.org/2001/XMLSchema-instance>
> "
>     xsi:schemaLocation="http://**java.sun.com/xml/ns/**persistence<http://java.sun.com/xml/ns/persistence>
> http://java.sun.com/xml/ns/**persistence/persistence_2_0.**xsd<http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd>
> ">
>
>     <persistence-unit name="DynamicWebProject" transaction-type="JTA">
>     <jta-data-source>MySQL</jta-**data-source>
>  <provider>org.eclipse.**persistence.jpa.**PersistenceProvider</provider>
>  <exclude-unlisted-classes>**false</exclude-unlisted-**classes>
>         <shared-cache-mode>ALL</**shared-cache-mode>
>         <properties>
>             <property name="eclipselink.logging.**exceptions"
> value="true"/>
>         </properties>
>     </persistence-unit>
> </persistence>
>
> i even added the following to my web.xml:
>
> <resource-ref>
>         <description>DB Connection</description>
>         <res-ref-name>MySQL</res-ref-**name>
>         <res-type>javax.sql.**DataSource</res-type>
>     </resource-ref>
>
> I also added mysql-connector-java-5.1.20-**bin.jar, eclipselink.jar and
> javax.persistence_2.0.4.**v201112161009.jar to
> apache-tomee-webprofile-1.5.2/**lib and added the directory to the
> projects java built path.
> Unfortunately I did not have any success yet.
>