Re: Bean Serialization Problem: com.google.gwt.user.client.rpc.SerializationException: Type 'com.dg.common.client.beans.DGUser' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable'

2013-08-05 Thread dingolfy
Thanks JM for posting the solution. I too had the same problem. It is 
working fine in the dev environment but not in live. both are in Linux. Not 
sure why. Your solution helped to get it working.

Thanks !

On Thursday, November 6, 2008 1:41:01 PM UTC, JM wrote:

 I fixed it by implementing GWT's IsSerializable interface instead of 
 Java's Serializable... 
 Can't figure out why it works on Winows env. 

 JM 


 On Nov 5, 4:01 pm, JM jm.ting...@gmail.com wrote: 
  ping2ravi I'm glad you came back to tell it's now working for you! 
  But think of all those people with the same problem you had... like 
  me. 
  Any idea? 
  My classes are implementing Serializable. It's working fine on my 
  development environment (Windows). 
  But now that I try an integration (Linux), I get the same exception. 
  
  Thanks, 
  JM 
  
  On 23 oct, 11:10, gui@gmail.com gui@gmail.com wrote: 
  
   Hi 
  
   May we know what was causing the difference in file-names?  I am 
   having a similar exception 
  
   G. 
  
   On Sep 22, 1:06 pm, ping2ravi ping2r...@gmail.com wrote: 
  
i found the problem why file names were different. 
Thanks 
  
On Sep 22, 11:18 am, ping2ravi ping2r...@gmail.com wrote: 
  
 Hi All, 
 My application was working good till now and now i deployed it to 
 other machine and it start giving me following exception. My 
 DGUser 
 class is implementing serializable interface. 
  
 SEVERE: Exception while dispatching incoming RPC call 
 com.google.gwt.user.client.rpc.SerializationException: Type 
 'com.dg.common.client.beans.DGUser' was not assignable to 
 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a 
 custom field serializer.  For security purposes, this type will 
 not be 
 serialized. 
 at 
 
 com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy.validateSerialize(LegacySerializationPolicy.java:
  

 140) 
 at 
 
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
  

 585) 
 at 
 
 com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
  

 129) 
 at 
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter 
 $ValueWriter$8.write(ServerSerializationStreamWriter.java:146) 
 at 
 
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:
  

 520) 
 at 
 com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573) 
 at 
 
 com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java: 
 441) 
 at 
 
 com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java: 
 529) 
 at 
 
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
  

 163) 
 at 
 
 com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
  

 85) 
 at 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:710) 
 at 
 javax.servlet.http.HttpServlet.service(HttpServlet.java:803) 
 at 
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
  

 290) 
 at 
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
  

 206) 
 at 
 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
  

 233) 
 at 
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
  

 175) 
 at 
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 
 128) 
 at 
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 
 102) 
 at 
 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java: 

 109) 
 at 
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 
 263) 
 at 
 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
 844) 
 at org.apache.coyote.http11.Http11Protocol 
 $Http11ConnectionHandler.process(Http11Protocol.java:584) 
 at 
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: 
 447) 
 at java.lang.Thread.run(Thread.java:619) 
  
 And also its giving following error in the log file, So i am 
 guessing 
 its because of this .gwt.rpc missing file, 
 INFO: ERROR: The serialization policy file '/ 
 D96C005D9FEF0E3183DC3057D9F48727.gwt.rpc' was not found; did you 
 forget to include it in this deployment? 
 INFO: WARNING: Failed to get the SerializationPolicy 
 

Re: Bean Serialization Problem: com.google.gwt.user.client.rpc.SerializationException: Type 'com.dg.common.client.beans.DGUser' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' a

2013-08-05 Thread Jens


 Thanks JM for posting the solution. I too had the same problem. It is 
 working fine in the dev environment but not in live. both are in Linux. Not 
 sure why. Your solution helped to get it working.


If you see 

INFO: ERROR: The serialization policy file '/ 
D96C005D9FEF0E3183DC3057D9F48727.gwt.rpc' was not found; did you 
forget to include it in this deployment? 
INFO: WARNING: Failed to get the SerializationPolicy 
'D96C005D9FEF0E3183DC3057D9F48727' for module 'http://localhost:8090/ 
AdminMenu/ http://localhost:8090/AdminMenu/'; a legacy, 1.3.3 compatible, 
serialization policy will be 
used.  You may experience SerializationExceptions as a result. 


in your log files you must fix it to make serialization using 
java.io.Serializable work again. As the above log entry says GWT falls back 
on a legacy serialization mechanism if it can not find the 
permutation.gwt.rpc files. This legacy serialization mechanism requires 
you to implement IsSerializable.

So you better fix the root cause instead of relying on legacy code. If you 
need to customize the way GWT tries to load these files you can do so by 
overriding RemoteServiceServlet.doGetSerializationPolicy().

-- J. 

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




GWT serialization problem

2013-03-12 Thread Вадим Коваленко
Hello, in my app I faced a problem when reloading some pages. The error is: 

com.google.gwt.user.client.rpc.SerializationException: 
java.lang.RuntimeException: Unable to find class 
com.google.gwt.user.client.rpc.core.java.lang.Long_FieldSerializer

 I've downloaded gwt sources and found that error is caused by this line:

Class? klass = ReflectionHelper.loadClass(typeHandlerClass);

in file com/google/gwt/user/client/rpc/impl/SerializerBase.java

When we navigate to the page with hyper links or enter url manually 
everything works perfect, the code above is working, the class is loaded. 
But when we hit F5 button on some pages, the exception appears.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: rpc serialization problem

2012-11-08 Thread Cleiton Cavassa

Cool! Benjamin hints worked for me.

Thanks!

Em terça-feira, 4 de agosto de 2009 23h52min57s UTC-3, mike escreveu:

 I have a simple one-to-many betwen two entities.  The parent entity 
 uses List to contain the child entities.  I am able to persist these 
 entities in the datastore without problems. 

 However, when reading a root entity at the server, I get: 

 rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' was 
 not included in the set of types  which can be serialized... 

 The entities are successfully read from the datastore, but something 
 in Datanucleus doesn't build the List correctly. 

 Has anyone found a workaround for this serialization problem. 

 Thanks 

 GWT 1.7 GAE 1.2.2 


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/1CKD38ViDsoJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



gwt openpa serialization problem

2012-10-02 Thread YinYanSI
I have gwt app with openjpa 2.0

*gwt compiler compile OK *
*Compiling module skladisce.SkladisceGWT*
*   Compiling 6 permutations*
*  Compiling permutation 0...*
*  Compiling permutation 1...*
*  Compiling permutation 2...*
*  Compiling permutation 3...*
*  Compiling permutation 4...*
*  Compiling permutation 5...*
*   Compile of permutations succeeded*
*Linking into 
/home/MyUser/IBM/rationalsdp/workspace/SkladisceWeb/WebContent/skladiscegwt*
*   Link succeeded*
*   Compilation succeeded -- 129.166s*

but runtime error happend.


Why do I get error serialization?* What does 
'org.apache.openjpa.kernel.DelegatingResultList'  has with serialization*???

my ERROR:

