Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4613592
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:34:27+00:00 2026-05-22T01:34:27+00:00

Started a new project from scratch, converted to JPA, my persistence provider is EclipseLink,

  • 0

Started a new project from scratch, converted to JPA, my persistence provider is EclipseLink, added the necessary libraries (eclipselink.jar, eclipselink.jar, javax.persistence, mysql-connector-java-5.1). Tested the connection, ping ok. Then created a new package New > JPA > Entities from Tables > Selected all Entities and Key generator > Identity.

GestorIpca.java

            GestorIpcaService.util.getInstance().getLista(new AsyncCallback<ArrayList<Docente>>() {

                @Override
                public void onFailure(Throwable caught) {
                    Window.alert("Erro na Ligacao efectuada");
                    caught.getStackTrace();
                }

                @Override
                public void onSuccess(ArrayList<Docente> result) {
                    Window.alert("Ligacao efectuada com sucesso:" + result.size());
                }
            });    

GestorIpcaService

@RemoteServiceRelativePath("greet")
public interface GestorIpcaService extends RemoteService {
    String greetServer(String name) throws IllegalArgumentException;

    public static class util{
        public static GestorIpcaServiceAsync instance;
        public static GestorIpcaServiceAsync getInstance(){
            if(instance == null){
                instance = GWT.create(GestorIpcaService.class);
            }
        return instance;
        }
    }
    public ArrayList<Docente> getLista() throws IllegalArgumentException;
}    

GestorIpcaServiceAsync

public interface GestorIpcaServiceAsync {
        void greetServer(String input, AsyncCallback<String> callback)
                throws IllegalArgumentException;

        void getLista(AsyncCallback<ArrayList<Docente>> callback);
    }

GestorIpcaServiceImpl

@SuppressWarnings("serial")
public class GestorIpcaServiceImpl extends RemoteServiceServlet implements
        GestorIpcaService {

    public ArrayList<Docente> getLista() throws IllegalArgumentException  {
        //Criamos um EntityManager
        EntityManager em = JpaUtil.getEntityManagerFactory().createEntityManager();
        //Criamos a consulta
        String consulta = "SELECT r from Docente r";
        //Executamos a consulta
        Query q = em.createQuery(consulta);
        ArrayList<Docente> lista = new ArrayList<Docente>(q.getResultList());
        return lista;
    }
/*  public static void main(String args[]){
        GestorIpcaServiceImpl serviceImpl = new GestorIpcaServiceImpl();
        for (Docente docente : serviceImpl.getLista()){
            System.out.println("nome: " + docente.getNome());
        }
    }
    */   

In this file i tried to run as > Java Application and in Console showed me 2 records.
Package com.GestorIpca.factory

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;

public class JpaUtil {
    private static final EntityManagerFactory emf;
    //Método estático
    static{
        //BLoco try
        try
        {
            //Criação de EntityManagerFactory
            emf = Persistence.createEntityManagerFactory("GestorIpca");
        }catch (Throwable e){
            //Controlar as excepções
            System.err.println("A criação de SessionFactory falhou" + e);
            e.printStackTrace();
            throw new ExceptionInInitializerError(e);
        }
    }

    public static EntityManagerFactory getEntityManagerFactory(){
        return emf;
    }
}    

My persistence.xml was created automatically. Placed inside META-INF

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
    <persistence-unit name="GestorIpca">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

    <class>com.GestorIpca.shared.Ano</class>
    <class>com.GestorIpca.shared.Categoria</class>
    <class>com.GestorIpca.shared.Curso</class>
    <class>com.GestorIpca.shared.Disciplina</class>
    <class>com.GestorIpca.shared.Disponibilidade</class>
    <class>com.GestorIpca.shared.Docente</class>
    <class>com.GestorIpca.shared.Sala</class>
    <class>com.GestorIpca.shared.Semestre</class>
    <class>com.GestorIpca.shared.TipoCurso</class>
    <class>com.GestorIpca.shared.Turma</class>
    <class>com.GestorIpca.shared.User</class>
        <properties>
            <property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/timetable"/>
            <property name="javax.persistence.jdbc.user" value="root"/>
            <property name="javax.persistence.jdbc.password" value="k771u3"/>
            <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver"/>
        </properties>
    </persistence-unit>
</persistence>

Last step > Run as > Web Application
Error > Could not connect to database and print a stack trace in Eclipse Console

[EL Info]: 2011-05-09 10:03:08.78--ServerSession(8068087)--EclipseLink, version: Eclipse Persistence Services - 2.2.0.v20110202-r8913
[EL Info]: 2011-05-09 10:03:09.297--ServerSession(8068087)--file:/C:/Users/Martinho/WorkSpace/GestorIpca/war/WEB-INF/classes/_GestorIpca login successful
Starting Jetty on port 8888
   [WARN] Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: java.lang.reflect.InvocationTargetException
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer(ServerSerializationStreamWriter.java:764)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:727)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:616)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:534)
    at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:616)
    at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:474)
    at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:571)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
    at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
    at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:324)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
    at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
    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)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer(ServerSerializationStreamWriter.java:746)
    ... 30 more
Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'org.eclipse.persistence.indirection.IndirectSet' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = {IndirectSet: not instantiated}
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:614)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:534)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeClass(ServerSerializationStreamWriter.java:704)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:734)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:616)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:534)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeClass(ServerSerializationStreamWriter.java:704)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:734)
    at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:616)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126)
    at com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.serialize(Collection_CustomFieldSerializerBase.java:45)
    at com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serialize(ArrayList_CustomFieldSerializer.java:38)
    ... 35 more
