No Persistence provider for EntityManager when trying to execute query in JPAQL console

I want to set up JPAQL console in Idea 11.1. 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(
at javax.persistence.Persistence.createEntityManagerFactory(
in JpaFacadeImpl.createEntityManagerFactory(
in RemoteUtil.executeWithClassLoader(
in RemoteUtil$3$1.invoke(
in JpaEngine.ensureInitialized(

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?

Please sign in to leave a comment.