classpath « Update « JPA Q&A

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

public class LoginTest {

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


    Login ...

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

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 ...