My problem s just same as this Could not find any META-INF/persistence.xml file in the classpath and i need to help about how i just simply add my persistence.xml file into the in the classpath.
App.java
package JPA;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
public class App {
public static void main (String args[]) {
EntityManagerFactory emf = Persistence.createEntityManagerFactory("pu");
EntityManager em = emf.createEntityManager();
Alien a = em.find(Alien.class,2);
}
}
persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0" >
<persistence-unit name="pu">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/akash"/>
<property name="javax.persistence.jdbc.user" value="root"/>
</properties>
</persistence-unit>
</persistence>
Here i am little confused about the persistence" version="1.0" is correct or not ?
> Error
Could not find any META-INF/persistence.xml file in the classpath
No Persistence provider for EntityManager named pu
my persistence.xml file is stored into the META-INF so why it shows error .

