Wednesday, January 27, 2016

SerializationException

hi guys 

i'd received this message

[WARN ] 2016-01-27 11:34:27.291 [qtp26882648-29] / - Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type '[Ljava.lang.Object;' 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 = [Ljava.lang.Object;@ddf831
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:667) ~[gwt-servlet.jar:?]
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:130) ~[gwt-servlet.jar:?]
at com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.serialize(Collection_CustomFieldSerializerBase.java:44) ~[gwt-servlet.jar:?]
at com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serialize(ArrayList_CustomFieldSerializer.java:39) ~[gwt-servlet.jar:?]
at com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serializeInstance(ArrayList_CustomFieldSerializer.java:51) ~[gwt-servlet.jar:?]
at com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serializeInstance(ArrayList_CustomFieldSerializer.java:28) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:789) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:669) ~[gwt-servlet.jar:?]
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:130) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter$ValueWriter$8.write(ServerSerializationStreamWriter.java:153) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:587) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:631) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:497) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:589) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:333) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:303) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:373) ~[gwt-servlet.jar:?]
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62) [gwt-servlet.jar:?]

my object is

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

@Entity
@Table(name = "SP_OBTEMGRAFICOFINANCEIRO")
public class SpGrafFinanAnual implements Serializable {


private static final long serialVersionUID = 1L;
private int mes;
private int ano;
@Column(name = "RECEITA", nullable = true, columnDefinition="NUMERIC")
private float receita;
@Column(name = "DESPESA", nullable = true, columnDefinition="NUMERIC")
private float despesa;
@Column(name = "FATURAMENTO", nullable = true, columnDefinition="NUMERIC")
private float faturamento;
public SpGrafFinanAnual(){
}
.... getters and setters

i cound't find any solutions around web

the solutions that i found is
  1. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  1. 1 - Verify that the class has a default constructor (without arguments)
  2. 2 - Verify that the class implements Serializable or IsSerializable or implements an Interface that extends Serializable or extends a class that implement Serializable
  3. 3 - Verify that the class is in a client.* package or …
  4. 4 - Verify, if the class is not in client.* package, that is compiled in your GWT xml module definition. By default is present. If your class is in another package you have to add it to source. For example if your class is under domain.* you should add it to xml as . Be aware that the class cannot belong to server package! More details on GWT page:http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModuleXml
  5. 5 - If you are including the class from another GWT project you have to add the inherits to your xml module definition. For example if your class Foo is in the package com.dummy.domain you have to add to the module definition. More details here:http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideInheritingModules
  6. 6 - If you are including the class from another GWT project released as a jar verify that the jar contains also the source code because GWT recompile also the Java source for the classes passed to the Client.
  7. ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
And my object is ok for all of then. somebody can help me

Thanks a lot ! 

Best regards,
Claudio

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment