Tuesday, February 25, 2014

Resolve Error :java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: is not mapped

Removed
This is a nice error that has take a good time.
By searching this error in the internet, the problem can be about the Entity name given in the query. If you are using HQL, you should specify the Entity name and not the Table name.

But my problem is beyond that. In fact I have two errors:
1- If I specify the table name in an sql query I will have

Internal Exception: org.postgresql.util.PSQLException: ERROR: relation ... does not exist


2- If I specify the Entity name, I will have
java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: is not mapped

So I have suspected that my entities are not mapped from the database. In fact even if I open the Hibernate perspective and see my project, I have an error. See this link.
As a solution, I have fixed my persistence.xml, make sure that I can access the tables from the Hibernate console, and thus generate my Entities.

I will sooner post a new article about how to work with JBoss eap6.2 as I have discovered many problems. 

No comments :

Post a Comment

Articles les plus consultés