[ERROR] 500 - POST /gestoripca/greet (127.0.0.1) 57 bytes
   Request headers
      Host: 127.0.0.1:8888
      Connection: keep-alive
      Referer: http://127.0.0.1:8888/GestorIpca.html?gwt.codesvr=127.0.0.1:9997
      Content-Length: 132
      Origin: http://127.0.0.1:8888
      X-GWT-Module-Base: http://127.0.0.1:8888/gestoripca/
      X-GWT-Permutation: HostedMode
      User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.30 Safari/534.30
      Content-Type: text/x-gwt-rpc; charset=UTF-8
      Accept: */*
      Accept-Encoding: gzip,deflate,sdch
      Accept-Language: pt-PT,pt;q=0.8,en-US;q=0.6,en;q=0.4
      Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
   Response headers
      Content-Type: text/plain    

Note: I changed in package com.GestorIpca.shared all my classes generated from tables

public class Ano implements Serializable 

to

public class Ano implements IsSerializable    

changed also my GestorIpca.gwt.xml and added this lines in end

<extend-configuration-property name="rpc.blacklist" value="com.google.gwt.user.client.ui.*Collection"/>
<extend-configuration-property name="rpc.blacklist" value="-.*List"/>
<extend-configuration-property name="rpc.blacklist" value="-.*Map"/>
<extend-configuration-property name="rpc.blacklist" value="-.*Collection"/>
<extend-configuration-property name="rpc.blacklist" value="+java.util.HashMap"/>
<extend-configuration-property name="rpc.blacklist" value="+java.util.LinkedHashMap"/>
<extend-configuration-property name="rpc.blacklist" value="+java.util.ArrayList"/>

What am i missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T01:34:28+00:00Added an answer on May 22, 2026 at 1:34 am

    I depends on how your entities were defined. Maybe there are connections that GWT RPC doesn´t like. in this case i´d suggest create DTO´s or implement RequestFactory

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a fairly new project and we started from scratch. So not
I started a new WPF project in VS2008 and then added some code to
Hi all I've just started a new project using Visual Web Developer 2008 Express
I recently started a new webforms project and decided to separate the business classes
I started a new project this morning and, after putting ~3 hours of work
We just started a new ASP.Net project that uses web services to serialize some
I started to implement some new html5 features (standards, nothing fancy) in my project.
I have started a new project on iPad.I would like to know the method
I've started a new project in Xcode 3.2.5 where everything is being done in
I started a new project with type of Windows Forms application, and I put

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.