This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes org.apache.openjpa.lib.jdbc.ReportingSQLException - type not found or user lacks privilege Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "org.apache.openjpa.lib.jdbc.ReportingSQLException - type not found or user lacks privilege" Watch "org.apache.openjpa.lib.jdbc.ReportingSQLException - type not found or user lacks privilege" New topic
Author

org.apache.openjpa.lib.jdbc.ReportingSQLException - type not found or user lacks privilege

Jakub Kitaj
Greenhorn

Joined: Sep 18, 2013
Posts: 2
In my web application run on TomEE 1.5.2 server at @ManagedBean I get EJB by @EJB annotation.
In EJB I get EntityManager by

@PersistenceContext(unitName = "CollDocPU")
private EntityManager em;

After that i use EM to create Query:
Query q = em.createNamedQuery("User.findByLogin").setParameter("login", login);

At this moment I get error:

javax.el.ELException: javax.ejb.EJBException: The bean encountered a non-application exception; nested exception is: <openjpa-2.2.0-r422266:1244990 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: type not found or user lacks privilege: TEXT {stmnt 2102470495 CREATE TABLE COURSE (id_course SMALLINT NOT NULL, code VARCHAR(255), description TEXT, name VARCHAR(255), realization INTEGER, version SMALLINT, PRIMARY KEY (id_course)) ENGINE = innodb} [code=-5509, state=42509]

viewId=/pages/register.xhtml
location=/home/jakub/Projekty/Collv2/build/web/pages/register.xhtml
phaseId=INVOKE_APPLICATION(5)

Caused by:
org.apache.openjpa.lib.jdbc.ReportingSQLException - type not found or user lacks privilege: TEXT {stmnt 2102470495 CREATE TABLE COURSE (id_course SMALLINT NOT NULL, code VARCHAR(255), description TEXT, name VARCHAR(255), realization INTEGER, version SMALLINT, PRIMARY KEY (id_course)) ENGINE = innodb} [code=-5509, state=42509]
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator.wrap(LoggingConnectionDecorator.java:247)

/pages/register.xhtml at line 26 and column 104 action="#{registerController.register}"

<HtmlCommandButton action="#{registerController.register}" actionExpression="#{registerController.register}" class="class javax.faces.component.html.HtmlCommandButton" clientId="j_id_f:j_id_m" disabled="false" id="j_id_m" immediate="false" inView="true" readonly="false" rendered="true" transient="false" type="submit" value="#{msg.login}" location="/pages/register.xhtml at line 26 and column 104"/> - State size:0 bytes
Jakub Kitaj
Greenhorn

Joined: Sep 18, 2013
Posts: 2
Problem is with my JPA configuration in TomEE server. To get not null EntityManager from



i have to change my persistance.xml, change transaction-type to "JTA" and add:



after that, i have to declare resources in my server configuration: at [tomee installation folder]/conf/tomee.xml file:


Look there:

http://openejb.979440.n4.nabble.com/org-apache-openjpa-lib-jdbc-ReportingSQLException-type-not-found-or-user-lacks-privilege-td4665124.html

http://mobiarch.wordpress.com/2012/12/07/configuring-a-mysql-data-source-in-tomee
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.apache.openjpa.lib.jdbc.ReportingSQLException - type not found or user lacks privilege
 
Similar Threads
Restore problem
hibernat creating the tables without cascade
Login Exception when using JDBC Realm (Glassfish V3.1 + IceFaces 2 + MySQL)
Adding a bit new info to the jforum_user table when registerting
Ejb 3.0 Unable to run the program in Weblogic or Glassfish server