views:

282

answers:

1

I'm actually finishing a Desktop App That implements JPA for DB Communication. I Have a JPA Util class that does the following:

private EntityManagerFactory emf = new EntityManagerFactory();

emf = Persistence.getEntityManagerFactory("default");

This "default" value is defined for my persistence.xml contained in the META-INF source folder and it works properly while using Eclipse.

What happens is that when i compile it, it doesn`t recognizes this folder as a source folder inside the jar file and says that: "there are no entity manager set as default" or something like that. I need to know if somebody can help me call my persistence.xml file into my PersistenceManagerFactory without having to use a source folder for it (it seems that getEntityManagerFactory does it for itself)

Thanks

A: 

Try looking for it on the classppath

emf = Persistence.getEntityManagerFactory("classpath:default");
alanl