I have the following Maven project estruture:
Example
-Persistence
-GWTApp
The persistence has the persistence.xml in src/main/resources/META-INF, and it works fine in unitary tests.
I need to use it in the GWTApp project. So, I add it as depency. like this:
<dependency>
<groupId>com.example</groupId>
<artifactId>Persistence</artifactId>
<version>0.0.1</version>
</dependency>
With this, I can see and use the persistence classes in my webapp, but, when I run the webproject in eclipse, I got this error:
javax.persistence.PersistenceException: No Persistence provider for EntityManager named exemplo
I think that’s because eclipse done this “link” between projects referencing the persistence project in webapp project, instead of using a jar file. Maybe I’m wrong, it’s just a guess.
Someone knew how can I fix this?
Thanks in advance.
EDIT
I do more tests, and now I believe thats problem is something just with GWT dev mode and JPA, or something.
I tried to manually copy persistence.xml to weapp/META-INF and to target/project-webapp-0.0.1-SNAPSHOT/META-INF and the error persist.
Any idea?
Are you launching the app correctly? https://developers.google.com/eclipse/docs/faq#gwt_with_maven
Particularly, note that you have to “mvn war:exploded” to copy your dependencies target/myapp-0.0.1-SNAPSHOT/WEB-INF/lib