classpath « Update « JPA Q&A





1. JPA with TopLink: No META-INF/persistence.xml was found in classpath    stackoverflow.com

public class LoginTest {

public static void main(String[] args) {
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("IRCBotPU");
    EntityManager em = emf.createEntityManager();

    em.getTransaction().begin();

    Login ...

2. Having more than one persistence.xml file on the classpath    forum.hibernate.org

I was trying (still am, actually) to use Hibernate with JPA annotations for persisting simple POJOs to the db. The complexity level is very similar to the Hello World tutorial. So off I went and generated mapping annotations, persistence.xml file and a main class to handle the transactions. All of this to fail on the first line of code: EntityManagerFactory entityManagerFactory ...