title: No Persistence provider for EntityManager when trying to execute query in JPAQL console (IntelliJ Idea 11)
body: <p>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:</p>
  
  <pre><code>jpa-ql&gt; 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)
  </code></pre>
  
  <p>The project is imported from Maven (JavaEE6/Jboss7 archetype; EAR package) and when i run this app on JBoss7 everything works ok.  </p>
  
  <p>How do i make it work?</p>