*com.ibm.ws.webcontainer.webapp.WebApp log SRVE0296E: 
[SkladisceWebEAR#SkladisceWeb.war][/SkladisceWeb][Servlet.LOG]:.Exception 
while dispatching incoming RPC 
call:.com.google.gwt.user.client.rpc.SerializationException: Type 
'org.apache.openjpa.kernel.DelegatingResultList' 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 = [skladisce.shared.entities.LoksObrat@4eb44eb4, 
skladisce.shared.entities.LoksObrat@76dc76dc, 
skladisce.shared.entities.LoksObrat@77dd77dd, 
skladisce.shared.entities.LoksObrat@78e278e2, 
skladisce.shared.entities.LoksObrat@79f879f8, 
skladisce.shared.entities.LoksObrat@7afc7afc, 
skladisce.shared.entities.LoksObrat@bc00bc, 
skladisce.shared.entities.LoksObrat@1f001f0]*


MY gwt.xml file:
?xml version=1.0 encoding=UTF-8?
module rename-to='skladiscegwt'

  inherits name='com.google.gwt.user.User'/
  inherits name='com.google.gwt.user.theme.clean.Clean'/
  inherits name=com.google.gwt.logging.Logging/

  source path=skladisce.shared.entities/source
  source path=org.apache.openjpa.kernel.DelegatingResultList/source

  
 
  entry-point class='skladisce.client.SkladisceGWT'/
 
  source path='client'/
  source path='shared'/

  set-property name=gwt.logging.logLevel value=INFO/
  set-property name=gwt.logging.enabled value=FALSE/
  set-property name=gwt.logging.consoleHandler value=ENABLED/ 

/module


@SuppressWarnings(serial)
public class SkladisceServiceImpl extends RemoteServiceServlet implements 
SkladisceService {

public ListLoksObrat getAllObrat(String version) throws 
MajorMinorException {
log.trace( getAllObrat);

if(!version.equals(AppInfo.VERSION))
throw new MajorMinorException();

LoksObratManager loksObratManager = new LoksObratManager(emf);
// listLoksObrat = loksObratManager.findAllToLokpVrsta();
log.trace( getAllObrat);
return loksObratManager.findAll();
}


@SuppressWarnings(unchecked)
@JPAManager(targetEntity = skladisce.shared.entities.LoksObrat.class)
public class LoksObratManager {

@Action(Action.ACTION_TYPE.FIND)
public ListLoksObrat findAll() {
ListLoksObrat list = null;
EntityManager em = getEntityManager();
try {
Query query = em.createNamedQuery(LoksObrat.findAll);
list = query.getResultList();
//for (LoksObrat loksObrat : list) {
// loksObrat.getLokpObratStrms();
//}
} finally {
em.close();
}
System.out.println( Bogdan tag: +list.toString() );
return list;
}
-

My entiry class is:
@Entity
@Table(name=LOKS_OBRAT, schema=SKL)
@NamedQueries({@NamedQuery(name=LoksObrat.findAll, query=SELECT lo FROM 
LoksObrat lo)})
public class LoksObrat implements Serializable {
private static final long serialVersionUID = 1L;

@Id
@GeneratedValue(strategy=GenerationType.IDENTITY)
@Column(name=ID_OBRAT)
private int idObrat;

@Column(name=DATURA_ZAD_SPR)
private Timestamp daturaZadSpr;

private String krnaziv;

private String opis;

@Column(name=OSEBA_ZAD_SPR)
private String osebaZadSpr;

private String sifra;

@Temporal( TemporalType.DATE)
@Column(name=VELJA_DO)
private Date veljaDo;

@Temporal( TemporalType.DATE)
@Column(name=VELJA_OD)
private Date veljaOd;

@Column(name=VRSTNI_RED)
private short vrstniRed;

//bi-directional many-to-one association to LokpObratStrm
@OneToMany(mappedBy=loksObrat, fetch = EAGER)
private ListLokpObratStrm lokpObratStrms;

public LoksObrat() {
}

public int getIdObrat() {
return this.idObrat;
}

public void setIdObrat(int idObrat) {
this.idObrat = idObrat;
}

public Timestamp getDaturaZadSpr() {
return this.daturaZadSpr;
}

public void setDaturaZadSpr(Timestamp daturaZadSpr) {
this.daturaZadSpr = daturaZadSpr;
}

public String getKrnaziv() {
return this.krnaziv;
}

public void setKrnaziv(String krnaziv) {
this.krnaziv = krnaziv;
}

public String getOpis() {
return this.opis;
}

public void setOpis(String opis) {
this.opis = opis;
}

public String getOsebaZadSpr() {
return this.osebaZadSpr;
}

public void setOsebaZadSpr(String osebaZadSpr) {
this.osebaZadSpr = osebaZadSpr;
}

public String getSifra() {
return this.sifra;
}

public void setSifra(String sifra) {
this.sifra = sifra;
}

public Date getVeljaDo() 

Re: gwt openpa serialization problem

2012-10-02 Thread Jens
Your entity is serializable and you want to send it from server to client. 
Most JPA providers enhance entity classes to support features like lazy 
loading, so although you have used a java.util.List in your entity code it 
could very well become an org.apache.openjpa.kernel.DelegatingResultList 
after the class has been enhanced by your JPA provider. You should check 
this in the OpenJPA documentation.

If this class does not implement serializable or is not visible to the GWT 
compiler it does not end up in your serialization policy file (thats the 
hash.rpc file). The server checks against this file during serialization 
and gives you the above error.

A common way to solve this is to use DTO classes. GWT's RequestFactory for 
example does something similar by using Autobeans on the client side and 
let the server classes be pure server classes.

-- J.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/Kg2zCUgCXXQJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



GWT SERIALIZATION PROBLEM

2012-04-27 Thread Nitheesh Chandran
Hello  Guys ,

I have a problem ,I want to save an object to the database. I passed
the object to the server using a function. Like this
http://www.easywayserver.com/blog/how-to-serializable-object-in-java-2/.
But my RPC is getting failed every time. What will be the problem ? i
used isSerializable marker interface for serialization. Cant we send
client object to the server through RPC?

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT SERIALIZATION PROBLEM

2012-04-27 Thread Alfredo Quiroga-Villamil
Hard to tell without seeing code or stack trace. Please provide:

1. A bit of code illustrating the main players. DTO, Service,
ServiceAsync, ServiceImpl method.
2. Stack Trace for the failure.

Regards,

Alfredo

On Wed, Apr 25, 2012 at 6:20 AM, Nitheesh Chandran
nithe...@aviamatica.com wrote:
 Hello  Guys ,

 I have a problem ,I want to save an object to the database. I passed
 the object to the server using a function. Like this
 http://www.easywayserver.com/blog/how-to-serializable-object-in-java-2/.
 But my RPC is getting failed every time. What will be the problem ? i
 used isSerializable marker interface for serialization. Cant we send
 client object to the server through RPC?

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-web-toolkit?hl=en.




-- 
Alfredo Quiroga-Villamil

AOL/Yahoo/Gmail/MSN IM:  lawwton

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Date Serialization problem

2011-04-01 Thread Juan Pablo Gardella
But is the same time. I think gwt serialize the long value of the time and
then create a date in client side with this value. Is this correct?

2011/4/1 Brendan Doherty bren...@propertysimplified.com

 How will noon fix the problem?

 Assuming your server is running on central time (UTC-6) and you pass it to
 a client I'm running here in New Zealand (currently UTC+13), your March 15
 noon will become March 16 6am.  You'll still be a day off.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Date Serialization problem

2011-04-01 Thread Paul Robinson

The standard GWT RPC serialization for dates writes out the long value, so that 
should be sent correctly. The error comes because when you convert that long to 
a string, you do so in a particular timezone, and your choice of timezone can 
change the day that you think this time point occurred on.

Passing your dates as strings, or some other custom encoding will fix the 
problem. The other option is to change GWT by writing your own custom field 
serializers for java.util.Date, java.sql.Date and java.sql.Timestamp so that it 
sends dates with separate values for day, month and year.

See 
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/5c397f3ffc4e24fa/a925fc77879fa6b6

Paul

On 01/04/11 12:22, Juan Pablo Gardella wrote:

But is the same time. I think gwt serialize the long value of the time and then 
create a date in client side with this value. Is this correct?

2011/4/1 Brendan Doherty bren...@propertysimplified.com 
mailto:bren...@propertysimplified.com

How will noon fix the problem?

Assuming your server is running on central time (UTC-6) and you pass it to 
a client I'm running here in New Zealand (currently UTC+13), your March 15 noon 
will become March 16 6am.  You'll still be a day off.
-- 
You received this message because you are subscribed to the Google Groups Google Web Toolkit group.

To post to this group, send email to google-web-toolkit@googlegroups.com 
mailto:google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com 
mailto:google-web-toolkit%2bunsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


--
You received this message because you are subscribed to the Google Groups Google 
Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


--
You received this message because you are subscribed to the Google Groups Google 
Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Date Serialization problem

2011-04-01 Thread Andy
This is the reason we created the UTCDateBox. We only send a Long back
and forth between the client and server and that Long always
represents midnight in UTC. This avoids confusion when users in
different time zones are choosing dates.

You can see the UTCDateBox demo and source:

http://code.google.com/p/gwt-traction/

Cheers,
Andy

On Mar 31, 2:52 pm, SVR svr...@gmail.com wrote:
 Has anybody noticed a problem with dates and RPC. Basically I receive a date
 from the backend and able to see the correct date in the RPC Impl in the
 debugger but when I set the Date field on the client (after the the results
 are serialized), I see that the date is offset by a day.
 I havnt tested extensively for what dates cause this problem, but I do see
 this randomly. Yes the Client and the Server are in different time zones,
 but I am not setting the time component (using sql.date on the server side,
 which essentially has no time component).

 Anybody has encountered this before? I can work aound this (by passing the
 DD, MM,  components separately), but want to understand the problem
 better.
 Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



GWT Date Serialization problem

2011-03-31 Thread SVR
Has anybody noticed a problem with dates and RPC. Basically I receive a date
from the backend and able to see the correct date in the RPC Impl in the
debugger but when I set the Date field on the client (after the the results
are serialized), I see that the date is offset by a day.
I havnt tested extensively for what dates cause this problem, but I do see
this randomly. Yes the Client and the Server are in different time zones,
but I am not setting the time component (using sql.date on the server side,
which essentially has no time component).

Anybody has encountered this before? I can work aound this (by passing the
DD, MM,  components separately), but want to understand the problem
better.
Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Date Serialization problem

2011-03-31 Thread Juan Pablo Gardella
How are you do when I set the Date field on the client?

The serialization to server-client is Ok, but to client-server fail?

Juan


2011/3/31 SVR svr...@gmail.com

 Has anybody noticed a problem with dates and RPC. Basically I receive a
 date from the backend and able to see the correct date in the RPC Impl in
 the debugger but when I set the Date field on the client (after the the
 results are serialized), I see that the date is offset by a day.
 I havnt tested extensively for what dates cause this problem, but I do see
 this randomly. Yes the Client and the Server are in different time zones,
 but I am not setting the time component (using sql.date on the server side,
 which essentially has no time component).

 Anybody has encountered this before? I can work aound this (by passing the
 DD, MM,  components separately), but want to understand the problem
 better.
 Thanks

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Date Serialization problem

2011-03-31 Thread SVR
Serialization from Client to Server is OK, but Server to Client fails.
I enter say Jan 31, 1979 (a simple Text with DatePicker) and it get saved to
the Database as such, but when I get back the value from the server, I can
see the correct value in the server (RPC Impl) as Jan 31, 1979, but when it
comes back to the client after the RPC call, the value is Jan 30, 1979.


On Thu, Mar 31, 2011 at 3:08 PM, Juan Pablo Gardella 
gardellajuanpa...@gmail.com wrote:

 How are you do when I set the Date field on the client?

 The serialization to server-client is Ok, but to client-server fail?

 Juan


  2011/3/31 SVR svr...@gmail.com

 Has anybody noticed a problem with dates and RPC. Basically I receive a
 date from the backend and able to see the correct date in the RPC Impl in
 the debugger but when I set the Date field on the client (after the the
 results are serialized), I see that the date is offset by a day.
 I havnt tested extensively for what dates cause this problem, but I do see
 this randomly. Yes the Client and the Server are in different time zones,
 but I am not setting the time component (using sql.date on the server side,
 which essentially has no time component).

 Anybody has encountered this before? I can work aound this (by passing the
 DD, MM,  components separately), but want to understand the problem
 better.
 Thanks

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Date Serialization problem

2011-03-31 Thread Juan Pablo Gardella
You sent the date to client via a asynchCall. So you receive onSuccesfull or
onFailure. You are update in onSuccesful the date of the simple text
with which value? Can you share the relevant code?

Are you use DateBox?

Juan

2011/3/31 SVR svr...@gmail.com

 Serialization from Client to Server is OK, but Server to Client fails.
 I enter say Jan 31, 1979 (a simple Text with DatePicker) and it get saved
 to the Database as such, but when I get back the value from the server, I
 can see the correct value in the server (RPC Impl) as Jan 31, 1979, but when
 it comes back to the client after the RPC call, the value is Jan 30, 1979.



 On Thu, Mar 31, 2011 at 3:08 PM, Juan Pablo Gardella 
 gardellajuanpa...@gmail.com wrote:

 How are you do when I set the Date field on the client?

 The serialization to server-client is Ok, but to client-server fail?

 Juan


  2011/3/31 SVR svr...@gmail.com

 Has anybody noticed a problem with dates and RPC. Basically I receive a
 date from the backend and able to see the correct date in the RPC Impl in
 the debugger but when I set the Date field on the client (after the the
 results are serialized), I see that the date is offset by a day.
 I havnt tested extensively for what dates cause this problem, but I do
 see this randomly. Yes the Client and the Server are in different time
 zones, but I am not setting the time component (using sql.date on the server
 side, which essentially has no time component).

 Anybody has encountered this before? I can work aound this (by passing
 the DD, MM,  components separately), but want to understand the problem
 better.
 Thanks

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com
 .
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Date Serialization problem

2011-03-31 Thread SVR
Simplifying my use case:

I have a Text box from which I read the value from:

Sender is a shared datastore between the client and the server and is of the
form:
Sender{
   java.util.date dateOfBirth;
 }

GWT Client Side:

TextBox birthDate;
String medDateFormat =
locale.getDateTimeFormatInfo().dateFormatMedium();
String dateString = birthDate.getText();
Date  date = DateTimeFormat.getFormat(medDateFormat).parse(dateString);
sender.setDateOfBirth(date);


This date is being passed to an RPC and stored in the DB.

RPC save:
java.sql.Date birthDate = null;
if (sender.getDateOfBirth() != null) {
SimpleDateFormat sqlformat = new SimpleDateFormat( -MM-dd
);
birthDate =
java.sql.Date.valueOf(sqlformat.format(sender.getDateOfBirth()));
}
and birthDate is stored in the DB.

So far its fine.

When I read back the data:
RPC read method:
java.sql.date date1
 sender.setDateOfBirth(date1.getTime());

GWT Client:
if (sender.getDateOfBirth() != null)

this.birthDate.setText(DateTimeFormat.getFormat(medDateFormat).format(
sender.getDateOfBirth()));
else
birthDate.setText();


Now I see the value on the textBox has changed, is off by a day!



On Thu, Mar 31, 2011 at 3:27 PM, Juan Pablo Gardella 
gardellajuanpa...@gmail.com wrote:

 You sent the date to client via a asynchCall. So you receive onSuccesfull
 or onFailure. You are update in onSuccesful the date of the simple text
 with which value? Can you share the relevant code?

 Are you use DateBox?

 Juan

 2011/3/31 SVR svr...@gmail.com

 Serialization from Client to Server is OK, but Server to Client fails.
 I enter say Jan 31, 1979 (a simple Text with DatePicker) and it get saved
 to the Database as such, but when I get back the value from the server, I
 can see the correct value in the server (RPC Impl) as Jan 31, 1979, but when
 it comes back to the client after the RPC call, the value is Jan 30, 1979.



 On Thu, Mar 31, 2011 at 3:08 PM, Juan Pablo Gardella 
 gardellajuanpa...@gmail.com wrote:

 How are you do when I set the Date field on the client?

 The serialization to server-client is Ok, but to client-server fail?

 Juan


  2011/3/31 SVR svr...@gmail.com

 Has anybody noticed a problem with dates and RPC. Basically I receive a
 date from the backend and able to see the correct date in the RPC Impl in
 the debugger but when I set the Date field on the client (after the the
 results are serialized), I see that the date is offset by a day.
 I havnt tested extensively for what dates cause this problem, but I do
 see this randomly. Yes the Client and the Server are in different time
 zones, but I am not setting the time component (using sql.date on the 
 server
 side, which essentially has no time component).

 Anybody has encountered this before? I can work aound this (by passing
 the DD, MM,  components separately), but want to understand the problem
 better.
 Thanks

 --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com
 .
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


  --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Date Serialization problem

2011-03-31 Thread Josh Berry
Pretty sure this is a simple issue of the timezone messing things up.
(Sorry for not having a solution right off, just something to look
into.)


On Thu, Mar 31, 2011 at 4:03 PM, SVR svr...@gmail.com wrote:
 Simplifying my use case:

 I have a Text box from which I read the value from:

 Sender is a shared datastore between the client and the server and is of the
 form:
 Sender{
    java.util.date dateOfBirth;
  }

 GWT Client Side:

     TextBox birthDate;
     String medDateFormat =
 locale.getDateTimeFormatInfo().dateFormatMedium();
     String dateString = birthDate.getText();
     Date  date = DateTimeFormat.getFormat(medDateFormat).parse(dateString);
     sender.setDateOfBirth(date);


 This date is being passed to an RPC and stored in the DB.

 RPC save:
         java.sql.Date birthDate = null;
         if (sender.getDateOfBirth() != null) {
             SimpleDateFormat sqlformat = new SimpleDateFormat( -MM-dd
 );
             birthDate =
 java.sql.Date.valueOf(sqlformat.format(sender.getDateOfBirth()));
         }
 and birthDate is stored in the DB.

 So far its fine.

 When I read back the data:
 RPC read method:
 java.sql.date date1
  sender.setDateOfBirth(date1.getTime());

 GWT Client:
         if (sender.getDateOfBirth() != null)

 this.birthDate.setText(DateTimeFormat.getFormat(medDateFormat).format(
                 sender.getDateOfBirth()));
         else
             birthDate.setText();


 Now I see the value on the textBox has changed, is off by a day!



 On Thu, Mar 31, 2011 at 3:27 PM, Juan Pablo Gardella
 gardellajuanpa...@gmail.com wrote:

 You sent the date to client via a asynchCall. So you receive onSuccesfull
 or onFailure. You are update in onSuccesful the date of the simple text
 with which value? Can you share the relevant code?
 Are you use DateBox?
 Juan

 2011/3/31 SVR svr...@gmail.com

 Serialization from Client to Server is OK, but Server to Client fails.
 I enter say Jan 31, 1979 (a simple Text with DatePicker) and it get saved
 to the Database as such, but when I get back the value from the server, I
 can see the correct value in the server (RPC Impl) as Jan 31, 1979, but when
 it comes back to the client after the RPC call, the value is Jan 30, 1979.


 On Thu, Mar 31, 2011 at 3:08 PM, Juan Pablo Gardella
 gardellajuanpa...@gmail.com wrote:

 How are you do when I set the Date field on the client?
 The serialization to server-client is Ok, but to client-server fail?
 Juan

 2011/3/31 SVR svr...@gmail.com

 Has anybody noticed a problem with dates and RPC. Basically I receive a
 date from the backend and able to see the correct date in the RPC Impl in
 the debugger but when I set the Date field on the client (after the the
 results are serialized), I see that the date is offset by a day.
 I havnt tested extensively for what dates cause this problem, but I do
 see this randomly. Yes the Client and the Server are in different time
 zones, but I am not setting the time component (using sql.date on the 
 server
 side, which essentially has no time component).

 Anybody has encountered this before? I can work aound this (by passing
 the DD, MM,  components separately), but want to understand the 
 problem
 better.
 Thanks

 --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

 --
 You received this message because you are subscribed to the Google
 Groups Google Web Toolkit group.
 To post to this group, send email to
 google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-web-toolkit?hl=en.

 --
 You received this message because you are subscribed to the Google Groups
 Google Web Toolkit group.
 To post to this group, send email to google-web-toolkit@googlegroups.com.
 To unsubscribe from this group, send email to
 

Re: GWT Date Serialization problem

2011-03-31 Thread Juan Pablo Gardella
Check if the value returned by public long Date.getTime() are different.

In dabase is store correctly suppose.



2011/3/31 Josh Berry tae...@gmail.com

 Pretty sure this is a simple issue of the timezone messing things up.
 (Sorry for not having a solution right off, just something to look
 into.)


 On Thu, Mar 31, 2011 at 4:03 PM, SVR svr...@gmail.com wrote:
  Simplifying my use case:
 
  I have a Text box from which I read the value from:
 
  Sender is a shared datastore between the client and the server and is of
 the
  form:
  Sender{
 java.util.date dateOfBirth;
   }
 
  GWT Client Side:
 
  TextBox birthDate;
  String medDateFormat =
  locale.getDateTimeFormatInfo().dateFormatMedium();
  String dateString = birthDate.getText();
  Date  date =
 DateTimeFormat.getFormat(medDateFormat).parse(dateString);
  sender.setDateOfBirth(date);
 
 
  This date is being passed to an RPC and stored in the DB.
 
  RPC save:
  java.sql.Date birthDate = null;
  if (sender.getDateOfBirth() != null) {
  SimpleDateFormat sqlformat = new SimpleDateFormat(
 -MM-dd
  );
  birthDate =
  java.sql.Date.valueOf(sqlformat.format(sender.getDateOfBirth()));
  }
  and birthDate is stored in the DB.
 
  So far its fine.
 
  When I read back the data:
  RPC read method:
  java.sql.date date1
   sender.setDateOfBirth(date1.getTime());
 
  GWT Client:
  if (sender.getDateOfBirth() != null)
 
  this.birthDate.setText(DateTimeFormat.getFormat(medDateFormat).format(
  sender.getDateOfBirth()));
  else
  birthDate.setText();
 
 
  Now I see the value on the textBox has changed, is off by a day!
 
 
 
  On Thu, Mar 31, 2011 at 3:27 PM, Juan Pablo Gardella
  gardellajuanpa...@gmail.com wrote:
 
  You sent the date to client via a asynchCall. So you receive
 onSuccesfull
  or onFailure. You are update in onSuccesful the date of the simple text
  with which value? Can you share the relevant code?
  Are you use DateBox?
  Juan
 
  2011/3/31 SVR svr...@gmail.com
 
  Serialization from Client to Server is OK, but Server to Client fails.
  I enter say Jan 31, 1979 (a simple Text with DatePicker) and it get
 saved
  to the Database as such, but when I get back the value from the server,
 I
  can see the correct value in the server (RPC Impl) as Jan 31, 1979, but
 when
  it comes back to the client after the RPC call, the value is Jan 30,
 1979.
 
 
  On Thu, Mar 31, 2011 at 3:08 PM, Juan Pablo Gardella
  gardellajuanpa...@gmail.com wrote:
 
  How are you do when I set the Date field on the client?
  The serialization to server-client is Ok, but to client-server fail?
  Juan
 
  2011/3/31 SVR svr...@gmail.com
 
  Has anybody noticed a problem with dates and RPC. Basically I receive
 a
  date from the backend and able to see the correct date in the RPC
 Impl in
  the debugger but when I set the Date field on the client (after the
 the
  results are serialized), I see that the date is offset by a day.
  I havnt tested extensively for what dates cause this problem, but I
 do
  see this randomly. Yes the Client and the Server are in different
 time
  zones, but I am not setting the time component (using sql.date on the
 server
  side, which essentially has no time component).
 
  Anybody has encountered this before? I can work aound this (by
 passing
  the DD, MM,  components separately), but want to understand the
 problem
  better.
  Thanks
 
  --
  You received this message because you are subscribed to the Google
  Groups Google Web Toolkit group.
  To post to this group, send email to
  google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/google-web-toolkit?hl=en.
 
  --
  You received this message because you are subscribed to the Google
  Groups Google Web Toolkit group.
  To post to this group, send email to
  google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/google-web-toolkit?hl=en.
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Google Web Toolkit group.
  To post to this group, send email to
 google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
  http://groups.google.com/group/google-web-toolkit?hl=en.
 
  --
  You received this message because you are subscribed to the Google
 Groups
  Google Web Toolkit group.
  To post to this group, send email to
 google-web-toolkit@googlegroups.com.
  To unsubscribe from this group, send email to
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group at
  

Re: GWT Date Serialization problem

2011-03-31 Thread cri
I've experienced and have had to deal with this problem. It is a
timezone related problem. Here's an example.

1) You initialize a Date object from the database on the server side.
Say the date in the database is March 15. Your Date object will be
initialized to March 15 at midnight, because a Date object encodes an
instant in time, not just a calendar day.

2) Now you pass the Date object to the client layer in a later
timezone, say from Eastern to Central timezones. In the central
timezone March 15 at midnight translates to March 14 at 11pm. So, the
calendar day is off by one.

You get a similar problem when passing dates from the client to the
server.

The solution that I've always used is to pass dates between the GWT
client and server as Strings, e.g. MM/dd/.

On Mar 31, 3:10 pm, Juan Pablo Gardella gardellajuanpa...@gmail.com
wrote:
 Check if the value returned by public long Date.getTime() are different.

 In dabase is store correctly suppose.

 2011/3/31 Josh Berry tae...@gmail.com







  Pretty sure this is a simple issue of the timezone messing things up.
  (Sorry for not having a solution right off, just something to look
  into.)

  On Thu, Mar 31, 2011 at 4:03 PM, SVR svr...@gmail.com wrote:
   Simplifying my use case:

   I have a Text box from which I read the value from:

   Sender is a shared datastore between the client and the server and is of
  the
   form:
   Sender{
      java.util.date dateOfBirth;
        }

   GWT Client Side:

       TextBox birthDate;
       String medDateFormat =
   locale.getDateTimeFormatInfo().dateFormatMedium();
       String dateString = birthDate.getText();
       Date  date =
  DateTimeFormat.getFormat(medDateFormat).parse(dateString);
       sender.setDateOfBirth(date);

   This date is being passed to an RPC and stored in the DB.

   RPC save:
           java.sql.Date birthDate = null;
           if (sender.getDateOfBirth() != null) {
               SimpleDateFormat sqlformat = new SimpleDateFormat(
  -MM-dd
   );
               birthDate =
   java.sql.Date.valueOf(sqlformat.format(sender.getDateOfBirth()));
           }
   and birthDate is stored in the DB.

   So far its fine.

   When I read back the data:
   RPC read method:
   java.sql.date date1
    sender.setDateOfBirth(date1.getTime());

   GWT Client:
           if (sender.getDateOfBirth() != null)

   this.birthDate.setText(DateTimeFormat.getFormat(medDateFormat).format(
                   sender.getDateOfBirth()));
           else
               birthDate.setText();

   Now I see the value on the textBox has changed, is off by a day!

   On Thu, Mar 31, 2011 at 3:27 PM, Juan Pablo Gardella
   gardellajuanpa...@gmail.com wrote:

   You sent the date to client via a asynchCall. So you receive
  onSuccesfull
   or onFailure. You are update in onSuccesful the date of the simple text
   with which value? Can you share the relevant code?
   Are you use DateBox?
   Juan

   2011/3/31 SVR svr...@gmail.com

   Serialization from Client to Server is OK, but Server to Client fails.
   I enter say Jan 31, 1979 (a simple Text with DatePicker) and it get
  saved
   to the Database as such, but when I get back the value from the server,
  I
   can see the correct value in the server (RPC Impl) as Jan 31, 1979, but
  when
   it comes back to the client after the RPC call, the value is Jan 30,
  1979.

   On Thu, Mar 31, 2011 at 3:08 PM, Juan Pablo Gardella
   gardellajuanpa...@gmail.com wrote:

   How are you do when I set the Date field on the client?
   The serialization to server-client is Ok, but to client-server fail?
   Juan

   2011/3/31 SVR svr...@gmail.com

   Has anybody noticed a problem with dates and RPC. Basically I receive
  a
   date from the backend and able to see the correct date in the RPC
  Impl in
   the debugger but when I set the Date field on the client (after the
  the
   results are serialized), I see that the date is offset by a day.
   I havnt tested extensively for what dates cause this problem, but I
  do
   see this randomly. Yes the Client and the Server are in different
  time
   zones, but I am not setting the time component (using sql.date on the
  server
   side, which essentially has no time component).

   Anybody has encountered this before? I can work aound this (by
  passing
   the DD, MM,  components separately), but want to understand the
  problem
   better.
   Thanks

   --
   You received this message because you are subscribed to the Google
   Groups Google Web Toolkit group.
   To post to this group, send email to
   google-web-toolkit@googlegroups.com.
   To unsubscribe from this group, send email to
   google-web-toolkit+unsubscr...@googlegroups.com.
   For more options, visit this group at
  http://groups.google.com/group/google-web-toolkit?hl=en.

   --
   You received this message because you are subscribed to the Google
   Groups Google Web Toolkit group.
   To post to this group, send email to
   google-web-toolkit@googlegroups.com.
   To 

Re: GWT Date Serialization problem

2011-03-31 Thread Martin Larsson

On 31. mars 2011 22:33, cri wrote:

The solution that I've always used is to pass dates between the GWT
client and server as Strings, e.g. MM/dd/.


Or set the time component to noon instead of midnight.

M.

--
You received this message because you are subscribed to the Google Groups Google 
Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: GWT Date Serialization problem

2011-03-31 Thread Brendan Doherty
How will noon fix the problem?

Assuming your server is running on central time (UTC-6) and you pass it to a 
client I'm running here in New Zealand (currently UTC+13), your March 15 
noon will become March 16 6am.  You'll still be a day off.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: OpenJPA GWT serialization problem.

2010-11-09 Thread dparish
I tried using em.clear(). I did this after loading and accessing my
object. I also changed my fetch type to EAGER.  Sadly it still fails ;
(

-Dave


On Nov 9, 6:59 am, dparish dpar...@gmail.com wrote:
 Thanks David.

 I tried LAZY and EAGER. Both caused the problem.

 For #2, that seems promising. There's an EntityManager clear method,
 but that would affect all threads using the entity manager.  Any
 thoughts on how to do that detach?

 On Nov 8, 8:20 pm, David Chandler drfibona...@google.com wrote:







  Hi dparish,

  There are three issues here:

  1. GWT needs a fully populated object graph to send back to the
  client. Lazy fetching will not work across the client / server
  boundary, so you must ensure that your code fetches all relations
  eagerly (via an annotation or a separate call if needed).

  2. JDO and JPA implementations use proxy classes for objects attached
  to a persistence manager. Before they can be sent back to the client,
  you must detach all objects from the PM.

  3. Even then, GWT won't be able to serialize any types for which it
  doesn't know the source (like App Engine's Key class). The open source
  Gilead project and others like Objectify provide GWT wrappers for
  these.

  HTH,
  /dmc

  On Mon, Nov 8, 2010 at 8:17 PM, dparish dpar...@gmail.com wrote:
   I have an entity with a member like this:

   @Entity
   public class Foo  implements Serializable{

     �...@onetomany(mappedBy=foo,targetEntity=InternalText.class,
                 fetch=FetchType.EAGER)  // I tried Lazy too.

       private ArrayListInternalTextinternalTextEntries;

   When I try to use Foo I get this error:

   Throwable occurred:
   com.google.gwt.user.client.rpc.SerializationException: Type
   'org.apache.openjpa.util.java$util$ArrayList$proxy' 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 =
   [blah.blah.entities.internalt...@36ae36ae,
   blah.bhla.entities.internalt...@3fca3fca,
   blah.blah.retain.entities.internalt...@42474247,
   blah.blah.entities.internalt...@48724872]
          at
   com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali
ze(ServerSerializationStreamWriter.java:
   610)
          at
   com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.write
Object(AbstractSerializationStreamWriter.java:
   129)
          at 
   com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
   $ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
          at
   com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali
zeValue(ServerSerializationStreamWriter.java:
   534)
          at
   com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali
zeClass(ServerSerializationStreamWriter.java:
   700)

   From what I can tell openjpa is creating a helper representation of
   ArrayList that it uses to assist in monitoring and lazy loading the
   child table.  I've tried eager and lazy fetching.

   I tried this:

          ArrayListInternalText newText = new ArrayListInternalText();
          for (InternalText textItem: foo.getInternalTextEntries()) {
                  newText.add(textItem);
          }
          foo.setInternalTextEntries(newText);

   It got past my error, but then the next layer down had trouble (Date
   in the InternalText class)

   Type 'org.apache.openjpa.util.java$util$Date$proxy' was not included
   in the set of types which can be serialized by this
   SerializationPolicy

   --
   You received this message because you are subscribed to the Google Groups 
   Google Web Toolkit group.
   To post to this group, send email to google-web-tool...@googlegroups.com.
   To unsubscribe from this group, send email to 
   google-web-toolkit+unsubscr...@googlegroups.com.
   For more options, visit this group 
   athttp://groups.google.com/group/google-web-toolkit?hl=en.

  --
  David Chandler
  Developer Programs Engineer, Google Web 
  Toolkithttp://googlewebtoolkit.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: OpenJPA GWT serialization problem.

2010-11-09 Thread dparish
Thanks David.

I tried LAZY and EAGER. Both caused the problem.

For #2, that seems promising. There's an EntityManager clear method,
but that would affect all threads using the entity manager.  Any
thoughts on how to do that detach?

On Nov 8, 8:20 pm, David Chandler drfibona...@google.com wrote:
 Hi dparish,

 There are three issues here:

 1. GWT needs a fully populated object graph to send back to the
 client. Lazy fetching will not work across the client / server
 boundary, so you must ensure that your code fetches all relations
 eagerly (via an annotation or a separate call if needed).

 2. JDO and JPA implementations use proxy classes for objects attached
 to a persistence manager. Before they can be sent back to the client,
 you must detach all objects from the PM.

 3. Even then, GWT won't be able to serialize any types for which it
 doesn't know the source (like App Engine's Key class). The open source
 Gilead project and others like Objectify provide GWT wrappers for
 these.

 HTH,
 /dmc









 On Mon, Nov 8, 2010 at 8:17 PM, dparish dpar...@gmail.com wrote:
  I have an entity with a member like this:

  @Entity
  public class Foo  implements Serializable{

    �...@onetomany(mappedBy=foo,targetEntity=InternalText.class,
                fetch=FetchType.EAGER)  // I tried Lazy too.

      private ArrayListInternalTextinternalTextEntries;

  When I try to use Foo I get this error:

  Throwable occurred:
  com.google.gwt.user.client.rpc.SerializationException: Type
  'org.apache.openjpa.util.java$util$ArrayList$proxy' 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 =
  [blah.blah.entities.internalt...@36ae36ae,
  blah.bhla.entities.internalt...@3fca3fca,
  blah.blah.retain.entities.internalt...@42474247,
  blah.blah.entities.internalt...@48724872]
         at
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali 
  ze(ServerSerializationStreamWriter.java:
  610)
         at
  com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.write 
  Object(AbstractSerializationStreamWriter.java:
  129)
         at 
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
  $ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
         at
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali 
  zeValue(ServerSerializationStreamWriter.java:
  534)
         at
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali 
  zeClass(ServerSerializationStreamWriter.java:
  700)

  From what I can tell openjpa is creating a helper representation of
  ArrayList that it uses to assist in monitoring and lazy loading the
  child table.  I've tried eager and lazy fetching.

  I tried this:

         ArrayListInternalText newText = new ArrayListInternalText();
         for (InternalText textItem: foo.getInternalTextEntries()) {
                 newText.add(textItem);
         }
         foo.setInternalTextEntries(newText);

  It got past my error, but then the next layer down had trouble (Date
  in the InternalText class)

  Type 'org.apache.openjpa.util.java$util$Date$proxy' was not included
  in the set of types which can be serialized by this
  SerializationPolicy

  --
  You received this message because you are subscribed to the Google Groups 
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-web-toolkit?hl=en.

 --
 David Chandler
 Developer Programs Engineer, Google Web 
 Toolkithttp://googlewebtoolkit.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: OpenJPA GWT serialization problem.

2010-11-09 Thread David Chandler
In JDO, there are pm.detachX() methods you can use to do this. In JPA,
it appears detachment is automatically done via an annotation, but the
detached objects will still contain non-serializable stuff. Details
here:

http://timepedia.blogspot.com/2009/04/google-appengine-and-gwt-now-marriage.html

HTH,
/dmc

On Tue, Nov 9, 2010 at 7:59 AM, dparish dpar...@gmail.com wrote:
 Thanks David.

 I tried LAZY and EAGER. Both caused the problem.

 For #2, that seems promising. There's an EntityManager clear method,
 but that would affect all threads using the entity manager.  Any
 thoughts on how to do that detach?

 On Nov 8, 8:20 pm, David Chandler drfibona...@google.com wrote:
 Hi dparish,

 There are three issues here:

 1. GWT needs a fully populated object graph to send back to the
 client. Lazy fetching will not work across the client / server
 boundary, so you must ensure that your code fetches all relations
 eagerly (via an annotation or a separate call if needed).

 2. JDO and JPA implementations use proxy classes for objects attached
 to a persistence manager. Before they can be sent back to the client,
 you must detach all objects from the PM.

 3. Even then, GWT won't be able to serialize any types for which it
 doesn't know the source (like App Engine's Key class). The open source
 Gilead project and others like Objectify provide GWT wrappers for
 these.

 HTH,
 /dmc









 On Mon, Nov 8, 2010 at 8:17 PM, dparish dpar...@gmail.com wrote:
  I have an entity with a member like this:

  @Entity
  public class Foo  implements Serializable{

    �...@onetomany(mappedBy=foo,targetEntity=InternalText.class,
                fetch=FetchType.EAGER)  // I tried Lazy too.

      private ArrayListInternalTextinternalTextEntries;

  When I try to use Foo I get this error:

  Throwable occurred:
  com.google.gwt.user.client.rpc.SerializationException: Type
  'org.apache.openjpa.util.java$util$ArrayList$proxy' 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 =
  [blah.blah.entities.internalt...@36ae36ae,
  blah.bhla.entities.internalt...@3fca3fca,
  blah.blah.retain.entities.internalt...@42474247,
  blah.blah.entities.internalt...@48724872]
         at
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali
   ze(ServerSerializationStreamWriter.java:
  610)
         at
  com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.write
   Object(AbstractSerializationStreamWriter.java:
  129)
         at 
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
  $ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
         at
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali
   zeValue(ServerSerializationStreamWriter.java:
  534)
         at
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali
   zeClass(ServerSerializationStreamWriter.java:
  700)

  From what I can tell openjpa is creating a helper representation of
  ArrayList that it uses to assist in monitoring and lazy loading the
  child table.  I've tried eager and lazy fetching.

  I tried this:

         ArrayListInternalText newText = new ArrayListInternalText();
         for (InternalText textItem: foo.getInternalTextEntries()) {
                 newText.add(textItem);
         }
         foo.setInternalTextEntries(newText);

  It got past my error, but then the next layer down had trouble (Date
  in the InternalText class)

  Type 'org.apache.openjpa.util.java$util$Date$proxy' was not included
  in the set of types which can be serialized by this
  SerializationPolicy

  --
  You received this message because you are subscribed to the Google Groups 
  Google Web Toolkit group.
  To post to this group, send email to google-web-tool...@googlegroups.com.
  To unsubscribe from this group, send email to 
  google-web-toolkit+unsubscr...@googlegroups.com.
  For more options, visit this group 
  athttp://groups.google.com/group/google-web-toolkit?hl=en.

 --
 David Chandler
 Developer Programs Engineer, Google Web 
 Toolkithttp://googlewebtoolkit.blogspot.com/

 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-web-toolkit?hl=en.





-- 
David Chandler
Developer Programs Engineer, Google Web Toolkit
http://googlewebtoolkit.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 

OpenJPA GWT serialization problem.

2010-11-08 Thread dparish
I have an entity with a member like this:


@Entity
public class Foo  implements Serializable{

@OneToMany(mappedBy=foo,targetEntity=InternalText.class,
   fetch=FetchType.EAGER)  // I tried Lazy too.

 private ArrayListInternalTextinternalTextEntries;


When I try to use Foo I get this error:


Throwable occurred:
com.google.gwt.user.client.rpc.SerializationException: Type
'org.apache.openjpa.util.java$util$ArrayList$proxy' 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 =
[blah.blah.entities.internalt...@36ae36ae,
blah.bhla.entities.internalt...@3fca3fca,
blah.blah.retain.entities.internalt...@42474247,
blah.blah.entities.internalt...@48724872]
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
610)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
129)
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:
700)


From what I can tell openjpa is creating a helper representation of
ArrayList that it uses to assist in monitoring and lazy loading the
child table.  I've tried eager and lazy fetching.

I tried this:

ArrayListInternalText newText = new ArrayListInternalText();
for (InternalText textItem: foo.getInternalTextEntries()) {
newText.add(textItem);
}
foo.setInternalTextEntries(newText);


It got past my error, but then the next layer down had trouble (Date
in the InternalText class)

Type 'org.apache.openjpa.util.java$util$Date$proxy' was not included
in the set of types which can be serialized by this
SerializationPolicy



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: OpenJPA GWT serialization problem.

2010-11-08 Thread David Chandler
Hi dparish,

There are three issues here:

1. GWT needs a fully populated object graph to send back to the
client. Lazy fetching will not work across the client / server
boundary, so you must ensure that your code fetches all relations
eagerly (via an annotation or a separate call if needed).

2. JDO and JPA implementations use proxy classes for objects attached
to a persistence manager. Before they can be sent back to the client,
you must detach all objects from the PM.

3. Even then, GWT won't be able to serialize any types for which it
doesn't know the source (like App Engine's Key class). The open source
Gilead project and others like Objectify provide GWT wrappers for
these.

