Re: Serialization issues
You either are missing a jar or forget to inherit a required module. Sincerely, Joseph -- 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/-/OXwbZdgXg5oJ. 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 issues
Hello, I am working on some code that will do serialization on a canvas(SmartGWT canvas) so that it could be saved to the server in a database, I found some example code that I am using on how to do serialization in GWT but i keep getting the following error: [ERROR] [web_final] - Line 22: No source code is available for type com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter; did you forget to inherit a required module? [ERROR] [web_final] - Line 46: No source code is available for type com.google.gwt.user.server.rpc.SerializationPolicy; did you forget to inherit a required module? and here is the code that is generating it: import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.SerializationException; import com.google.gwt.user.client.rpc.SerializationStreamFactory; import com.google.gwt.user.server.rpc.SerializationPolicy; import com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter; import com.smartgwt.client.widgets.Canvas; public class CanvasSerialize{ public CanvasSerialize() {} public String doSerialize(Canvas canvasIn){ Class responseClass = canvasIn.getClass(); // make a serialization policy of my own to use, normally deteremined by rpc request ServerSerializationStreamWriter stream = newServerSerializationStreamWriter( new SerializePolicy()); stream.prepareToWrite(); if (responseClass != void.class) { try { stream.serializeValue(canvasIn, responseClass); } catch (SerializationException e) {e.printStackTrace();} } String bufferStr = stream.toString(); return bufferStr; } public Canvas deSerialize(String buffer){ SerializationStreamFactory ssf = GWT.create( Canvas.class); Canvas decodedObject = null; try { decodedObject = (Canvas)ssf.createStreamReader( buffer ).readObject(); } catch (SerializationException e) { e.printStackTrace();} return decodedObject; } private class SerializePolicy extends SerializationPolicy { @Override public boolean shouldDeserializeFields(Class clazz) { return false; } @Override public boolean shouldSerializeFields(Class clazz) { return false; } @Override public void validateDeserialize(Class clazz) throws SerializationException { } @Override public void validateSerialize(Class clazz) throwsSerializationException { } } } I have this file inside the server package, but i am calling it client side, is that the issue? any help would be greatly appreciated. Thanks! -- 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/-/kQ51M3gcykoJ. 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/Tomcat serialization issues during deployment
Had to get my hands dirty to figure this one out. Here's how I got around these exceptions. 1. First, on the client side. Instead of calling testService.sendTestData(new TestData(), sendTestDataCallback); I did the following: String content = ServiceUtils.marshallTestServiceObject(new TestData()); testService.sendTestData(content, sendTestDataCallback); where marshallTestService looks like this: public static String marshallTestServiceObject(Object obj) { String content = null; SerializationStreamFactory factory = GWT.create(TestService.class); SerializationStreamWriter writer = factory.createStreamWriter(); try { writer.writeObject(obj); content = writer.toString(); } catch (SerializationException se) { content = null; } return content; } That successfully sent the object to the server side. 2. On the server side I had to create my own AbstractSerializationStreamReader and call it as follows: CustomSerializationStreamReader reader = new CustomSerializationStreamReader( Thread.currentThread().getContextClassLoader(), null); try { reader.prepareToRead(content); TestData testData = (TestData)reader.readObject(); // viola, I have the testData instance } catch (SerializationException se) { se.printStackTrace(); } Before I created a custom string reader I tried to use the ServerSerializableStreamReader. This did not work because of the following line of code: Constructor constructor = instanceClass.getDeclaredConstructor(); That line of code essentially makes the following call: System.getSecurityManager() .checkMemberAccess(TestData.class.getDeclaredConstructor().getClass(), Member.DECLARED); Unfortunately, when Tomcat is running with a security manager, this call causes an AccessControlException because we can only see Member.PUBLIC. So...Long story short. My CustomSerializableStreamReader simply calls Constructor.newInstance(), which does the trick. I know that my default ctor exists and is public so this worked for me. I hope somebody is able to find this useful. Especially if you run your app on GoDaddy and need reflection. -Eric On Aug 11, 9:52 pm, duey wrote: > I have a simple application setup. It is comprised of a single module > that has one responsibility. Its job is to test RPC in my > application. Here's what I have. First, on the client side, I have a > TestData object. This object implements java.io.Serializable. It has > one member variable, which has a public access modifier. On the > server side, it's very simple. I have an implementation of a > RemoteServiceServlet that has 2 methods. One that creates an instance > of TestData, the other that accepts an instance of TestData and simply > returns true. > > I have 2 goals: > 1. I am testing if the TestData can successfully travel from server- > side to client side. > 2. I want to create a TestData object and send it to the server side. > > I am deploying my application as a WAR file with Tomcat. Tomcat is > running with security enabled. > > I can successfully accomplish my first goal. I get the object back > from the server and display its contents in a Label. When I attempt > the second goal I get the following exception: > > 2010-08-11 21:24:37 StandardContext[/trunorth]Exception while > dispatching incoming RPC call > java.security.AccessControlException: access denied > (java.lang.reflect.ReflectPermission suppressAccessChecks) > at > java.security.AccessControlContext.checkPermission(AccessControlContext.jav a: > 323) > at > java.security.AccessController.checkPermission(AccessController.java: > 546) > at java.lang.SecurityManager.checkPermission(SecurityManager.java: > 532) > at > java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java: > 107) > at > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.instant > iate(ServerSerializationStreamReader.java: > 887) > at > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deseria > lize(ServerSerializationStreamReader.java: > 544) > at > com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readO > bject(AbstractSerializationStreamReader.java: > 61) > at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader > $ValueReader$8.readValue(ServerSerializationStreamReader.java:137) > at > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deseria > lizeValue(ServerSerializationStreamReader.java: > 384) > at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC
GWT/Tomcat serialization issues during deployment
I have a simple application setup. It is comprised of a single module that has one responsibility. Its job is to test RPC in my application. Here's what I have. First, on the client side, I have a TestData object. This object implements java.io.Serializable. It has one member variable, which has a public access modifier. On the server side, it's very simple. I have an implementation of a RemoteServiceServlet that has 2 methods. One that creates an instance of TestData, the other that accepts an instance of TestData and simply returns true. I have 2 goals: 1. I am testing if the TestData can successfully travel from server- side to client side. 2. I want to create a TestData object and send it to the server side. I am deploying my application as a WAR file with Tomcat. Tomcat is running with security enabled. I can successfully accomplish my first goal. I get the object back from the server and display its contents in a Label. When I attempt the second goal I get the following exception: 2010-08-11 21:24:37 StandardContext[/trunorth]Exception while dispatching incoming RPC call java.security.AccessControlException: access denied (java.lang.reflect.ReflectPermission suppressAccessChecks) at java.security.AccessControlContext.checkPermission(AccessControlContext.java: 323) at java.security.AccessController.checkPermission(AccessController.java: 546) at java.lang.SecurityManager.checkPermission(SecurityManager.java: 532) at java.lang.reflect.AccessibleObject.setAccessible(AccessibleObject.java: 107) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.instantiate(ServerSerializationStreamReader.java: 887) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java: 544) at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java: 61) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader $ValueReader$8.readValue(ServerSerializationStreamReader.java:137) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeValue(ServerSerializationStreamReader.java: 384) at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:296) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java: 186) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java: 224) snip... In terms of code, this is what I'm trying to do from the client side: testService.sendTestData(new TestData(), sendTestDataCallback); The communication with the server is fine. The ONLY problem I have is when I try and create a custom object on the client side and send it to the server. How can I get around this WITHOUT modifying Tomcat permissions? When I officially deploy this application I won't have access to Tomcat's permissions so I need to make this work with the default Tomcat security settings. Please explain to me why a custom object can travel from server to client with no issues, while the converse is not true. Thanks in advance -- 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: Date Serialization issues
Hi, You can do something like this: Write custom Date/Time serializers and put them in the root of your project. Like this: Project | - your.package.com | - com.google.gwt.user.client.rpc.core.java.sql | - com.google.gwt.user.client.rpc.core.java.util The custom serializers NEED to be named: Date_CustomFieldSerializer.java Timestamp_CustomFieldSerializer.java When writing the serializers, import the right types (java.sql.Date, java.util.Date, java.sql.Timestamp) Sorry for my english. On Aug 9, 7:23 am, Paul Robinson wrote: > You can't change the timezone. You can't even create a date on the > client and tell it what timezone it should be in - Javascript does not > provide a way to do this. > > If you want dates on the client to appear to be the same time of day and > date as it is on the server, regardless of the client's timezone, and > you are using GWT serialization, then you have two options: > (1) Avoid Date objects in your DTOs, and use some encoding of your own > instead > (2) Modify GWT itself so that its custom serializers for java.util.Date, > java.sql.Date and java.sql.Timestamp serialize the > day/month/year/hour/minute separately instead of storing the time since > 1970. > > See here for more > details:http://groups.google.com/group/google-web-toolkit/browse_thread/threa... > > Paul > > Ameya Kulkarni wrote: > > We are sending date objects from server. It works for all dates except > > the older ones. We cannot change the implementation to send strings > > now. > > > How do we set time zone in the application ? > > > On Aug 6, 11:26 am, Muhammad wrote: > > >> Dear , > > >> Please set time zone in your application. > >> then you may get exact date you want. > > >> Muhammad Bilal Ilyas > >> Software Engineer > > >> > >> From: Ameya Kulkarni > >> To: Google Web Toolkit > >> Sent: Fri, August 6, 2010 11:09:46 AM > >> Subject: Date Serialization issues > > >> Hi > > >> We are sending java.util.Date objects from the server. On the client > >> side these date values are not correct. > > >> Examples: > >> 14-Jul-1000 (on server) is shown as 20-Jul-1000 (on browser) > >> 14-Jul-0100 (on server) is shown as 13-Jul-0100 (on browser) > > >> We are using GWT 2.0. Has anyone faced such issues ? > > >> -- > >> 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. -- 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: Date Serialization issues
You can't change the timezone. You can't even create a date on the client and tell it what timezone it should be in - Javascript does not provide a way to do this. If you want dates on the client to appear to be the same time of day and date as it is on the server, regardless of the client's timezone, and you are using GWT serialization, then you have two options: (1) Avoid Date objects in your DTOs, and use some encoding of your own instead (2) Modify GWT itself so that its custom serializers for java.util.Date, java.sql.Date and java.sql.Timestamp serialize the day/month/year/hour/minute separately instead of storing the time since 1970. See here for more details: http://groups.google.com/group/google-web-toolkit/browse_thread/thread/5c397f3ffc4e24fa/e6344c0dad5f37b3 Paul Ameya Kulkarni wrote: > We are sending date objects from server. It works for all dates except > the older ones. We cannot change the implementation to send strings > now. > > How do we set time zone in the application ? > > On Aug 6, 11:26 am, Muhammad wrote: > >> Dear , >> >> Please set time zone in your application. >> then you may get exact date you want. >> >> Muhammad Bilal Ilyas >> Software Engineer >> >> >> From: Ameya Kulkarni >> To: Google Web Toolkit >> Sent: Fri, August 6, 2010 11:09:46 AM >> Subject: Date Serialization issues >> >> Hi >> >> We are sending java.util.Date objects from the server. On the client >> side these date values are not correct. >> >> Examples: >> 14-Jul-1000 (on server) is shown as 20-Jul-1000 (on browser) >> 14-Jul-0100 (on server) is shown as 13-Jul-0100 (on browser) >> >> We are using GWT 2.0. Has anyone faced such issues ? >> >> -- >> 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. >> > > -- 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: Date Serialization issues
We are sending date objects from server. It works for all dates except the older ones. We cannot change the implementation to send strings now. How do we set time zone in the application ? On Aug 6, 11:26 am, Muhammad wrote: > Dear , > > Please set time zone in your application. > then you may get exact date you want. > > Muhammad Bilal Ilyas > Software Engineer > > > From: Ameya Kulkarni > To: Google Web Toolkit > Sent: Fri, August 6, 2010 11:09:46 AM > Subject: Date Serialization issues > > Hi > > We are sending java.util.Date objects from the server. On the client > side these date values are not correct. > > Examples: > 14-Jul-1000 (on server) is shown as 20-Jul-1000 (on browser) > 14-Jul-0100 (on server) is shown as 13-Jul-0100 (on browser) > > We are using GWT 2.0. Has anyone faced such issues ? > > -- > 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. -- 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: Date Serialization issues
Dear , Please set time zone in your application. then you may get exact date you want. Muhammad Bilal Ilyas Software Engineer From: Ameya Kulkarni To: Google Web Toolkit Sent: Fri, August 6, 2010 11:09:46 AM Subject: Date Serialization issues Hi We are sending java.util.Date objects from the server. On the client side these date values are not correct. Examples: 14-Jul-1000 (on server) is shown as 20-Jul-1000 (on browser) 14-Jul-0100 (on server) is shown as 13-Jul-0100 (on browser) We are using GWT 2.0. Has anyone faced such issues ? -- 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. -- 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: Date Serialization issues
Yes... Convert the date into string and send, it will work well let me know if u need more info Regards, Bhaskar On Fri, Aug 6, 2010 at 11:39 AM, Ameya Kulkarni wrote: > Hi > > We are sending java.util.Date objects from the server. On the client > side these date values are not correct. > > Examples: > 14-Jul-1000 (on server) is shown as 20-Jul-1000 (on browser) > 14-Jul-0100 (on server) is shown as 13-Jul-0100 (on browser) > > We are using GWT 2.0. Has anyone faced such issues ? > > -- > 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. > > -- Keep Smiling Thanks & Regards Bhaskar. Mobile:9866724142 -- 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.
Date Serialization issues
Hi We are sending java.util.Date objects from the server. On the client side these date values are not correct. Examples: 14-Jul-1000 (on server) is shown as 20-Jul-1000 (on browser) 14-Jul-0100 (on server) is shown as 13-Jul-0100 (on browser) We are using GWT 2.0. Has anyone faced such issues ? -- 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: Emulated java class serialization issues
Ok, I think I figured this out. In addition to what I have described above, I did need a custom serializer. Provided, I don't have too many classes to serialize in a custom way, I guess that's the way to go. [code] package dao; import com.google.gwt.user.client.rpc.SerializationStreamWriter; import com.google.gwt.user.client.rpc.SerializationException; import com.google.gwt.user.client.rpc.SerializationStreamReader; import java.util.List; public class EntityWithObjectReference_CustomFieldSerializer { public static void serialize(SerializationStreamWriter writer, EntityWithObjectReference entity) throws SerializationException { writer.writeObject(entity.getSerializableEntities()); writer.writeString(entity.getText()); } public static void deserialize(SerializationStreamReader reader, EntityWithObjectReference entity) throws SerializationException { entity.setSerializableEntities((List) reader.readObject()); entity.setText( reader.readString()); } } [/code] Note, I did extend the original class a little to make the test somewhat more complete: [code] public class EntityWithObjectReference { public Object objReference; private String text; private List serializableEntities; public EntityWithObjectReference() { } public List getSerializableEntities() { return serializableEntities; } public void setSerializableEntities(List serializableEntities) { this.serializableEntities = serializableEntities; } public String getText() { return text; } public void setText(String text) { this.text = text; } } [/code] On Sep 21, 1:22 pm, Andrius Juozapaitis wrote: > > Use wrapper-classes containing only the values you need in your > > GWT-application. The server creates these objects out of the > > server-side instances and set the values when received from the > > client. It's more or less the same as you already did but with > > the difference that you don't rely on the "intelligence" of > > the compiler but take that into your own hands. > > I am reluctant to maintaining another layer of essentially duplicate > classes, as well as creating all the data copying logic (I guess this > could be accomplished by an aspect, as I am using Spring in the > backend). I've considered using a custom Serializer/Deserializer, but > was hoping there's a way to avoid it. Oh well, back to drawing board. > > Unless somebody comes up with a better idea, of course - I am open for > suggestions :) > > regards, > Andrius --~--~-~--~~~---~--~~ 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: Emulated java class serialization issues
> Use wrapper-classes containing only the values you need in your > GWT-application. The server creates these objects out of the > server-side instances and set the values when received from the > client. It's more or less the same as you already did but with > the difference that you don't rely on the "intelligence" of > the compiler but take that into your own hands. I am reluctant to maintaining another layer of essentially duplicate classes, as well as creating all the data copying logic (I guess this could be accomplished by an aspect, as I am using Spring in the backend). I've considered using a custom Serializer/Deserializer, but was hoping there's a way to avoid it. Oh well, back to drawing board. Unless somebody comes up with a better idea, of course - I am open for suggestions :) regards, Andrius --~--~-~--~~~---~--~~ 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: Emulated java class serialization issues
Andrius Juozapaitis schrieb: > I have a crawling suspicion, the server tries to serialize the > original class, and the client gets additional object reference int > the stream, that it doesn't know how to handle. What is the correct > way to solve this problem, apart from rewriting the library in > question to get rid of object references? Use wrapper-classes containing only the values you need in your GWT-application. The server creates these objects out of the server-side instances and set the values when received from the client. It's more or less the same as you already did but with the difference that you don't rely on the "intelligence" of the compiler but take that into your own hands. Alternatively you might check out the ability to use your own Serializer/Deserializer. But that I haven't done, yet so I can't tell you more about that. Regards, Lothar --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Emulated java class serialization issues
Hey, I stumbled upon a problem when trying to use CouchDB with GWT (the JCouchDB framework has unserializable fields in the lists they return, that are not really relevant in GWT clientside). So I created a simple test case (maven project) that tries to emulate the non-serializable class using in gwt module. Everything compiles without warnings, but I am getting an error when returning the emulated class from the server side ('This application is out of date, please click the refresh button on your browser.'). The classes in question are: [code] package dao; public class EntityWithObjectReference { public Object objReference; private String text; public EntityWithObjectReference() { } public String getText() { return text; } public void setText(String text) { this.text = text; } } [/code] emulated class is defined as follows: [code] package dao; import java.io.Serializable; public class EntityWithObjectReference implements Serializable { private String text; public EntityWithObjectReference() {} public String getText() { return text; } public void setText(String text) { this.text = text; } } [/code] note the lack of Object reference. The module descriptor I use is: [code] http://google-web-toolkit.googlecode.com/svn/releases/1.7/ distro-source/core/src/gwt-module.dtd"> [/code] I have a crawling suspicion, the server tries to serialize the original class, and the client gets additional object reference int the stream, that it doesn't know how to handle. What is the correct way to solve this problem, apart from rewriting the library in question to get rid of object references? thanks in advance, Andrius --~--~-~--~~~---~--~~ 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: Inheritance and String Serialization issues
sorry its 2551 Shay On Aug 14, 7:11 pm, shay wrote: > i found 2 issues 2552 , and 2557, which were identified at version > 1.5 , i believe they found their way back . > > Shay > > On Aug 14, 1:18 am,shay wrote: > > > Hi , > > > I am experiencing some issues with serialization of simple strings. > > > I created classes A, B and C . where B inherits A , and C inherits B. > > > A and B are abstract. > > > myRPCcall is simple it takes and returns a class of type A. > > > fields in all 3 classes are strings. > > > all 3 classes are defined as public , and all their fields are > > public. > > > B and C implement IsSerializable . > > > the first issue that i see is that only fields that are defined in > > class C get serialized to the server, and the same happens on the > > return trip.all the fields from A and B have null values. > > > the second issue is that when i add the interface IsSerializable to > > class A , i get an > > com.google.gwt.user.client.rpc.SerializationException > > > Any advice? > > > Thanks,Shay --~--~-~--~~~---~--~~ 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: Inheritance and String Serialization issues
i found 2 issues 2552 , and 2557, which were identified at version 1.5 , i believe they found their way back . Shay On Aug 14, 1:18 am, shay wrote: > Hi , > > I am experiencing some issues with serialization of simple strings. > > I created classes A, B and C . where B inherits A , and C inherits B. > > A and B are abstract. > > myRPCcall is simple it takes and returns a class of type A. > > fields in all 3 classes are strings. > > all 3 classes are defined as public , and all their fields are > public. > > B and C implement IsSerializable . > > the first issue that i see is that only fields that are defined in > class C get serialized to the server, and the same happens on the > return trip.all the fields from A and B have null values. > > the second issue is that when i add the interface IsSerializable to > class A , i get an > com.google.gwt.user.client.rpc.SerializationException > > Any advice? > > Thanks,Shay --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Inheritance and String Serialization issues
Hi , I am experiencing some issues with serialization of simple strings. I created classes A, B and C . where B inherits A , and C inherits B. A and B are abstract. my RPC call is simple it takes and returns a class of type A. fields in all 3 classes are strings. all 3 classes are defined as public , and all their fields are public. B and C implement IsSerializable . the first issue that i see is that only fields that are defined in class C get serialized to the server, and the same happens on the return trip.all the fields from A and B have null values. the second issue is that when i add the interface IsSerializable to class A , i get an com.google.gwt.user.client.rpc.SerializationException Any advice? Thanks, Shay --~--~-~--~~~---~--~~ 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: How to debug serialization issues?
rlaferla schrieb: > How do you guys go about debugging serialization issues? I am using > GWT 1.5.3 and my GWT client is sending a DTO to the server. If I do a > Log.debug() just prior to the call to the server, I see all of my data > in my DTO. However, when I do a log.debug() on my DTO in the GWT-RPC > service, some of my data is missing. I have read through forum posts, > etc... but I feel I don't have the necessary tools to debug the > problem. The data that appears to not be serialized is a > Set (implementation is a HashSet) off of my DTO. Both > the DTO and CustomClass are marked Serializable, I use generics for > the Set. Something like this: http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/921ed97efac028c1/6d9e6202715cabee Do you use additional libraries to the standard GWT jars? I had a similar problem (see above) where data-objects were losing data (just vice versa when being transported from the server to the client. The reason was that I used the DateChooser from the Rocket GWT library. Something inside the Rocket-compiler.jar was leading to this kind of effect. After throwing out the library and using another Date Picker everything worked again. Regards, Lothar --~--~-~--~~~---~--~~ 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: How to debug serialization issues?
I override onBeforeRequestDeserialized and onAfterResponseSerialized in my servlets to view the raw data being passed in RPC. I have also used HashSet with generics and do not generally have problems. Once, I think it was in an earlier version of GWT, I needed to add any objects that I used generically to a fake method in one of my services. So if the was Set and Set I would add workaround (Foo arg0, Bar arg1) to any of my remote services. This got around the problem. On Jan 7, 1:46 pm, rlaferla wrote: > How do you guys go about debugging serialization issues? I am using > GWT 1.5.3 and my GWT client is sending a DTO to the server. If I do a > Log.debug() just prior to the call to the server, I see all of my data > in my DTO. However, when I do a log.debug() on my DTO in the GWT-RPC > service, some of my data is missing. I have read through forum posts, > etc... but I feel I don't have the necessary tools to debug the > problem. The data that appears to not be serialized is a > Set (implementation is a HashSet) off of my DTO. Both > the DTO and CustomClass are marked Serializable, I use generics for > the Set. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
How to debug serialization issues?
How do you guys go about debugging serialization issues? I am using GWT 1.5.3 and my GWT client is sending a DTO to the server. If I do a Log.debug() just prior to the call to the server, I see all of my data in my DTO. However, when I do a log.debug() on my DTO in the GWT-RPC service, some of my data is missing. I have read through forum posts, etc... but I feel I don't have the necessary tools to debug the problem. The data that appears to not be serialized is a Set (implementation is a HashSet) off of my DTO. Both the DTO and CustomClass are marked Serializable, I use generics for the Set. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---