I'm having a hibernate project setup issue. During project setup, I didn't select JEE persietence, but instead just told Intellij I was using Hibernate.
Here's what I did:
(1) I created a regular Java Web project where I selected to include Hiberante and MySQL jars.
(2) I created a db connection to the database and confirmed it was "query-able" from the Intelilj project.
The Hibernate Config generated has the DB connection information, with user and password.
(3) I generated a Persistence mapping from the database in the Persistence tab of Intelij.
The entity class for zipcodes looks correctly generated.
(4) Then wrote a quick DAO:
public static void main(String args)
EntityManagerFactory emf = Persistence.createEntityManagerFactory("Zipcodes");
EntityManager em = emf.createEntityManager();
EntityTransaction tx = em.getTransaction();
// test get the zip code list...
List zipCodes = (ArrayList) em.createQuery("SELECT from ZIPCODES");
// code compiles.
Yet, when I try to run this, I get this error: "Exception in thread "main" javax.persistence.PersistenceException: No Persistence provider for EntityManager"
Didn't Intellij already generate this persistence info in step 3 above?
I looked into this error and it says I have to have a persietence.xml in the WEB-INF folder. However, Intellij didn't create either a persistence.xml or a WEB-INF folder in this project.
Thanks in advance for any help or suggestions.