HTH,
/dmc

On Mon, Nov 8, 2010 at 8:17 PM, dparish dpar...@gmail.com wrote:
 I have an entity with a member like this:


 @Entity
 public class Foo  implements Serializable{

   �...@onetomany(mappedBy=foo,targetEntity=InternalText.class,
               fetch=FetchType.EAGER)  // I tried Lazy too.

     private ArrayListInternalTextinternalTextEntries;


 When I try to use Foo I get this error:


 Throwable occurred:
 com.google.gwt.user.client.rpc.SerializationException: Type
 'org.apache.openjpa.util.java$util$ArrayList$proxy' 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 =
 [blah.blah.entities.internalt...@36ae36ae,
 blah.bhla.entities.internalt...@3fca3fca,
 blah.blah.retain.entities.internalt...@42474247,
 blah.blah.entities.internalt...@48724872]
        at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
 610)
        at
 com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
 129)
        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:
 700)


 From what I can tell openjpa is creating a helper representation of
 ArrayList that it uses to assist in monitoring and lazy loading the
 child table.  I've tried eager and lazy fetching.

 I tried this:

        ArrayListInternalText newText = new ArrayListInternalText();
        for (InternalText textItem: foo.getInternalTextEntries()) {
                newText.add(textItem);
        }
        foo.setInternalTextEntries(newText);


 It got past my error, but then the next layer down had trouble (Date
 in the InternalText class)

 Type 'org.apache.openjpa.util.java$util$Date$proxy' was not included
 in the set of types which can be serialized by this
 SerializationPolicy



 --
 You received this message because you are subscribed to the Google Groups 
 Google Web Toolkit group.
 To post to this group, send email to google-web-tool...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-web-toolkit+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-web-toolkit?hl=en.





