1

I want to set up JPAQL console in IntelliJ Idea 11. I have my persistence unit defined and when i open JPAQL console and i run the query i get the following error:

jpa-ql> select l from FourPmLog l
java.lang.RuntimeException: javax.persistence.PersistenceException: No Persistence provider for EntityManager named primary
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:69)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:47)
in JpaFacadeImpl.createEntityManagerFactory(JpaFacadeImpl.java:16)
in RemoteUtil.executeWithClassLoader(RemoteUtil.java:132)
in RemoteUtil$3$1.invoke(RemoteUtil.java:91)
in JpaEngine.ensureInitialized(JpaEngine.java:129)

The project is imported from Maven (JavaEE6/Jboss7 archetype; EAR package) and when i run this app on JBoss7 everything works ok.

How do i make it work?

Domen P
  • 163
  • 10
  • Check that persistence-unit/provider tag is not missing. Post your `persistence.xml` if it's not the case. – CrazyCoder Apr 05 '12 at 03:19
  • I want to use hibernate but i don't know the right value for a provider tag. I use "org.hibernate.ejb.HibernatePersistence" configuration but it doesn't seem to work. I have hibernate-jpa-2.0-api and hibernate-core in my pom.xml (provided scope). – Domen P Apr 05 '12 at 09:37
  • Did you already check this question: http://stackoverflow.com/q/1158159/104891? – CrazyCoder Apr 05 '12 at 10:33
  • I did check the link above and i set provider as "org.hibernate.ejb.HibernatePersistence" in persistence.xml but Idea doesn't seem to find it even though i include hibernate-core (version 4.*) jar in my pom.xml. I also included the hibernate-entitymanager jar but it doesn't seem to make any difference either. – Domen P Apr 10 '12 at 07:30
  • 1
    Check that `org.hibernate:hibernate-entitymanager:4.1.2.Final` is added to the pom dependencies. – CrazyCoder Apr 11 '12 at 12:50

0 Answers0