I'm trying to create a GWT app and I'm working with a local postgreSQL Database. I'm working with GWT 2.4 on eclipse Juno. I implemented in this way the Server-side implementation (TaskServiceImpl):
public class TaskServiceImpl extends ServiceImpl implements TaskService {
@Override
public List<Task> getAllTasks() {
em = this.getEntityManager();
Query q = em.createQuery("SELECT x FROM Task x");
List<Task> list = createList(q.getResultList().toArray(),
new ArrayList<Task>(), em);
em.close();
return list;
}
and this is the Database connection class in the client-side:
public class DatabaseConnection {
public static final TaskServiceAsync taskService;
static {
taskService = GWT.create(TaskService.class);
}
}
I try now to run a getAllTask() in this way
public void onModuleLoad() {
DatabaseConnection.taskService.getAllTasks(new AsyncCallback<List<Task>>() {
@Override
public void onSuccess(List<Task> result) {
System.out.println("Success!");
}
@Override
public void onFailure(Throwable caught) {
System.out.println("Fail!");
}
});
}
And always returns "fail!" and gives me this error:
com.google.appengine.tools.development.LocalResourceFileServlet doGet WARNING: No file found for: /fantapgl/task
This is my web.xml
<servlet>
<servlet-name>taskServiceImpl</servlet-name>
<servlet-class>fieldProject.server.service.TaskServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>taskServiceImpl</servlet-name>
<url-pattern>/fantaPGL/task</url-pattern>
</servlet-mapping>
to open the connection to the DB I have this code in the persistence.xml:
<properties>
<property name="openjpa.jdbc.DBDictionary" value="postgres" />
<property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema()"/>
<property name="openjpa.ConnectionDriverName" value="org.postgresql.Driver"/>
<property name="openjpa.ConnectionURL" value="jdbc:postgresql://localhost:5432/db" />
<property name="openjpa.ConnectionUserName" value="postgres" />
<property name="openjpa.ConnectionPassword" value="password" />
</properties>
I don't understand where I'm wrong. Can someone plz help me!?