-- 
David Chandler
Developer Programs Engineer, Google Web Toolkit
http://googlewebtoolkit.blogspot.com/

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



enum Serialization problem

2010-10-07 Thread javest
Hi

I have enum in my class which is passed through RPC. when I am looking
into the .gwt.rpc and rpc.log files my enum is there, seems
Serialization is ok. Till now my application is working fine (actually
that enum is not used on the client's side, only on the server layer),
but recently I noticed couple of exceptions in the logs :
Type 'package.MyClassName$MyEnumName' was not assignable to
'com.google.gwt.user.client.rpc.IsSerializable' and did not have a
custom field serializer.  For security purposes, this type will not be
serialized.

I don't know why it wasn't a problem before, and I don't even know
when on runtime this exception accrued. But it seems very weird to me.


-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



[gwt-contrib] Re: Fix for date serialization problem in JsonRequestProcessor. Datanucleus returns custom subtypes ... (issue790801)

2010-08-22 Thread Amit Manjhi
LGTM.

On Sun, Aug 22, 2010 at 2:07 AM, cromwell...@google.com wrote:

 Reviewers: amitmanjhi, rjrjr,

 Description:
 Fix for date serialization problem in JsonRequestProcessor. Datanucleus
 returns custom subtypes of java.util.Date from the datastore, which
 causes Dates to be serialized as english strings.


 Please review this at http://gwt-code-reviews.appspot.com/790801/show

 Affected files:
  M user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java


 Index:
 user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
 ===
 --- user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
 (revision 8616)
 +++ user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java
 (working copy)
 @@ -320,7 +320,7 @@
 if (Boolean.class == type) {
   return value;
 }
 -if (Date.class == type) {
 +if (Date.class.isAssignableFrom(type)) {
   return String.valueOf(((Date) value).getTime());
 }
 if (Enum.class.isAssignableFrom(type)) {




-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

[gwt-contrib] [google-web-toolkit] r8619 committed - Fix for date serialization problem in JsonRequestProcessor. Datanucleu...

2010-08-22 Thread codesite-noreply

Revision: 8619
Author: gwt.mirror...@gmail.com
Date: Sun Aug 22 07:49:19 2010
Log: Fix for date serialization problem in JsonRequestProcessor.  
Datanucleus returns custom subtypes of java.util.Date from the datastore,  
which causes Dates to be serialized as english strings.


Review at http://gwt-code-reviews.appspot.com/790801

http://code.google.com/p/google-web-toolkit/source/detail?r=8619

Modified:
  
/trunk/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java


===
---  
/trunk/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java	 
Fri Aug 20 08:33:30 2010
+++  
/trunk/user/src/com/google/gwt/requestfactory/server/JsonRequestProcessor.java	 
Sun Aug 22 07:49:19 2010

@@ -320,7 +320,7 @@
 if (Boolean.class == type) {
   return value;
 }
-if (Date.class == type) {
+if (Date.class.isAssignableFrom(type)) {
   return String.valueOf(((Date) value).getTime());
 }
 if (Enum.class.isAssignableFrom(type)) {

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors


Re: Serialization Problem

2010-06-27 Thread Ahmed Shoeib
hi Sebastian Rothbucher ,
i founded the problem in returning arrayList of object from Member
Class
i replaced this with Array one dimension of Member Class
ans this problem solved

do you have any comment about why there is not available to return
arrayList  

thanks for reply ..


best regards,
ahmed shoeib


On Jun 25, 8:15 pm, Sebastian Rothbucher
sebastianrothbuc...@googlemail.com wrote:
 Hi Ahmed,
 does your Member class contain associations to other classes? If yes,
 I guess to have to repackage the lists as well... (i.e. create a new
 Hashtable and so on). Another question could be if you can have
 annotated classes on the client or you have to copy those classes as
 well, i.e. have a plain pojo and an annotated pojo... - you could just
 try with a few samples...
 Hope this helps
    Sebastian

 On Jun 14, 8:45 pm, Ahmed Shoeib ahmedelsayed.sho...@gmail.com
 wrote:

  Exception while dispatching incoming RPC call
  com.google.gwt.user.client.rpc.SerializationException: Type
  'org.datanucleus.store.appengine.query.StreamingQueryResult' 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 = []

  Members Class - on client
  -
  package com.Users.client;
  @PersistenceCapable
  public class Members implements Serializable{
  .
  .
  .

  }

  
  Entry Point --- Client Class

  the problem here

   // Get Persisted Member
                     memberService.getMembers(new 
  AsyncCallbackListMembers() {

                          @Override
                          public void onFailure(Throwable caught) {
                                  // TODO Auto-generated method stub

                          }

                          @Override
                          public void onSuccess(ListMembers result) {
                                  // TODO Auto-generated method stub
                                  adminPanel.add(new Label(get Members ));
                                  adminPanel.add(new Label(size  
  +result.size()));
                                  for (Members m : result) {
                                          adminPanel.add(new 
  Label(m.getMember()));
                                  }
                          }
                  });

  

  MembersServiceImpl   on Server
  

  package com.Users.server;
  @SuppressWarnings(serial)
  public class MembersServiceImpl extends RemoteServiceServlet
  implements
  MembersService {

  @SuppressWarnings(unchecked)
          @Override
          public ListMembers getMembers() throws NotLoggedInException {
                  // TODO Auto-generated method stub

                  ListMembers  returnList = new ArrayListMembers();

                  PersistenceManager pm = PMF.get().getPersistenceManager();
              String query = select from  + Members.class.getName();
              ListMembers members = (ListMembers)
  pm.newQuery(query).execute();

                   for(Members step: members)
                   {
                       returnList.add(step);
                   }
              return returnList;

          }

  }

  how to Solve this problem

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Serialization Problem

2010-06-25 Thread Sebastian Rothbucher
Hi Ahmed,
does your Member class contain associations to other classes? If yes,
I guess to have to repackage the lists as well... (i.e. create a new
Hashtable and so on). Another question could be if you can have
annotated classes on the client or you have to copy those classes as
well, i.e. have a plain pojo and an annotated pojo... - you could just
try with a few samples...
Hope this helps
   Sebastian

On Jun 14, 8:45 pm, Ahmed Shoeib ahmedelsayed.sho...@gmail.com
wrote:
 Exception while dispatching incoming RPC call
 com.google.gwt.user.client.rpc.SerializationException: Type
 'org.datanucleus.store.appengine.query.StreamingQueryResult' 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 = []

 Members Class - on client
 -
 package com.Users.client;
 @PersistenceCapable
 public class Members implements Serializable{
 .
 .
 .

 }

 
 Entry Point --- Client Class

 the problem here

  // Get Persisted Member
                    memberService.getMembers(new 
 AsyncCallbackListMembers() {

                         @Override
                         public void onFailure(Throwable caught) {
                                 // TODO Auto-generated method stub

                         }

                         @Override
                         public void onSuccess(ListMembers result) {
                                 // TODO Auto-generated method stub
                                 adminPanel.add(new Label(get Members ));
                                 adminPanel.add(new Label(size  
 +result.size()));
                                 for (Members m : result) {
                                         adminPanel.add(new 
 Label(m.getMember()));
                                 }
                         }
                 });

 

 MembersServiceImpl   on Server
 

 package com.Users.server;
 @SuppressWarnings(serial)
 public class MembersServiceImpl extends RemoteServiceServlet
 implements
 MembersService {

 @SuppressWarnings(unchecked)
         @Override
         public ListMembers getMembers() throws NotLoggedInException {
                 // TODO Auto-generated method stub

                 ListMembers  returnList = new ArrayListMembers();

                 PersistenceManager pm = PMF.get().getPersistenceManager();
             String query = select from  + Members.class.getName();
             ListMembers members = (ListMembers)
 pm.newQuery(query).execute();

                  for(Members step: members)
                  {
                      returnList.add(step);
                  }
             return returnList;

         }

 }

 how to Solve this problem

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Serialization Problem

2010-06-15 Thread Ahmed Shoeib
Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type
'org.datanucleus.store.appengine.query.StreamingQueryResult' 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 = []


Members Class - on client
-
package com.Users.client;
@PersistenceCapable
public class Members implements Serializable{
.
.
.
}



Entry Point --- Client Class

the problem here

 // Get Persisted Member
   memberService.getMembers(new AsyncCallbackListMembers() {

@Override
public void onFailure(Throwable caught) {
// TODO Auto-generated method stub

}

@Override
public void onSuccess(ListMembers result) {
// TODO Auto-generated method stub
adminPanel.add(new Label(get Members ));
adminPanel.add(new Label(size  
+result.size()));
for (Members m : result) {
adminPanel.add(new 
Label(m.getMember()));
}
}
});



MembersServiceImpl   on Server


package com.Users.server;
@SuppressWarnings(serial)
public class MembersServiceImpl extends RemoteServiceServlet
implements
MembersService {

@SuppressWarnings(unchecked)
@Override
public ListMembers getMembers() throws NotLoggedInException {
// TODO Auto-generated method stub

ListMembers  returnList = new ArrayListMembers();

PersistenceManager pm = PMF.get().getPersistenceManager();
String query = select from  + Members.class.getName();
ListMembers members = (ListMembers)
pm.newQuery(query).execute();



 for(Members step: members)
 {
 returnList.add(step);
 }
return returnList;

}

}




how to Solve this problem

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Serialization problem -- nested ArrayLists are full of NULL instead of data

2010-03-25 Thread Daniel Kvasnicka jr.
Hi guys,

I'm using GWT and I have problem with sending nested ArrayLists
through a RPC service. The data produced by the service look like
this:

ArrayList of objects of type A.
  every A has a (Array)List of B property
every B has a (Array)List of C property
  that property contains ArrayList of C -- those are leaf objects

I've made sure that on the server side, the object structure is
produced correctly. However when I place a breakpoint into the
onSuccess method of a callback that handles the response from the
service call, I get the top-level ArrayList of A and thats all. Their
properties are set (e.g. String props) but the ArrayList of B is full
of NULLs. The rest of the data gets lost somewhere. What could be the
problem?

I'm using the spring4gwt library. But I know that when return of the
service method is called, it returns the right data.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Serialization problem -- nested ArrayLists are full of NULL instead of data

2010-03-25 Thread Thad
You may have to do a deep copy of your arrays.  For example, I had to
do a deep copy to get a copy of a window location parameter map:

private HashMapString, ListString getParamMap() {
MapString, ListString paramMap =
Window.Location.getParameterMap();
// Must make a deep copy of the paramMap else it
// won't serialize through the RPC layer.
HashMapString, ListString map = new HashMapString,
ListString();
SetString keys = paramMap.keySet();
for ( String key : keys ) {
ListString values = paramMap.get(key);
ArrayListString alist = new ArrayListString();
for ( String value : values ) {
alist.add(value);
}
map.put(key, alist);
}
return map;
}

On Mar 24, 12:31 pm, Daniel Kvasnicka jr.
daniel.kvasnicka...@gmail.com wrote:
 Hi guys,

 I'm using GWT and I have problem with sending nested ArrayLists
 through a RPC service. The data produced by the service look like
 this:

 ArrayList of objects of type A.
   every A has a (Array)List of B property
     every B has a (Array)List of C property
       that property contains ArrayList of C -- those are leaf objects

 I've made sure that on the server side, the object structure is
 produced correctly. However when I place a breakpoint into the
 onSuccess method of a callback that handles the response from the
 service call, I get the top-level ArrayList of A and thats all. Their
 properties are set (e.g. String props) but the ArrayList of B is full
 of NULLs. The rest of the data gets lost somewhere. What could be the
 problem?

 I'm using the spring4gwt library. But I know that when return of the
 service method is called, it returns the right data.

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RPC and MapString, Object serialization problem

2010-03-16 Thread kriswpl
Thanks again guys for the response.

I was thinking what Paul's solution to take and I like 1st one with:
public abstract class PropertyT implements Serializable {
T value;
}

However, I don't see what way GWT serializer may know in this service
method:
HashMapString, Property? getFoo();

what type of Property can be received - is it not the same problem as
in HashMapString, Object getFooWithObject();

??

Krisw

On 12 Mar, 11:04, Paul Robinson ukcue...@gmail.com wrote:
 You can create a class that wraps everything you might want to transport
 and use that class in the interface instead.

 One way is like this:

     public abstract class PropertyT implements Serializable {
         T value;
     }

     public class LongProperty extends PropertyLong {
     }

     public class DoubleProperty extends PropertyDouble {
     }

     public interface Service {
         HashMapString, Property? getFoo();
     }

 another way:

     public enum PropertyType { INTEGER, LONG, DOUBLE, ... }

     public class Property implements Serializable {
         PropertyType type;

         Long longValue;
         Date dateValue;
         Integer intValue;
     }

     public interface Service {
         HashMapString, Property getFoo();
     }

 However you do it, do be aware that you may well increase the required
 size of data sent over the network using techniques like this - and the
 time taken to serialize/deserialize it.

 @gwt.typeArgs was needed before GWT 1.5 when GWT first supported
 generics. You don't need it now (I'm not sure if you still can use it)
 and it wouldn't help here anyway because generics let you specify the
 same information.

 Paul

 kriswpl wrote:
  Thank you Paul for your reply.

  FYI - I use Map not to use DTO - I put all properties (Long, Date) to
  this Map.

  So I have another question --- is it any way to define what kind of
  objects (Date, Long, Double, etc.) can show in Map. I found
  information @gwt.typeArgs something.
  I mean - is it possible to add to the remote interface information
  about all serializaed types which can be in Map? - to solve this
  problem

  Thanks,
  Krisw

  On 11 Mar, 17:55, Paul Robinson ukcue...@gmail.com wrote:

  kriswpl wrote:

  Interface method is:
  public MapString, Object test();

  and in implementation I put into returned map, object java.util.Long
  (which is serializable:) ):
  map.put(long, new Long(1));

  Where do I do it wrong?

  GWT does a great job of putting as little into the javascript as
  possible. In the above case, there's nothing to tell it that you're
  going to send a Long, so it doesn't generate theRPCcode into the
  javascript that knows how to deserialize a Long. Add another method that
  references Long, and then your first method might work because the Long
  code is now going to be included.

  On a related note, using Map in the API is not a good idea because it
  means GWT must look through all your code for every implementation of
  Map to see whether it's used. At the very least, it will make compiles
  take longer. At worst, it will generate longer code. It goes against the
  grain for java programming, but you need to make GWTRPCAPIs as
  specific as possible. That means declaring that you're returning a
  HashMap, not a Map, in the interface.

  This also means you can't declare Object as a type in anRPCinterface.

  Paul



-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RPC and MapString, Object serialization problem

2010-03-16 Thread Paul Robinson
It's not the same problem.

With an RPC  method of HashMapString, Property? getFoo(), where
Property is abstract, GWT will look for all subclasses of Property on
the classpath and build the RPC code for them. If you have one Property
subclass per data type, then since the Property subclasses explicitly
reference the underlying data type (like Long), the RPC code for those
data types will be included as well.

You might also like to check out this issue related to RPC of cyclic
object graphs when using HashMap/HashSet if you use this technique:
http://code.google.com/p/google-web-toolkit/issues/detail?id=3577

Paul

riswpl wrote:
 Thanks again guys for the response.

 I was thinking what Paul's solution to take and I like 1st one with:
 public abstract class PropertyT implements Serializable {
 T value;
 }

 However, I don't see what way GWT serializer may know in this service
 method:
 HashMapString, Property? getFoo();

 what type of Property can be received - is it not the same problem as
 in HashMapString, Object getFooWithObject();

 ??

 Krisw

 On 12 Mar, 11:04, Paul Robinson ukcue...@gmail.com wrote:
   
 You can create a class that wraps everything you might want to transport
 and use that class in the interface instead.

 One way is like this:

 public abstract class PropertyT implements Serializable {
 T value;
 }

 public class LongProperty extends PropertyLong {
 }

 public class DoubleProperty extends PropertyDouble {
 }

 public interface Service {
 HashMapString, Property? getFoo();
 }

 another way:

 public enum PropertyType { INTEGER, LONG, DOUBLE, ... }

 public class Property implements Serializable {
 PropertyType type;

 Long longValue;
 Date dateValue;
 Integer intValue;
 }

 public interface Service {
 HashMapString, Property getFoo();
 }

 However you do it, do be aware that you may well increase the required
 size of data sent over the network using techniques like this - and the
 time taken to serialize/deserialize it.

 @gwt.typeArgs was needed before GWT 1.5 when GWT first supported
 generics. You don't need it now (I'm not sure if you still can use it)
 and it wouldn't help here anyway because generics let you specify the
 same information.

 Paul

 kriswpl wrote:
 
 Thank you Paul for your reply.
   
 FYI - I use Map not to use DTO - I put all properties (Long, Date) to
 this Map.
   
 So I have another question --- is it any way to define what kind of
 objects (Date, Long, Double, etc.) can show in Map. I found
 information @gwt.typeArgs something.
 I mean - is it possible to add to the remote interface information
 about all serializaed types which can be in Map? - to solve this
 problem
   
 Thanks,
 Krisw
   
 On 11 Mar, 17:55, Paul Robinson ukcue...@gmail.com wrote:
   
 kriswpl wrote:
 
 Interface method is:
 public MapString, Object test();
   
 and in implementation I put into returned map, object java.util.Long
 (which is serializable:) ):
 map.put(long, new Long(1));
   
 Where do I do it wrong?
   
 GWT does a great job of putting as little into the javascript as
 possible. In the above case, there's nothing to tell it that you're
 going to send a Long, so it doesn't generate theRPCcode into the
 javascript that knows how to deserialize a Long. Add another method that
 references Long, and then your first method might work because the Long
 code is now going to be included.
 
 On a related note, using Map in the API is not a good idea because it
 means GWT must look through all your code for every implementation of
 Map to see whether it's used. At the very least, it will make compiles
 take longer. At worst, it will generate longer code. It goes against the
 grain for java programming, but you need to make GWTRPCAPIs as
 specific as possible. That means declaring that you're returning a
 HashMap, not a Map, in the interface.
 
 This also means you can't declare Object as a type in anRPCinterface.
 
 Paul
 
 

   

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RPC and MapString, Object serialization problem

2010-03-12 Thread kriswpl
Thank you Paul for your reply.

FYI - I use Map not to use DTO - I put all properties (Long, Date) to
this Map.

So I have another question --- is it any way to define what kind of
objects (Date, Long, Double, etc.) can show in Map. I found
information @gwt.typeArgs something.
I mean - is it possible to add to the remote interface information
about all serializaed types which can be in Map? - to solve this
problem

Thanks,
Krisw


On 11 Mar, 17:55, Paul Robinson ukcue...@gmail.com wrote:
 kriswpl wrote:
  Interface method is:
  public MapString, Object test();

  and in implementation I put into returned map, object java.util.Long
  (which is serializable:) ):
  map.put(long, new Long(1));

  Where do I do it wrong?

 GWT does a great job of putting as little into the javascript as
 possible. In the above case, there's nothing to tell it that you're
 going to send a Long, so it doesn't generate the RPC code into the
 javascript that knows how to deserialize a Long. Add another method that
 references Long, and then your first method might work because the Long
 code is now going to be included.

 On a related note, using Map in the API is not a good idea because it
 means GWT must look through all your code for every implementation of
 Map to see whether it's used. At the very least, it will make compiles
 take longer. At worst, it will generate longer code. It goes against the
 grain for java programming, but you need to make GWT RPC APIs as
 specific as possible. That means declaring that you're returning a
 HashMap, not a Map, in the interface.

 This also means you can't declare Object as a type in an RPC interface.

 Paul

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RPC and MapString, Object serialization problem

