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(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?

Please sign in to leave a comment.