GWT with JPA - no persistence provider...

Posted by meliniak on Stack Overflow See other posts from Stack Overflow or by meliniak
Published on 2010-05-15T20:34:04Z Indexed on 2010/05/15 20:44 UTC
Read the original article Hit count: 224

Filed under:
|
|

GWT with JPA

There are two projects in my eclipse workspace, let's name them:

-JPAProject -GWTProject

JPAProject contains JPA configuration stuff (persistence.xml, entity classes and so on). GWTProject is an examplary GWT project (taken from official GWT tutorial).

Both projects work fine alone. That is, I can create EMF (EntityManagerFactory) in JPAProject and get entities from the database. GWTProject works fine too, I can run it, fill the field text in the browser and get the response.

My goal is to call JPAProject from GWTProject to get entities. But the problem is that when calling DAO, I get the following exception:

[WARN] Server class 'com.emergit.service.dao.profile.ProfileDaoService' could not be found in the web app, but was found on the system classpath
   [WARN] Adding classpath entry 'file:/home/maliniak/workspace/emergit/build/classes/' to the web app classpath for this session

[WARN] /gwttest/greet
javax.persistence.PersistenceException: No Persistence provider for EntityManager named emergitPU
    at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
    at javax.persistence.Persistence.createEntityManagerFactory(Unknown Source)
    at com.emergit.service.dao.profile.JpaProfileDaoService.<init>(JpaProfileDaoService.java:19)
    at pl.maliniak.server.GreetingServiceImpl.<init>(GreetingServiceImpl.java:21)  
.  
.  
.  
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
    at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
[ERROR] 500 - POST /gwttest/greet (127.0.0.1) 3812 bytes

I guess that the warnings at the beginning can be omitted for now.

Do you have any ideas? I guess I am missing some basic point. All hints are highly apprecieable.

© Stack Overflow or respective owner

Related posts about java

Related posts about gwt