2010-03-12 Thread Martin Trummer
I strongly recommend to use DTO's because then you
have all the benefits of type-safety which is one of the
most compelling reasons to use GWT.

however, if you really don't care about that, you
could use a HashMapString, String and
simply call the toString() method on the serverside
for every value you want to put into the map.

On 12 Mrz., 09:38, kriswpl kris...@gmail.com wrote:
 Thank you Paul for your reply.

 FYI - I use Map not to use DTO - I put all properties (Long, Date) to
 this Map.

 So I have another question --- is it any way to define what kind of
 objects (Date, Long, Double, etc.) can show in Map. I found
 information @gwt.typeArgs something.
 I mean - is it possible to add to the remote interface information
 about all serializaed types which can be in Map? - to solve this
 problem

 Thanks,
 Krisw

 On 11 Mar, 17:55, Paul Robinson ukcue...@gmail.com wrote:

  kriswpl wrote:
   Interface method is:
   public MapString, Object test();

   and in implementation I put into returned map, object java.util.Long
   (which is serializable:) ):
   map.put(long, new Long(1));

   Where do I do it wrong?

  GWT does a great job of putting as little into the javascript as
  possible. In the above case, there's nothing to tell it that you're
  going to send a Long, so it doesn't generate the RPC code into the
  javascript that knows how to deserialize a Long. Add another method that
  references Long, and then your first method might work because the Long
  code is now going to be included.

  On a related note, using Map in the API is not a good idea because it
  means GWT must look through all your code for every implementation of
  Map to see whether it's used. At the very least, it will make compiles
  take longer. At worst, it will generate longer code. It goes against the
  grain for java programming, but you need to make GWT RPC APIs as
  specific as possible. That means declaring that you're returning a
  HashMap, not a Map, in the interface.

  This also means you can't declare Object as a type in an RPC interface.

  Paul

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RPC and MapString, Object serialization problem

2010-03-12 Thread Paul Robinson
You can create a class that wraps everything you might want to transport
and use that class in the interface instead.

One way is like this:

public abstract class PropertyT implements Serializable {
T value;
}

public class LongProperty extends PropertyLong {
}

public class DoubleProperty extends PropertyDouble {
}

public interface Service {
HashMapString, Property? getFoo();
}

another way:

public enum PropertyType { INTEGER, LONG, DOUBLE, ... }

public class Property implements Serializable {
PropertyType type;

Long longValue;
Date dateValue;
Integer intValue;
}

public interface Service {
HashMapString, Property getFoo();
}

However you do it, do be aware that you may well increase the required
size of data sent over the network using techniques like this - and the
time taken to serialize/deserialize it.

@gwt.typeArgs was needed before GWT 1.5 when GWT first supported
generics. You don't need it now (I'm not sure if you still can use it)
and it wouldn't help here anyway because generics let you specify the
same information.


Paul

kriswpl wrote:
 Thank you Paul for your reply.

 FYI - I use Map not to use DTO - I put all properties (Long, Date) to
 this Map.

 So I have another question --- is it any way to define what kind of
 objects (Date, Long, Double, etc.) can show in Map. I found
 information @gwt.typeArgs something.
 I mean - is it possible to add to the remote interface information
 about all serializaed types which can be in Map? - to solve this
 problem

 Thanks,
 Krisw


 On 11 Mar, 17:55, Paul Robinson ukcue...@gmail.com wrote:
   
 kriswpl wrote:
 
 Interface method is:
 public MapString, Object test();
   
 and in implementation I put into returned map, object java.util.Long
 (which is serializable:) ):
 map.put(long, new Long(1));
   
 Where do I do it wrong?
   
 GWT does a great job of putting as little into the javascript as
 possible. In the above case, there's nothing to tell it that you're
 going to send a Long, so it doesn't generate the RPC code into the
 javascript that knows how to deserialize a Long. Add another method that
 references Long, and then your first method might work because the Long
 code is now going to be included.

 On a related note, using Map in the API is not a good idea because it
 means GWT must look through all your code for every implementation of
 Map to see whether it's used. At the very least, it will make compiles
 take longer. At worst, it will generate longer code. It goes against the
 grain for java programming, but you need to make GWT RPC APIs as
 specific as possible. That means declaring that you're returning a
 HashMap, not a Map, in the interface.

 This also means you can't declare Object as a type in an RPC interface.

 Paul
 

   

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



RPC and MapString, Object serialization problem

2010-03-11 Thread kriswpl
Hi,

I tried to invoke a method in interface thru RPC.
Interface method is:
public MapString, Object test();

and in implementation I put into returned map, object java.util.Long
(which is serializable:) ):
map.put(long, new Long(1));

and I get an error - see below:
BUT, when I add another method to this interface:
public Long test2();

There is no problem with that - it seems that GWT knows how to handle
with Long.

Does anyone have any solution? Where do I do it wrong?

Thanks,
Krisw

 start of error
[INFO] Caused by:
com.google.gwt.user.client.rpc.SerializationException:
java.lang.reflect.InvocationTargetException
[INFO] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer(ServerSerializationStreamWriter.java:
760)
[INFO] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl(ServerSerializationStreamWriter.java:
723)
[INFO] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
612)
[INFO] at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
129)
[INFO] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
$ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
[INFO] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:
534)
[INFO] at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:
609)
[INFO] at
com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:
467)
[INFO] at
com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:
434)
[INFO] at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.invokeMethodOnService(GWTRPCServiceExporter.java:
170)
[INFO] at
org.gwtwidgets.server.spring.GWTRPCServiceExporter.processCall(GWTRPCServiceExporter.java:
320)
[INFO] ... 55 more
[INFO] Caused by: java.lang.reflect.InvocationTargetException
[INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
[INFO] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
[INFO] at java.lang.reflect.Method.invoke(Method.java:597)
[INFO] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer(ServerSerializationStreamWriter.java:
742)
[INFO] ... 65 more
[INFO] Caused by:
com.google.gwt.user.client.rpc.SerializationException: Type
'java.util.Long' 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 = 1
[INFO] at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
610)
[INFO] at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
129)
[INFO] at
com.google.gwt.user.client.rpc.core.java.util.Map_CustomFieldSerializerBase.serialize(Map_CustomFieldSerializerBase.java:
50)
[INFO] at
com.google.gwt.user.client.rpc.core.java.util.HashMap_CustomFieldSerializer.serialize(HashMap_CustomFieldSerializer.java:
36)

 End of error stack trace

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: RPC and MapString, Object serialization problem

2010-03-11 Thread Paul Robinson
kriswpl wrote:
 Interface method is:
 public MapString, Object test();

 and in implementation I put into returned map, object java.util.Long
 (which is serializable:) ):
 map.put(long, new Long(1));

 Where do I do it wrong?

   
GWT does a great job of putting as little into the javascript as
possible. In the above case, there's nothing to tell it that you're
going to send a Long, so it doesn't generate the RPC code into the
javascript that knows how to deserialize a Long. Add another method that
references Long, and then your first method might work because the Long
code is now going to be included.

On a related note, using Map in the API is not a good idea because it
means GWT must look through all your code for every implementation of
Map to see whether it's used. At the very least, it will make compiles
take longer. At worst, it will generate longer code. It goes against the
grain for java programming, but you need to make GWT RPC APIs as
specific as possible. That means declaring that you're returning a
HashMap, not a Map, in the interface.

This also means you can't declare Object as a type in an RPC interface.


Paul

-- 
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: rpc serialization problem

2009-10-26 Thread Benjamin

I'm passed these problems now - a couple of things i learned when
creating object and storing in data nucleus for later retrieval over
an RPC call

- Most importantly, if you are returning a complex object (like one
with a list of another type of object) you need to return a copy, not
the object data nucleus returns - return persitenceManager.detachCopy
(object)  - the object returned by PM has all sorts of stuff in it
that can't be serialized, the detached copy does not.

Next, if your are creating an object with lists of other object that
are not necessarily parent/child relationships or anything you want to
persist, you need to decorate it with @NotPersistent because app
engine will mark things as persistent for you even if you don't want
it or mark it as persistent. See this note in the doc:

Tip: JDO specifies that fields of certain types are persistent by
default if neither the @Persistent nor @NotPersistent annotations are
specified, and fields of all other types are not persistent by
default. See the DataNucleus documentation for a complete description
of this behavior. Because not all of the App Engine datastore core
value types are persistent by default according to the JDO
specification, we recommend explicitly annotating fields as
@Persistent or @NotPersistent to make it clear.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: rpc serialization problem

2009-10-08 Thread Dominik Steiner

Hi,

I'm using JDO with App Engine and GWT and sending the domain objects
with the JDO tags via RPC is working fine, so not sure if the problem
is JPA?

HTH

Dominik

On Oct 7, 3:48 am, Lubomir lubomir.zrne...@gmail.com wrote:
 Hi, I was experimenting with it a bit as well and it seems to me that
 even the most simple Entity bean cannot be passed through RPC call. I
 had a simple class:

 @Entity
 public class Tournament implements Serializable {

         @Id
         @GeneratedValue(strategy = GenerationType.IDENTITY)
         private Long id;

         private int tournamentId;

         @Temporal(value = TemporalType.DATE)
         private Date date;
 ...
 and I wasnt able either to pass it from the server to the client or
 the other way. Once I removed all the JPA annotation (no other
 change!), everything went fine. So I think despite the fact that the
 class above is de facto compliant with GWT requirements for via-RPC-
 sendable classes (see the docs - serializable, fields serializable,
 etc.), it's the JPA annotations and its processing by DataNucleus that
 create the problem.
 That there's some kind of problem can also be seen in the tutorial for
 GWT and appengine: instead of much more natural approach (from certain
 point of view) of creating the Stock entity in client code and sending
 it through RPC, addStock is called only with String argument and Stock
 Entity is constructed on server. Same with getStock: stock list is
 fetched from datastore and then parsed and getStock() passes array of
 Strings back to client, although it would be nice and convenient to
 have Stock entity on client and populate the table by calling getters.
 The solution is to use either DTO pattern or a 3rd party library
 called Gilead (that does basically the same boring work of cloning
 entity, passing it to the client and when it comes back, merging it
 with the original)
 LZ

 On Oct 6, 11:06 pm, Sudeep S sudee...@gmail.com wrote:

   Hey Benjamin,

   Since u are using Generics ensure that all the classes Service, ServiceAync
  and ServiceImpl
   use the same signature i.e ListSubCatagory  .
     btw which version of gwt are u using.

   Also, you can the temp dir where u can find a rpc.log file with the list of
  all objects that are serialized.

  On Wed, Oct 7, 2009 at 2:20 AM, Benjamin bsaut...@gmail.com wrote:

   I'm struggeling with this now - did you guys solve it?  I have a
   simple client class that will be a parent in a simple parent-child
   relationship.  If i add an ArrayList property to the parent class (i
   don't even have to decorate it as persistant) i get

   EVERE: [1254861190636000] javax.servlet.ServletContext log: Exception
   while dispatching incoming RPC call
   com.google.gwt.user.client.rpc.SerializationException: Type
   'org.datanucleus.sco.backed.List' 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.

   i've tried java.util.list and java.util.arraylist with same result -
   defiitly not a 'org.datanucleus.sco.backed.List'

   what's odd is that the RPC call runs in a way and the object is
   persisted but without the list field.

   Anyway - this seems like something that can't be passed in an RPC call
   but i don't see why

   @PersistenceCapable(identityType = IdentityType.APPLICATION)
   public class Catagory extends BaseTreeModel implements Serializable {

   public  Catagory() {}

          private static final long serialVersionUID = 1L;
         �...@primarykey
     �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
     �...@extension(vendorName=datanucleus, key=gae.encoded-pk,
   value=true)
          private String key;

           @Persistent(mappedBy = catagory)
     private  ListSubCatagory subcatagories;

   }

   On Sep 22, 5:43 am, Angel gonzalezm.an...@gmail.com wrote:
i have the same problem

On 5 ago, 04:52, mike m...@introspect.com wrote:

 I have a simple one-to-many betwen two entities.  The parent entity
 uses List to contain the child entities.  I am able to persist these
 entities in the datastore without problems.

 However, when reading a root entity at the server, I get:

 rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' was
 not included in the set of types  which can be serialized...

 The entities are successfully read from the datastore, but something
 in Datanucleus doesn't build the List correctly.

 Has anyone found a workaround for this serialization problem.

 Thanks

 GWT 1.7 GAE 1.2.2- Hide quoted text -

- Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web

Re: rpc serialization problem

2009-10-08 Thread brancoch
;

}

On Sep 22, 5:43 am, Angel gonzalezm.an...@gmail.com wrote:
 i have the same problem

 On 5 ago, 04:52, mike m...@introspect.com wrote:

  I have a simple one-to-many betwen two entities.  The parent entity
  uses List to contain the child entities.  I am able to persist these
  entities in the datastore without problems.

  However, when reading a root entity at the server, I get:

  rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' 
  was
  not included in the set of types  which can be serialized...

  The entities are successfully read from the datastore, but something
  in Datanucleus doesn't build the List correctly.

  Has anyone found a workaround for this serialization problem.

  Thanks

  GWT 1.7 GAE 1.2.2- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: rpc serialization problem

2009-10-07 Thread Lubomir

Hi, I was experimenting with it a bit as well and it seems to me that
even the most simple Entity bean cannot be passed through RPC call. I
had a simple class:

@Entity
public class Tournament implements Serializable {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private int tournamentId;

@Temporal(value = TemporalType.DATE)
private Date date;
...
and I wasnt able either to pass it from the server to the client or
the other way. Once I removed all the JPA annotation (no other
change!), everything went fine. So I think despite the fact that the
class above is de facto compliant with GWT requirements for via-RPC-
sendable classes (see the docs - serializable, fields serializable,
etc.), it's the JPA annotations and its processing by DataNucleus that
create the problem.
That there's some kind of problem can also be seen in the tutorial for
GWT and appengine: instead of much more natural approach (from certain
point of view) of creating the Stock entity in client code and sending
it through RPC, addStock is called only with String argument and Stock
Entity is constructed on server. Same with getStock: stock list is
fetched from datastore and then parsed and getStock() passes array of
Strings back to client, although it would be nice and convenient to
have Stock entity on client and populate the table by calling getters.
The solution is to use either DTO pattern or a 3rd party library
called Gilead (that does basically the same boring work of cloning
entity, passing it to the client and when it comes back, merging it
with the original)
LZ


On Oct 6, 11:06 pm, Sudeep S sudee...@gmail.com wrote:
  Hey Benjamin,

  Since u are using Generics ensure that all the classes Service, ServiceAync
 and ServiceImpl
  use the same signature i.e ListSubCatagory  .
    btw which version of gwt are u using.

  Also, you can the temp dir where u can find a rpc.log file with the list of
 all objects that are serialized.



 On Wed, Oct 7, 2009 at 2:20 AM, Benjamin bsaut...@gmail.com wrote:

  I'm struggeling with this now - did you guys solve it?  I have a
  simple client class that will be a parent in a simple parent-child
  relationship.  If i add an ArrayList property to the parent class (i
  don't even have to decorate it as persistant) i get

  EVERE: [1254861190636000] javax.servlet.ServletContext log: Exception
  while dispatching incoming RPC call
  com.google.gwt.user.client.rpc.SerializationException: Type
  'org.datanucleus.sco.backed.List' 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.

  i've tried java.util.list and java.util.arraylist with same result -
  defiitly not a 'org.datanucleus.sco.backed.List'

  what's odd is that the RPC call runs in a way and the object is
  persisted but without the list field.

  Anyway - this seems like something that can't be passed in an RPC call
  but i don't see why

  @PersistenceCapable(identityType = IdentityType.APPLICATION)
  public class Catagory extends BaseTreeModel implements Serializable {

  public  Catagory() {}

         private static final long serialVersionUID = 1L;
        �...@primarykey
    �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    �...@extension(vendorName=datanucleus, key=gae.encoded-pk,
  value=true)
         private String key;

          @Persistent(mappedBy = catagory)
    private  ListSubCatagory subcatagories;

  }

  On Sep 22, 5:43 am, Angel gonzalezm.an...@gmail.com wrote:
   i have the same problem

   On 5 ago, 04:52, mike m...@introspect.com wrote:

I have a simple one-to-many betwen two entities.  The parent entity
uses List to contain the child entities.  I am able to persist these
entities in the datastore without problems.

However, when reading a root entity at the server, I get:

rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' was
not included in the set of types  which can be serialized...

The entities are successfully read from the datastore, but something
in Datanucleus doesn't build the List correctly.

Has anyone found a workaround for this serialization problem.

Thanks

GWT 1.7 GAE 1.2.2- Hide quoted text -

   - Show quoted text -

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: rpc serialization problem

2009-10-06 Thread Benjamin

I'm struggeling with this now - did you guys solve it?  I have a
simple client class that will be a parent in a simple parent-child
relationship.  If i add an ArrayList property to the parent class (i
don't even have to decorate it as persistant) i get

EVERE: [1254861190636000] javax.servlet.ServletContext log: Exception
while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type
'org.datanucleus.sco.backed.List' 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.

i've tried java.util.list and java.util.arraylist with same result -
defiitly not a 'org.datanucleus.sco.backed.List'

what's odd is that the RPC call runs in a way and the object is
persisted but without the list field.

Anyway - this seems like something that can't be passed in an RPC call
but i don't see why

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Catagory extends BaseTreeModel implements Serializable {

public  Catagory() {}

private static final long serialVersionUID = 1L;
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName=datanucleus, key=gae.encoded-pk,
value=true)
private String key;

 @Persistent(mappedBy = catagory)
   private  ListSubCatagory subcatagories;


}



On Sep 22, 5:43 am, Angel gonzalezm.an...@gmail.com wrote:
 i have the same problem

 On 5 ago, 04:52, mike m...@introspect.com wrote:



  I have a simple one-to-many betwen two entities.  The parent entity
  uses List to contain the child entities.  I am able to persist these
  entities in the datastore without problems.

  However, when reading a root entity at the server, I get:

  rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' was
  not included in the set of types  which can be serialized...

  The entities are successfully read from the datastore, but something
  in Datanucleus doesn't build the List correctly.

  Has anyone found a workaround for this serialization problem.

  Thanks

  GWT 1.7 GAE 1.2.2- Hide quoted text -

 - Show quoted text -
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: rpc serialization problem

2009-10-06 Thread Sudeep S
 Hey Benjamin,

 Since u are using Generics ensure that all the classes Service, ServiceAync
and ServiceImpl
 use the same signature i.e ListSubCatagory  .
   btw which version of gwt are u using.

 Also, you can the temp dir where u can find a rpc.log file with the list of
all objects that are serialized.



On Wed, Oct 7, 2009 at 2:20 AM, Benjamin bsaut...@gmail.com wrote:


 I'm struggeling with this now - did you guys solve it?  I have a
 simple client class that will be a parent in a simple parent-child
 relationship.  If i add an ArrayList property to the parent class (i
 don't even have to decorate it as persistant) i get

 EVERE: [1254861190636000] javax.servlet.ServletContext log: Exception
 while dispatching incoming RPC call
 com.google.gwt.user.client.rpc.SerializationException: Type
 'org.datanucleus.sco.backed.List' 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.

 i've tried java.util.list and java.util.arraylist with same result -
 defiitly not a 'org.datanucleus.sco.backed.List'

 what's odd is that the RPC call runs in a way and the object is
 persisted but without the list field.

 Anyway - this seems like something that can't be passed in an RPC call
 but i don't see why

 @PersistenceCapable(identityType = IdentityType.APPLICATION)
 public class Catagory extends BaseTreeModel implements Serializable {

 public  Catagory() {}

private static final long serialVersionUID = 1L;
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName=datanucleus, key=gae.encoded-pk,
 value=true)
private String key;

 @Persistent(mappedBy = catagory)
   private  ListSubCatagory subcatagories;


 }



 On Sep 22, 5:43 am, Angel gonzalezm.an...@gmail.com wrote:
  i have the same problem
 
  On 5 ago, 04:52, mike m...@introspect.com wrote:
 
 
 
   I have a simple one-to-many betwen two entities.  The parent entity
   uses List to contain the child entities.  I am able to persist these
   entities in the datastore without problems.
 
   However, when reading a root entity at the server, I get:
 
   rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' was
   not included in the set of types  which can be serialized...
 
   The entities are successfully read from the datastore, but something
   in Datanucleus doesn't build the List correctly.
 
   Has anyone found a workaround for this serialization problem.
 
   Thanks
 
   GWT 1.7 GAE 1.2.2- Hide quoted text -
 
  - Show quoted text -
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Serialization problem using CustomFieldSerializer(s) and specifying specific .java files in gwt module xml

2009-10-04 Thread brancoch

I had something similar using GWT2.0 and GAE plugin in Eclipse. I was
using a custom serializable object (UserContext) which was holding a
reference to SetString. I was working ok for awhile then suddently
stopped working. After reviewing all items that was introduced since
the last time it was working, I finally made it work using a custom
launch for my Hosted application.

Here my analysis of the problem:

Last time it was working, I was using GAE lauching facility with the
embedded server. GAE uses the new Hosted mode startup program in this
case. I soon as you setup GAE launching with noserver to true, it
starts the application in the old mode. I was providing all the
necessary rpc files for server side by first compiling the code making
sure to generate the files under my WebContent folder of eclipse
before deployment under my local Oracle 10g instance. Starting the
hosted mode application using GAE was giving me the problem all the
time. I then forces GAE hosted mode to store generated stuff under
WebContent but the folder used in this case was not right. Looking
both rpc checksum entries from the compile version versus Hosted mode
generated version, I realized that the checksum for the Set was
different!

I then setup a Java launch with all the dependencies (cut and paste +
some tailoring of the GAE launch xml file found in the workspace) to
use the new Hosted mode + the parameter to store generated stuff under
WebContent and it is now working again. No need to GWT compile anymore
since the hosted mode will generate the file under the correct folder.

No sure of the exact root cause but it looks to me that the old hosted
mode does not compile the rpc file the same way!

On Oct 3, 11:14 pm, Andrius Juozapaitis andri...@gmail.com wrote:
 Hey,

 I've been trying to emulate parts of 3rd party library and stumbled
 upon a problem. The library has certain classes with java.lang.Object
 references that I wanted to get rid of, and I want the classes to
 implement java.io.Serializable. The package structure is like that:

 -java/dao/
     -EntityWithObjectReference.java
     -EntityWithObjectReference_CustomFieldSerializer.java
     -ExtendedEntity.java

 -resources/
     serialization.gwt.xml
     -substituted.dao/
         EntityWithObjectReference.java

 Everything is built using maven, so files end up where they should
 be.

 Original base entity class I want to emulate:
 package dao;
 public class EntityWithObjectReference {
     public Object objReference;
     private String text;
     public String getText() {
         return text;
     }
     public void setText(String text) {
         this.text = text;
     }

 }

 Emulated base entity class (implements serializable, Object ref
 removed):

 package dao;
 import java.io.Serializable;
 public class EntityWithObjectReference implements Serializable {
     private String text;
     public String getText() {
         return text;
     }
     public void setText(String text) {
         this.text = text;
     }

 }

 The class I actually use in both client and server side:

 package dao;
 import java.io.Serializable;
 public class ExtendedEntity extends EntityWithObjectReference
 implements Serializable {
     private String name;

     public String getName() {
         return name;
     }

     public void setName(String name) {
         this.name = name;
     }

 }

 There's also a EntityWithObjectReference_CustomFieldSerializer.java,
 which simply ignores the Object reference for now:

 package dao;
 import com.google.gwt.user.client.rpc.*;
 public class EntityWithObjectReference_CustomFieldSerializer {
     public static void serialize(SerializationStreamWriter writer,
 EntityWithObjectReference entity) throws SerializationException {
         writer.writeString(entity.getText());
     }
     public static void deserialize(SerializationStreamReader reader,
 EntityWithObjectReference entity) throws SerializationException {
         entity.setText( reader.readString());
     }

 }

 Now, if I just leave the source element empty (it should include all
 the java files in the package), everything works fine, serialization
 works as expected, and custom serializer is being called.

 serialization.gwt.xml:
 module
     inherits name=com.google.gwt.core.Core/
     source path=dao
         !--include name=ExtendedEntity.java/--
         !--include name=EntityWithObjectReference.java/--
     /source
     super-source path=substituted/
 /module

 ***When I try to uncomment the two lines*** that explicitly include
 the specific java files (I need that because the original library I
 want to emulate has a number of additional files in the source
 packages that gwt doesn't ever need to know about), there's a problem
 - GWT keeps complaining that 'This application is out of date, please
 click the refresh button on your browser'. The server response is the
 same in both cases:

 //OK[3,2,1,[dao.ExtendedEntity/1266011518,xxx,evil entity],0,5]

 But GWT generated 

Serialization problem using CustomFieldSerializer(s) and specifying specific .java files in gwt module xml

2009-10-03 Thread Andrius Juozapaitis

Hey,

I've been trying to emulate parts of 3rd party library and stumbled
upon a problem. The library has certain classes with java.lang.Object
references that I wanted to get rid of, and I want the classes to
implement java.io.Serializable. The package structure is like that:

-java/dao/
-EntityWithObjectReference.java
-EntityWithObjectReference_CustomFieldSerializer.java
-ExtendedEntity.java

-resources/
serialization.gwt.xml
-substituted.dao/
EntityWithObjectReference.java

Everything is built using maven, so files end up where they should
be.

Original base entity class I want to emulate:
package dao;
public class EntityWithObjectReference {
public Object objReference;
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}

Emulated base entity class (implements serializable, Object ref
removed):

package dao;
import java.io.Serializable;
public class EntityWithObjectReference implements Serializable {
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}

The class I actually use in both client and server side:

package dao;
import java.io.Serializable;
public class ExtendedEntity extends EntityWithObjectReference
implements Serializable {
private String name;

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}
}

There's also a EntityWithObjectReference_CustomFieldSerializer.java,
which simply ignores the Object reference for now:

package dao;
import com.google.gwt.user.client.rpc.*;
public class EntityWithObjectReference_CustomFieldSerializer {
public static void serialize(SerializationStreamWriter writer,
EntityWithObjectReference entity) throws SerializationException {
writer.writeString(entity.getText());
}
public static void deserialize(SerializationStreamReader reader,
EntityWithObjectReference entity) throws SerializationException {
entity.setText( reader.readString());
}
}

Now, if I just leave the source element empty (it should include all
the java files in the package), everything works fine, serialization
works as expected, and custom serializer is being called.

serialization.gwt.xml:
module
inherits name=com.google.gwt.core.Core/
source path=dao
!--include name=ExtendedEntity.java/--
!--include name=EntityWithObjectReference.java/--
/source
super-source path=substituted/
/module

***When I try to uncomment the two lines*** that explicitly include
the specific java files (I need that because the original library I
want to emulate has a number of additional files in the source
packages that gwt doesn't ever need to know about), there's a problem
- GWT keeps complaining that 'This application is out of date, please
click the refresh button on your browser'. The server response is the
same in both cases:

//OK[3,2,1,[dao.ExtendedEntity/1266011518,xxx,evil entity],0,5]

But GWT generated javascript expects a different checksum in this
case, and an exception is raised when deserializing the data. Any
ideas why this is happening? Bug, feature, a bit of both? I'd be more
than happy to supply the code to verify this behavior, if anyone can
help me sort this out.

regards,
Andrius J.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: rpc serialization problem

2009-09-22 Thread Angel

i have the same problem

On 5 ago, 04:52, mike m...@introspect.com wrote:
 I have a simple one-to-many betwen two entities.  The parent entity
 uses List to contain the child entities.  I am able to persist these
 entities in the datastore without problems.

 However, when reading a root entity at the server, I get:

 rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' was
 not included in the set of types  which can be serialized...

 The entities are successfully read from the datastore, but something
 in Datanucleus doesn't build the List correctly.

 Has anyone found a workaround for this serialization problem.

 Thanks

 GWT 1.7 GAE 1.2.2
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: rpc serialization problem

2009-09-03 Thread Chris Lowe

Are the List fields on your objects specified in terms of interfaces?
GWT RPC needs to know as much about your objects at compile time,
could you try using a concrete class instead - preferably ArrayList?

It sounds like you're trying to serialize ORM objects directly, is
that right?  I don't know much about Data Nucleus and whether or not
it dynamically enhances entity objects under its control with proxies
etc.  My experience is with Hibernate which usually does add something
to a class, so serializing entities directly is strongly discouraged -
either the entity objects have to be filtered of the Hibernate
extras, or values copied into DTOs.

On Sep 2, 10:35 am, jvoro...@googlemail.com
jvoro...@googlemail.com wrote:
 Hallo,
 i have the same problem.
 List (GWT) can not be used in DataNuceleus.

 Can every one help pleas!
 THX

 On 5 Aug., 04:52, mike m...@introspect.com wrote:



  I have a simple one-to-many betwen two entities.  The parent entity
  uses List to contain the child entities.  I am able to persist these
  entities in the datastore without problems.

  However, when reading a root entity at the server, I get:

  rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' was
  not included in the set of types  which can be serialized...

  The entities are successfully read from the datastore, but something
  in Datanucleus doesn't build the List correctly.

  Has anyone found a workaround for this serialization problem.

  Thanks

  GWT 1.7 GAE 1.2.2
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



Re: rpc serialization problem

2009-09-02 Thread jvoro...@googlemail.com

Hallo,
i have the same problem.
List (GWT) can not be used in DataNuceleus.

Can every one help pleas!
THX

On 5 Aug., 04:52, mike m...@introspect.com wrote:
 I have a simple one-to-many betwen two entities.  The parent entity
 uses List to contain the child entities.  I am able to persist these
 entities in the datastore without problems.

 However, when reading a root entity at the server, I get:

 rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' was
 not included in the set of types  which can be serialized...

 The entities are successfully read from the datastore, but something
 in Datanucleus doesn't build the List correctly.

 Has anyone found a workaround for this serialization problem.

 Thanks

 GWT 1.7 GAE 1.2.2

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to google-web-toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en
-~--~~~~--~~--~--~---



rpc serialization problem

2009-08-04 Thread mike

I have a simple one-to-many betwen two entities.  The parent entity
uses List to contain the child entities.  I am able to persist these
entities in the datastore without problems.

However, when reading a root entity at the server, I get:

rpc.SerializationException: Type 'org.datanucleus.sco.backed.List' was
not included in the set of types  which can be serialized...

The entities are successfully read from the datastore, but something
in Datanucleus doesn't build the List correctly.

Has anyone found a workaround for this serialization problem.

Thanks

GWT 1.7 GAE 1.2.2

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



RPC/Serialization problem with StockWatcher tutorial

2009-06-03 Thread james.o...@gmail.com

I'm going through the StockWatcher tutorial and I get to the RPC part
(http://code.google.com/webtoolkit/tutorials/1.6/RPC.html).

At the first test point I get this error message as expected ...

 [ERROR] Type 'com.google.gwt.sample.stockwatcher.client.StockPrice'
was not serializable
 and has no concrete serializable subtypes

However, after putting in the code to fix it ... I still get the
same error.  What am I missing?

Here is my StockPrice class ...

package com.google.gwt.sample.stockwatcher.client;

import java.io.Serializable;

public class StockPrice implements Serializable {
private String symbol;
private double price;
private double change;

public StockPrice(String symbol, double price, double change) {
this.symbol = symbol;
this.price = price;
this.change = change;
}

public String getSymbol() { return this.symbol; }
public double getPrice() { return this.price; }
public double getChange() { return this.change; }

public double getChangePercent() {
return 100.0 * this.change / this.price;
}

public void setSymbol(String symbol) { this.symbol = symbol; }
public void setPrice(double price) { this.price = price; }
public void setChange(double change) { this.change = change; }
}

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: RPC/Serialization problem with StockWatcher tutorial

2009-06-03 Thread Isaac Truett

Your StockPrice doesn't have a no-arg constructor.


On Wed, Jun 3, 2009 at 1:27 PM, james.o...@gmail.com
james.o...@gmail.com wrote:

 I'm going through the StockWatcher tutorial and I get to the RPC part
 (http://code.google.com/webtoolkit/tutorials/1.6/RPC.html).

 At the first test point I get this error message as expected ...

  [ERROR] Type 'com.google.gwt.sample.stockwatcher.client.StockPrice'
 was not serializable
  and has no concrete serializable subtypes

 However, after putting in the code to fix it ... I still get the
 same error.  What am I missing?

 Here is my StockPrice class ...

 package com.google.gwt.sample.stockwatcher.client;

 import java.io.Serializable;

 public class StockPrice implements Serializable {
        private String symbol;
        private double price;
        private double change;

        public StockPrice(String symbol, double price, double change) {
                this.symbol = symbol;
                this.price = price;
                this.change = change;
        }

        public String getSymbol() { return this.symbol; }
        public double getPrice() { return this.price; }
        public double getChange() { return this.change; }

        public double getChangePercent() {
                return 100.0 * this.change / this.price;
        }

        public void setSymbol(String symbol) { this.symbol = symbol; }
        public void setPrice(double price) { this.price = price; }
        public void setChange(double change) { this.change = change; }
 }

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: RPC/Serialization problem with StockWatcher tutorial

2009-06-03 Thread James Orr
Thanks!  I guess I missed that line earlier in the tutorial.

On Wed, Jun 3, 2009 at 2:08 PM, Isaac Truett itru...@gmail.com wrote:


 Your StockPrice doesn't have a no-arg constructor.


 On Wed, Jun 3, 2009 at 1:27 PM, james.o...@gmail.com
 james.o...@gmail.com wrote:
 
  I'm going through the StockWatcher tutorial and I get to the RPC part
  (http://code.google.com/webtoolkit/tutorials/1.6/RPC.html).
 
  At the first test point I get this error message as expected ...
 
   [ERROR] Type 'com.google.gwt.sample.stockwatcher.client.StockPrice'
  was not serializable
   and has no concrete serializable subtypes
 
  However, after putting in the code to fix it ... I still get the
  same error.  What am I missing?
 
  Here is my StockPrice class ...
 
  package com.google.gwt.sample.stockwatcher.client;
 
  import java.io.Serializable;
 
  public class StockPrice implements Serializable {
 private String symbol;
 private double price;
 private double change;
 
 public StockPrice(String symbol, double price, double change) {
 this.symbol = symbol;
 this.price = price;
 this.change = change;
 }
 
 public String getSymbol() { return this.symbol; }
 public double getPrice() { return this.price; }
 public double getChange() { return this.change; }
 
 public double getChangePercent() {
 return 100.0 * this.change / this.price;
 }
 
 public void setSymbol(String symbol) { this.symbol = symbol; }
 public void setPrice(double price) { this.price = price; }
 public void setChange(double change) { this.change = change; }
  }
 
  
 

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Serialization problem

2009-05-21 Thread Yulia

Hello

I have class StringValue which extends abstract class AttributeValue.
I call some method on server side, which should return instance of
this class. When the method tries to return value the folowing error
happens:

SEVERE: 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:686)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl
(ServerSerializationStreamWriter.java:649)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize
(ServerSerializationStreamWriter.java:583)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject
(AbstractSerializationStreamWriter.java:129)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
$ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue
(ServerSerializationStreamWriter.java:520)
at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:
573)
at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess
(RPC.java:441)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
(RPC.java:529)
at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
(RemoteServiceServlet.java:164)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
(RemoteServiceServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:
803)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter
(MonitorFilter.java:390)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter
(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke
(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke
(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke
(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke
(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke
(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service
(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process
(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run
(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer
(ServerSerializationStreamWriter.java:668)
... 27 more
Caused by: com.google.gwt.user.client.rpc.SerializationException: Type
'com.biosearch.client.database.attributeValues.StringValue' 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.
at
com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy.validateSerialize
(StandardSerializationPolicy.java:83)
at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize
(ServerSerializationStreamWriter.java:581)
at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject
(AbstractSerializationStreamWriter.java:129)
at
com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.serialize
(Collection_CustomFieldSerializerBase.java:43)
at
com.google.gwt.user.client.rpc.core.java.util.Vector_CustomFieldSerializer.serialize
(Vector_CustomFieldSerializer.java:36)
... 31 more

Both classes implement Serializable and have default constructor. Here
is the code:

public abstract class AttributeValue implements Serializable {
private String datasource;
public AttributeValue() {
}
public abstract Object getValue();
public String getDatasource() {
 

Re: Serialization problem

2009-05-21 Thread Jim

You can not use Object in VectorObject for GWT client code. You may
try to use VectorSerializable


Jim
http://www.gwtorm.com - GWT ORM
http://code.google.com/p/dreamsource-orm/


On May 21, 6:05 am, Yulia yuli...@gmail.com wrote:
 Hello

 I have class StringValue which extends abstract class AttributeValue.
 I call some method on server side, which should return instance of
 this class. When the method tries to return value the folowing error
 happens:

 SEVERE: 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.seriali­zeWithCustomSerializer
 (ServerSerializationStreamWriter.java:686)
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali­zeImpl
 (ServerSerializationStreamWriter.java:649)
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali­ze
 (ServerSerializationStreamWriter.java:583)
         at
 com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.write­Object
 (AbstractSerializationStreamWriter.java:129)
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
 $ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali­zeValue
 (ServerSerializationStreamWriter.java:520)
         at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:
 573)
         at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess
 (RPC.java:441)
         at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
 (RPC.java:529)
         at
 com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
 (RemoteServiceServlet.java:164)
         at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost
 (RemoteServiceServlet.java:86)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:
 710)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:
 803)
         at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
 (ApplicationFilterChain.java:290)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter
 (ApplicationFilterChain.java:206)
         at
 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter
 (MonitorFilter.java:390)
         at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
 (ApplicationFilterChain.java:235)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter
 (ApplicationFilterChain.java:206)
         at org.apache.catalina.core.StandardWrapperValve.invoke
 (StandardWrapperValve.java:233)
         at org.apache.catalina.core.StandardContextValve.invoke
 (StandardContextValve.java:175)
         at org.apache.catalina.core.StandardHostValve.invoke
 (StandardHostValve.java:128)
         at org.apache.catalina.valves.ErrorReportValve.invoke
 (ErrorReportValve.java:102)
         at org.apache.catalina.core.StandardEngineValve.invoke
 (StandardEngineValve.java:109)
         at org.apache.catalina.connector.CoyoteAdapter.service
 (CoyoteAdapter.java:286)
         at org.apache.coyote.http11.Http11Processor.process
 (Http11Processor.java:844)
         at org.apache.coyote.http11.Http11Protocol
 $Http11ConnectionHandler.process(Http11Protocol.java:583)
         at org.apache.tomcat.util.net.JIoEndpoint$Worker.run
 (JIoEndpoint.java:447)
         at java.lang.Thread.run(Thread.java:619)
 Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.GeneratedMethodAccessor28.invoke(Unknown
 Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke
 (DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali­zeWithCustomSerializer
 (ServerSerializationStreamWriter.java:668)
         ... 27 more
 Caused by: com.google.gwt.user.client.rpc.SerializationException: Type
 'com.biosearch.client.database.attributeValues.StringValue' 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.
         at
 com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy.validateSer­ialize
 (StandardSerializationPolicy.java:83)
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali­ze
 (ServerSerializationStreamWriter.java:581)
         at
 com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.write­Object
 (AbstractSerializationStreamWriter.java:129)
         at
 com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSeriali­zerBase.serialize
 (Collection_CustomFieldSerializerBase.java:43)
         at
 com.google.gwt.user.client.rpc.core.java.util.Vector_CustomFieldSerializer.­serialize
 

Re: Serialization problem

2009-05-21 Thread Yulia

I didn't try VectorSerializable, don't know if it works. I decide to
make a class with fields for data I want to return instead of using
VectorObject.
Now it works. Thank you!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Serialization problem

2009-01-12 Thread huma

Thank you for your answer!

I will see that information.

But what is your opinion about the error message This application is
out of date, please click the refresh button on your browser. .

I would like to know why I'm receveing that message.

Thank you!


On 12 Jan, 15:14, ganesh machkure gmachk...@gmail.com wrote:
 Hi,

 I would suggest you to go through Pro web 2.0 GWT Book. There author has
 given possible solution for PersistentSet, PersistenMap  and others
 serialization issue with GWT using HibernateFilter and writing a different
 ServerStreamSerializer class for that.

 -Ganesh



 On Mon, Jan 12, 2009 at 3:33 AM, huma hugo.m.marcel...@gmail.com wrote:

  Hi people.

  I've been developing an application with hibernate + spring + gwt, and
  i've come to a point where i need some help from you!

  I know that hibernate generates PersistentBag for Lists ( Hibernate
  implementation of List), and I need to serialize this lists. But I
  know that GWT doesn't support PersistentBag.

  So, and because i've read that we can implement a custom field
  serializer, i developed a PersistentBag_CustomFieldSerializer, like
  this:

  package org.hibernate.collection;

  import com.google.gwt.user.client.rpc.SerializationException;
  import com.google.gwt.user.client.rpc.SerializationStreamReader;
  import com.google.gwt.user.client.rpc.SerializationStreamWriter;

  /**
   * Custom field serializer for {...@link
  org.hibernate.collection.PersistentBag}.
   */
  public final class PersistentBag_CustomFieldSerializer {

     public static void deserialize(SerializationStreamReader
  streamReader, PersistentBag instance) throws SerializationException {
         int size = streamReader.readInt();
         for (int i = 0; i  size; ++i) {
             Object obj = streamReader.readObject();
             instance.add(obj);
         }
     }

     public static void serialize(SerializationStreamWriter
  streamWriter, PersistentBag instance) throws SerializationException {
         int size = instance.size();
         streamWriter.writeInt(size);
         for (Object o : instance) {
             streamWriter.writeObject(o);
         }
     }

  }

  With this development, the server serializes the instance, with no
  error, but the client return's a message saying
  This application is out of date, please click the refresh button on
  your browser.

  Could anyone provide with possible hints to solve this error.

  Best regards

  Hugo Marcelino

 --
 Thanks N Regards
 Ganesh Machkure
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Serialization problem

2009-01-11 Thread huma

Hi people.

I've been developing an application with hibernate + spring + gwt, and
i've come to a point where i need some help from you!

I know that hibernate generates PersistentBag for Lists ( Hibernate
implementation of List), and I need to serialize this lists. But I
know that GWT doesn't support PersistentBag.

So, and because i've read that we can implement a custom field
serializer, i developed a PersistentBag_CustomFieldSerializer, like
this:

package org.hibernate.collection;

import com.google.gwt.user.client.rpc.SerializationException;
import com.google.gwt.user.client.rpc.SerializationStreamReader;
import com.google.gwt.user.client.rpc.SerializationStreamWriter;

/**
 * Custom field serializer for {...@link
org.hibernate.collection.PersistentBag}.
 */
public final class PersistentBag_CustomFieldSerializer {

public static void deserialize(SerializationStreamReader
streamReader, PersistentBag instance) throws SerializationException {
int size = streamReader.readInt();
for (int i = 0; i  size; ++i) {
Object obj = streamReader.readObject();
instance.add(obj);
}
}

public static void serialize(SerializationStreamWriter
streamWriter, PersistentBag instance) throws SerializationException {
int size = instance.size();
streamWriter.writeInt(size);
for (Object o : instance) {
streamWriter.writeObject(o);
}
}

}

With this development, the server serializes the instance, with no
error, but the client return's a message saying
This application is out of date, please click the refresh button on
your browser.

Could anyone provide with possible hints to solve this error.

Best regards

Hugo Marcelino

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Bean Serialization Problem: com.google.gwt.user.client.rpc.SerializationException: Type 'com.dg.common.client.beans.DGUser' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable'

2008-11-06 Thread JM

I fixed it by implementing GWT's IsSerializable interface instead of
Java's Serializable...
Can't figure out why it works on Winows env.

JM


On Nov 5, 4:01 pm, JM [EMAIL PROTECTED] wrote:
 ping2ravi I'm glad you came back to tell it's now working for you!
 But think of all those people with the same problem you had... like
 me.
 Any idea?
 My classes are implementing Serializable. It's working fine on my
 development environment (Windows).
 But now that I try an integration (Linux), I get the same exception.

 Thanks,
 JM

 On 23 oct, 11:10, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

  Hi

  May we know what was causing the difference in file-names?  I am
  having a similar exception

  G.

  On Sep 22, 1:06 pm, ping2ravi [EMAIL PROTECTED] wrote:

   i found the problem why file names were different.
   Thanks

   On Sep 22, 11:18 am, ping2ravi [EMAIL PROTECTED] wrote:

Hi All,
My application was working good till now and now i deployed it to
other machine and it start giving me following exception. My DGUser
class is implementing serializable interface.

SEVERE: Exception while dispatching incoming RPC call
com.google.gwt.user.client.rpc.SerializationException: Type
'com.dg.common.client.beans.DGUser' was not assignable to
'com.google.gwt.user.client.rpc.IsSerializable' and did not have a
custom field serializer.  For security purposes, this type will not be
serialized.
        at
com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy.validateSerialize(LegacySerializationPolicy.java:
140)
        at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
585)
        at
com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
129)
        at 
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
$ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
        at
com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:
520)
        at 
com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573)
        at
com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:
441)
        at
com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
529)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
163)
        at
com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
85)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
290)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
206)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
233)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
175)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
128)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
102)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
109)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
263)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
844)
        at org.apache.coyote.http11.Http11Protocol
$Http11ConnectionHandler.process(Http11Protocol.java:584)
        at 
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
447)
        at java.lang.Thread.run(Thread.java:619)

And also its giving following error in the log file, So i am guessing
its because of this .gwt.rpc missing file,
INFO: ERROR: The serialization policy file '/
D96C005D9FEF0E3183DC3057D9F48727.gwt.rpc' was not found; did you
forget to include it in this deployment?
INFO: WARNING: Failed to get the SerializationPolicy
'D96C005D9FEF0E3183DC3057D9F48727' for module 'http://localhost:8090/
AdminMenu/'; a legacy, 1.3.3 compatible, serialization policy will be
used.  You may experience SerializationExceptions as a result.

I checked my deployed application directory there is only one .gwt.rpc
file which is E8B2AED1667057CBC391B7AC2BFAA4E9.gwt.rpc but not
D96C005D9FEF0E3183DC3057D9F48727.gwt.rpc. I don't know how GWT is
generating this file name and why its generating different names when
its being actual generating the file and when its using it. And the
file which 

Re: Bean Serialization Problem: com.google.gwt.user.client.rpc.SerializationException: Type 'com.dg.common.client.beans.DGUser' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable'

2008-11-05 Thread JM

ping2ravi I'm glad you came back to tell it's now working for you!
But think of all those people with the same problem you had... like
me.
Any idea?
My classes are implementing Serializable. It's working fine on my
development environment (Windows).
But now that I try an integration (Linux), I get the same exception.

Thanks,
JM


On 23 oct, 11:10, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hi

 May we know what was causing the difference in file-names?  I am
 having a similar exception

 G.

 On Sep 22, 1:06 pm, ping2ravi [EMAIL PROTECTED] wrote:

  i found the problem why file names were different.
  Thanks

  On Sep 22, 11:18 am, ping2ravi [EMAIL PROTECTED] wrote:

   Hi All,
   My application was working good till now and now i deployed it to
   other machine and it start giving me following exception. My DGUser
   class is implementing serializable interface.

   SEVERE: Exception while dispatching incoming RPC call
   com.google.gwt.user.client.rpc.SerializationException: Type
   'com.dg.common.client.beans.DGUser' was not assignable to
   'com.google.gwt.user.client.rpc.IsSerializable' and did not have a
   custom field serializer.  For security purposes, this type will not be
   serialized.
           at
   com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy.validateSerialize(LegacySerializationPolicy.java:
   140)
           at
   com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
   585)
           at
   com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
   129)
           at 
   com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
   $ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
           at
   com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:
   520)
           at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573)
           at
   com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:
   441)
           at
   com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
   529)
           at
   com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
   163)
           at
   com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
   85)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
           at
   org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
   290)
           at
   org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
   206)
           at
   org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
   233)
           at
   org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
   175)
           at
   org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
   128)
           at
   org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
   102)
           at
   org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
   109)
           at
   org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
   263)
           at
   org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
   844)
           at org.apache.coyote.http11.Http11Protocol
   $Http11ConnectionHandler.process(Http11Protocol.java:584)
           at 
   org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
   447)
           at java.lang.Thread.run(Thread.java:619)

   And also its giving following error in the log file, So i am guessing
   its because of this .gwt.rpc missing file,
   INFO: ERROR: The serialization policy file '/
   D96C005D9FEF0E3183DC3057D9F48727.gwt.rpc' was not found; did you
   forget to include it in this deployment?
   INFO: WARNING: Failed to get the SerializationPolicy
   'D96C005D9FEF0E3183DC3057D9F48727' for module 'http://localhost:8090/
   AdminMenu/'; a legacy, 1.3.3 compatible, serialization policy will be
   used.  You may experience SerializationExceptions as a result.

   I checked my deployed application directory there is only one .gwt.rpc
   file which is E8B2AED1667057CBC391B7AC2BFAA4E9.gwt.rpc but not
   D96C005D9FEF0E3183DC3057D9F48727.gwt.rpc. I don't know how GWT is
   generating this file name and why its generating different names when
   its being actual generating the file and when its using it. And the
   file which is present in my deployed directory have all my beans
   including DgUser.
   There is something wrong, can any one please help me.

   Thanks in advance,
   Ravi

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google 

Re: Bean Serialization Problem: com.google.gwt.user.client.rpc.SerializationException: Type 'com.dg.common.client.beans.DGUser' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable'

2008-10-23 Thread [EMAIL PROTECTED]

Hi

May we know what was causing the difference in file-names?  I am
having a similar exception


G.



On Sep 22, 1:06 pm, ping2ravi [EMAIL PROTECTED] wrote:
 i found the problem why file names were different.
 Thanks

 On Sep 22, 11:18 am, ping2ravi [EMAIL PROTECTED] wrote:

  Hi All,
  My application was working good till now and now i deployed it to
  other machine and it start giving me following exception. My DGUser
  class is implementing serializable interface.

  SEVERE: Exception while dispatching incoming RPC call
  com.google.gwt.user.client.rpc.SerializationException: Type
  'com.dg.common.client.beans.DGUser' was not assignable to
  'com.google.gwt.user.client.rpc.IsSerializable' and did not have a
  custom field serializer.  For security purposes, this type will not be
  serialized.
          at
  com.google.gwt.user.server.rpc.impl.LegacySerializationPolicy.validateSerialize(LegacySerializationPolicy.java:
  140)
          at
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:
  585)
          at
  com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:
  129)
          at 
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
  $ValueWriter$8.write(ServerSerializationStreamWriter.java:146)
          at
  com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeValue(ServerSerializationStreamWriter.java:
  520)
          at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:573)
          at
  com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess(RPC.java:
  441)
          at
  com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
  529)
          at
  com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:
  163)
          at
  com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:
  85)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
          at
  org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
  290)
          at
  org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
  206)
          at
  org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
  233)
          at
  org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
  175)
          at
  org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
  128)
          at
  org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
  102)
          at
  org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
  109)
          at
  org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
  263)
          at
  org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
  844)
          at org.apache.coyote.http11.Http11Protocol
  $Http11ConnectionHandler.process(Http11Protocol.java:584)
          at 
  org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:
  447)
          at java.lang.Thread.run(Thread.java:619)

  And also its giving following error in the log file, So i am guessing
  its because of this .gwt.rpc missing file,
  INFO: ERROR: The serialization policy file '/
  D96C005D9FEF0E3183DC3057D9F48727.gwt.rpc' was not found; did you
  forget to include it in this deployment?
  INFO: WARNING: Failed to get the SerializationPolicy
  'D96C005D9FEF0E3183DC3057D9F48727' for module 'http://localhost:8090/
  AdminMenu/'; a legacy, 1.3.3 compatible, serialization policy will be
  used.  You may experience SerializationExceptions as a result.

  I checked my deployed application directory there is only one .gwt.rpc
  file which is E8B2AED1667057CBC391B7AC2BFAA4E9.gwt.rpc but not
  D96C005D9FEF0E3183DC3057D9F48727.gwt.rpc. I don't know how GWT is
  generating this file name and why its generating different names when
  its being actual generating the file and when its using it. And the
  file which is present in my deployed directory have all my beans
  including DgUser.
  There is something wrong, can any one please help me.

  Thanks in advance,
  Ravi
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT Serialization problem !!!!

2008-10-17 Thread Sam



Hi olivier,
Thanks a lot for prompt reply, The solution you said works fine if we
extend our class from RemoteServiceServlet . However in my case I am
not extending the class from RemoteServiceServlet . I am making the
use of HandlerAdapter class of spring for integrating spring wid GWT.
Is there any way to achive the same kinda functionality there by not
extending from RemoteServiceSerlvet class.
Thanks
Samir


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT Serialization problem !!!!

2008-10-17 Thread Sam



Hi olivier,
Thanks a lot for prompt reply, The solution you said works fine if we
extend our class from RemoteServiceServlet . However in my case I am
not extending the class from RemoteServiceServlet . I am making the
use of HandlerAdapter class of spring for integrating spring wid GWT.
Is there any way to achive the same kinda functionality there by not
extending from RemoteServiceSerlvet class.
Thanks
Samir


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT Serialization problem !!!!

2008-10-17 Thread olivier nouguier
Hi sam,
 I had the same issue while integrating with acegi, what I choose was to
extract the code of RemoteServiceServlet in a helper 

On Fri, Oct 17, 2008 at 8:40 AM, Sam [EMAIL PROTECTED] wrote:




 Hi olivier,
 Thanks a lot for prompt reply, The solution you said works fine if we
 extend our class from RemoteServiceServlet . However in my case I am
 not extending the class from RemoteServiceServlet . I am making the
 use of HandlerAdapter class of spring for integrating spring wid GWT.
 Is there any way to achive the same kinda functionality there by not
 extending from RemoteServiceSerlvet class.
 Thanks
 Samir


 



-- 
Si l'ignorance peut servir de consolation, elle n'en est pas moins
illusoire.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT Serialization problem !!!!

2008-10-17 Thread Sam


Can you please share that code to me ? That will be a great help !!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT Serialization problem !!!!

2008-10-15 Thread olivier nouguier
Hi
 You should call : RPC.decodeRequest(payload,this.remoteServiceClass,
*this*);
 *this* being the remote servlet (SerializationPoliciyProvider)
 To resolve the serialization policy (That allow the GWT serialization of
Serializable).

If no SerializationPoliciyProvider or his the resolution fails to
DefaultPolicies (GWT 1.3) is applied and Object must be IsSerializable.

You can look at:
http://code.google.com/p/net-orcades-spring/source/browse/trunk/orcades-spring-gwt/src/main/java/net/orcades/spring/gwt/SpringGWTRemoteServlet.java
 from my Spring integration: http://code.google.com/p/net-orcades-spring/

hih



On Wed, Oct 15, 2008 at 4:17 PM, Sam [EMAIL PROTECTED] wrote:


 Hello all,
 I have written a code which will integrate the GWT with spring . For
 this purpose I have overridden the
public String processCall(String payload)
 methode.
  This works fine if any class which needs to be serilized is
 implementing isSerilizabel interface. However if I implement the
 serilizabel interface insted of isSerilizabel , I get serilization
 exception.
 Error occours when I try to decode the request by using following
 code.

 RPCRequest rpcRequest =
 RPC.decodeRequest(payload,this.remoteServiceClass);

 Is there any way by which my code will run there by implementing
 Serilizabel interface ONLY.
 Any white paper , any link will greatly be appriciated.
 Thanks,
 Samir

 



-- 
Si l'ignorance peut servir de consolation, elle n'en est pas moins
illusoire.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: GWT Serialization problem !!!!

2008-10-15 Thread olivier nouguier
Sorry for my poor expression...
If no SerializationPoliciyProvider is given (your case) or if the resolution
fails GWT DefaultPolicies (GWT 1.3) is applied and Object must be
IsSerializable.

On Wed, Oct 15, 2008 at 4:54 PM, olivier nouguier 
[EMAIL PROTECTED] wrote:

 Hi
  You should call : RPC.decodeRequest(payload,this.remoteServiceClass,
 *this*);
  *this* being the remote servlet (SerializationPoliciyProvider)
  To resolve the serialization policy (That allow the GWT serialization of
 Serializable).

 If no SerializationPoliciyProvider or his the resolution fails to
 DefaultPolicies (GWT 1.3) is applied and Object must be IsSerializable.

 You can look at:

 http://code.google.com/p/net-orcades-spring/source/browse/trunk/orcades-spring-gwt/src/main/java/net/orcades/spring/gwt/SpringGWTRemoteServlet.java
  from my Spring integration: http://code.google.com/p/net-orcades-spring/

 hih




 On Wed, Oct 15, 2008 at 4:17 PM, Sam [EMAIL PROTECTED] wrote:


 Hello all,
 I have written a code which will integrate the GWT with spring . For
 this purpose I have overridden the
public String processCall(String payload)
 methode.
  This works fine if any class which needs to be serilized is
 implementing isSerilizabel interface. However if I implement the
 serilizabel interface insted of isSerilizabel , I get serilization
 exception.
 Error occours when I try to decode the request by using following
 code.

 RPCRequest rpcRequest =
 RPC.decodeRequest(payload,this.remoteServiceClass);

 Is there any way by which my code will run there by implementing
 Serilizabel interface ONLY.
 Any white paper , any link will greatly be appriciated.
 Thanks,
 Samir

 



 --
 Si l'ignorance peut servir de consolation, elle n'en est pas moins
 illusoire.




-- 
Si l'ignorance peut servir de consolation, elle n'en est pas moins
illusoire.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Google Web Toolkit group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---