Re: GWT Serialization Broken?
You must refresh/reload your server if you change serializable classes. GWT generates a file called hash.rpc and this file changes whenever you modify a serializable class. Your server must have the up-to-date version of that file. Your both example classes look fine. It's just a deployment issue. -- 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.
Re: Explicit Access to GWT Serialization Logic
Thank you very much Xi, i will try your framework and will get to you if i need any help. On Thu, Nov 7, 2013 at 4:38 PM, Xi chenx...@gmail.com wrote: Hi, I've made a framework (*gwt-storage, * https://github.com/seanchenxi/gwt-storage) to realize the Object - String serialization/deserialization in client side, I *reused the RPC serialization/deserialization logic to do it*. You can check out the source code, (package *com/seanchenxi/gwt/storage/client/serializer*), maybe this can help you to find out your way. It's a pretty simple framework, the GWT RPC serialization/deserialization logic is asymmetrical between client and server, I just write a SerializationStreamWriter (more like a copy of *com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter*) for client side Object to String serialization, and I reused *com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader* to do client side deserialization. If you have any question, send me a mail. ;) Hope helpful ! Le mercredi 6 novembre 2013 10:59:42 UTC+1, Manikanda raj S a écrit : I have been using GWT RPC calls until now and it was really helpful. But now i wanted to split the Servlet part and Client Part of the GWT. Since GWT RPC is serializing the request and response data, i need to change them to XML/JSON in order to split the GWT code as client Servlet part or if i could gain access to Serialization logic, i could simply add some code to use 'RequestBuilder' and then explicitly serialize/deserialize in client servlet side. Marc Hacker already requested for the explicit access to the serialization logic, but he wasn't answered. Can anyone let me know how to access the serialize/deserialize classes in GWT. -- 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.
Re: Explicit Access to GWT Serialization Logic
Hi, I've made a framework (*gwt-storage, * https://github.com/seanchenxi/gwt-storage) to realize the Object - String serialization/deserialization in client side, I *reused the RPC serialization/deserialization logic to do it*. You can check out the source code, (package *com/seanchenxi/gwt/storage/client/serializer*), maybe this can help you to find out your way. It's a pretty simple framework, the GWT RPC serialization/deserialization logic is asymmetrical between client and server, I just write a SerializationStreamWriter (more like a copy of * com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter*) for client side Object to String serialization, and I reused * com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader* to do client side deserialization. If you have any question, send me a mail. ;) Hope helpful ! Le mercredi 6 novembre 2013 10:59:42 UTC+1, Manikanda raj S a écrit : I have been using GWT RPC calls until now and it was really helpful. But now i wanted to split the Servlet part and Client Part of the GWT. Since GWT RPC is serializing the request and response data, i need to change them to XML/JSON in order to split the GWT code as client Servlet part or if i could gain access to Serialization logic, i could simply add some code to use 'RequestBuilder' and then explicitly serialize/deserialize in client servlet side. Marc Hacker already requested for the explicit access to the serialization logic, but he wasn't answered. Can anyone let me know how to access the serialize/deserialize classes in GWT. -- 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.
Explicit Access to GWT Serialization Logic
I have been using GWT RPC calls until now and it was really helpful. But now i wanted to split the Servlet part and Client Part of the GWT. Since GWT RPC is serializing the request and response data, i need to change them to XML/JSON in order to split the GWT code as client Servlet part or if i could gain access to Serialization logic, i could simply add some code to use 'RequestBuilder' and then explicitly serialize/deserialize in client servlet side. Marc Hacker already requested for the explicit access to the serialization logic, but he wasn't answered. Can anyone let me know how to access the serialize/deserialize classes in GWT. -- 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
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: GWT Serialization
CORS don't work with GWT Servlets, only with RequestBuilder. As i said before i want to be able to separate the client and server code to two different web servers. And i don't want to be redoing my code all over again. Besides GWT's Serialization seems to be pretty Good. So Why replace it , just i'm trying to use it in a different way, that's it. On Tuesday, 16 October 2012 11:28:56 UTC+5:30, Manuel Carrasco wrote: So, I dont follow you. If you want to generate serialized strings in server side, you have to maintain the dependence with gwt rpc there, so why dont continuing using rpc-servlets, actually they serialize/deserialize to strings, and the same in the client side. As you say CORS works well with RPC. What is the goal of replacing gwt-rpc servlets by your own ones, or to use directly requestbuilder ? On Mon, Oct 15, 2012 at 8:35 PM, Manikanda raj S sls...@gmail.comjavascript: wrote: Hi Manolo, Thanks for the links. But i have been using GWT RPC in my Application for quite some time and it would be a pretty big work to migrate all those from GWT-RPC Serialization to Autobeans or json databinding. That's why i specifically asked for GWT Serialization externally. Any ideas on Externalized GWT Serialization ..? On Monday, 15 October 2012 12:35:49 UTC+5:30, Manuel Carrasco wrote: What you want is easy to do using requestbuilder + autobeans. Autobeans are thought to handle json string representations and convert them to javaobjects, they work in server and client sides and are full testable. http://code.google.com/p/gwt-**autobean-binding/http://code.google.com/p/gwt-autobean-binding/ http://code.google.com/p/**google-web-toolkit/wiki/**AutoBeanhttp://code.google.com/p/google-web-toolkit/wiki/AutoBean Another option I use very often in client side because of its simplicity and performance is gwtquery ajax + json-databinding http://code.google.com/p/**gwtquery/wiki/Ajaxhttp://code.google.com/p/gwtquery/wiki/Ajax http://code.google.com/p/**gwtquery/wiki/DataBindinghttp://code.google.com/p/gwtquery/wiki/DataBinding In both cases you can use any json backend. - Manolo On Sat, Oct 13, 2012 at 12:35 PM, Manikanda raj S sls...@gmail.comwrote: I'm using GWT RPC Calls for Server Side Request so far and it's pretty good. I'm planning on separating my Code into Servlets and GWT Client Side. Since i'm using RPC calls, it seems impossible. The Reason i want to do like this is , i'm planning to provide white labeling option for my App. So if i could separate the code to client code and servlets, i can simply provide the White Labeled client code to my Partners to host on their server. I have checked with GWT RequestBuilder and 'Access-Control Allow-Origin : Origin from Client Header' and it works fine. However i need to implement gwt-serialization over RequestBuilder request and Servlet Responses. How can i do this ..? Things I like to make: - RequestBuilder sending Serializable String(Which is a * IsSerialiazible* object) to Servlet. - Servlet deserializes the String to Java Object,Processes and Returns the String Response of a '*IsSerialiazable*' (Another) Object. - The Response String received in GWT RequestBuilder deseriailizes it back to a Java Object(JS after Compiling). -- 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/-/**ZNwK3SwtKOUJhttps://groups.google.com/d/msg/google-web-toolkit/-/ZNwK3SwtKOUJ . To post to this group, send email to google-we...@**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=enhttp://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 view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Pfw2FLUTfxoJ. To post to this group, send email to google-we...@googlegroups.comjavascript: . To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com javascript:. 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 view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/4NdTh26QSj0J. 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
On Tuesday, October 16, 2012 8:58:49 AM UTC+2, Manikanda raj S wrote: CORS don't work with GWT Servlets, only with RequestBuilder. There's no reason it wouldn't work. What did you try? -- 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/-/6FgCPqIoH6QJ. 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
Actually gwt RPC uses requestbuilder as its low-level transport, so cors works with rpc without any problem. Here you have an example of cors with gwt rpc. - In the client side you have to change the RPC service url GreetingServiceAsync greetingService = GWT.create(GreetingService.class); ((ServiceDefTarget)greetingService).setServiceEntryPoint( http://localhost:/mymodule/greet;); - In the server side configure a filter in your web.xml filter filter-namecorsFilter/filter-name filter-classcom.example.server.CORSFilter/filter-class /filter filter-mapping filter-namecorsFilter/filter-name url-pattern/*/url-pattern /filter-mapping - And this is an example of filter, maybe you should set any kind of security based on the Origin header package com.example.server; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class CORSFilter implements Filter { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) servletRequest; HttpServletResponse resp = (HttpServletResponse) servletResponse; String o = req.getHeader(Origin); if (options.equalsIgnoreCase(req.getMethod())) { resp.setHeader(Allow, GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS); if (o != null) { resp.addHeader(Access-Control-Allow-Origin, o); resp.addHeader(Access-Control-Allow-Methods, POST, GET, OPTIONS); resp.addHeader(Access-Control-Allow-Headers, content-type,pageurl,x-gwt-permutation,x-gwt-module-base); resp.setContentType(text/plain); } resp.getWriter().flush(); return; } if (o != null) { resp.addHeader(Access-Control-Allow-Origin, o); } if (filterChain != null) { filterChain.doFilter(req, resp); } } @Override public void destroy() { } @Override public void init(FilterConfig arg0) throws ServletException { } } The server part works with RPC, RF, RequestBuilder, gwtquery-ajax and any other js approach. - Manolo On Tue, Oct 16, 2012 at 9:01 AM, Thomas Broyer t.bro...@gmail.com wrote: On Tuesday, October 16, 2012 8:58:49 AM UTC+2, Manikanda raj S wrote: CORS don't work with GWT Servlets, only with RequestBuilder. There's no reason it wouldn't work. What did you try? -- 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/-/6FgCPqIoH6QJ. 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 Serialization
How can i actually set Response Headers in GWT Servlets ..? If i can have normal Servlets, i can have a Filter doing that. Besides i want to run client and server code in different webservers, client code(Java Script,HTML) in a apache servers in my customer's location and Servlets in my own Server. How can i do that with gwt-rpc servlets ...? On Tuesday, October 16, 2012 12:31:43 PM UTC+5:30, Thomas Broyer wrote: On Tuesday, October 16, 2012 8:58:49 AM UTC+2, Manikanda raj S wrote: CORS don't work with GWT Servlets, only with RequestBuilder. There's no reason it wouldn't work. What did you try? -- 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/-/5d0gx8dvzyUJ. 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
Thanks for the Code Manolo. But i would also like to separate the code as of now into GWT Client part as one and Servlet Part as other. One more thing i want GWT Serialization externalized is, if we can have it externalized, then we can probably use the same for Android Development too.If we can convert the same to Objective C,we can use it for IPhone too. I'm just trying to use GWT Serialization as a API data type with my Present Code. On Tuesday, October 16, 2012 6:01:39 PM UTC+5:30, Manuel Carrasco wrote: Actually gwt RPC uses requestbuilder as its low-level transport, so cors works with rpc without any problem. Here you have an example of cors with gwt rpc. - In the client side you have to change the RPC service url GreetingServiceAsync greetingService = GWT.create(GreetingService.class); ((ServiceDefTarget)greetingService).setServiceEntryPoint( http://localhost:/mymodule/greet;); - In the server side configure a filter in your web.xml filter filter-namecorsFilter/filter-name filter-classcom.example.server.CORSFilter/filter-class /filter filter-mapping filter-namecorsFilter/filter-name url-pattern/*/url-pattern /filter-mapping - And this is an example of filter, maybe you should set any kind of security based on the Origin header package com.example.server; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class CORSFilter implements Filter { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) servletRequest; HttpServletResponse resp = (HttpServletResponse) servletResponse; String o = req.getHeader(Origin); if (options.equalsIgnoreCase(req.getMethod())) { resp.setHeader(Allow, GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS); if (o != null) { resp.addHeader(Access-Control-Allow-Origin, o); resp.addHeader(Access-Control-Allow-Methods, POST, GET, OPTIONS); resp.addHeader(Access-Control-Allow-Headers, content-type,pageurl,x-gwt-permutation,x-gwt-module-base); resp.setContentType(text/plain); } resp.getWriter().flush(); return; } if (o != null) { resp.addHeader(Access-Control-Allow-Origin, o); } if (filterChain != null) { filterChain.doFilter(req, resp); } } @Override public void destroy() { } @Override public void init(FilterConfig arg0) throws ServletException { } } The server part works with RPC, RF, RequestBuilder, gwtquery-ajax and any other js approach. - Manolo On Tue, Oct 16, 2012 at 9:01 AM, Thomas Broyer t.br...@gmail.comjavascript: wrote: On Tuesday, October 16, 2012 8:58:49 AM UTC+2, Manikanda raj S wrote: CORS don't work with GWT Servlets, only with RequestBuilder. There's no reason it wouldn't work. What did you try? -- 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/-/6FgCPqIoH6QJ. To post to this group, send email to google-we...@googlegroups.comjavascript: . To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com javascript:. 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 view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/NrwwZIdQSVQJ. 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
On Tuesday, October 16, 2012 11:16:35 AM UTC+2, Manikanda raj S wrote: How can i actually set Response Headers in GWT Servlets ..? If i can have normal Servlets, i can have a Filter doing that. GWT *are* normal servlets; you can very well use a Filter to add the appropriate Allow-Origin response header. -- 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/-/ihEd05nyfbMJ. 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
Why do you say RPC servlets are not normal servlets? they are. You can control several things in your service servlet using the methods thought for that, for instance to add customized headers you can do: @Override protected void onAfterResponseSerialized(String serializedResponse) { super.onAfterResponseSerialized(serializedResponse); HttpServletResponse r = perThreadResponse.get(); r.setHeader(Foo, Bar); } GWT client code is static so you can host it in any webserver, just take the html and js generated by the compiler and deploy it in your preferred web server. In fact GWT is deseigned for client code, rpc or rf are provided to make live easier to those developers who want a backend in java. On Tue, Oct 16, 2012 at 11:16 AM, Manikanda raj S m...@vembu.com wrote: How can i actually set Response Headers in GWT Servlets ..? If i can have normal Servlets, i can have a Filter doing that. Besides i want to run client and server code in different webservers, client code(Java Script,HTML) in a apache servers in my customer's location and Servlets in my own Server. How can i do that with gwt-rpc servlets ...? On Tuesday, October 16, 2012 12:31:43 PM UTC+5:30, Thomas Broyer wrote: On Tuesday, October 16, 2012 8:58:49 AM UTC+2, Manikanda raj S wrote: CORS don't work with GWT Servlets, only with RequestBuilder. There's no reason it wouldn't work. What did you try? -- 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/-/5d0gx8dvzyUJ. 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 Serialization
RPC client part is not thought for java, although there are some libraries to handle it like gwt-syncproxy. Otherwise, RF can be used in any JVM like android, in fact request factory stuff is out of the gwt namespace. I dont think trying to handle gwt-rpc with xcode is a good idea. What I do with my mobile apps is to use gwtphonegap, so as I can use the same code base for desktop and all devices, I have not to modify any line of code in my ajax code, I use RF or gquery-ajax, although rpc works fine as well. - Manolo On Tue, Oct 16, 2012 at 3:36 PM, Manikanda raj S m...@vembu.com wrote: Thanks for the Code Manolo. But i would also like to separate the code as of now into GWT Client part as one and Servlet Part as other. One more thing i want GWT Serialization externalized is, if we can have it externalized, then we can probably use the same for Android Development too.If we can convert the same to Objective C,we can use it for IPhone too. I'm just trying to use GWT Serialization as a API data type with my Present Code. On Tuesday, October 16, 2012 6:01:39 PM UTC+5:30, Manuel Carrasco wrote: Actually gwt RPC uses requestbuilder as its low-level transport, so cors works with rpc without any problem. Here you have an example of cors with gwt rpc. - In the client side you have to change the RPC service url GreetingServiceAsync greetingService = GWT.create(GreetingService.** class); ((ServiceDefTarget)**greetingService).**setServiceEntryPoint(http://** localhost:/mymodule/greet http://localhost:/mymodule/greet**); - In the server side configure a filter in your web.xml filter filter-namecorsFilter/**filter-name filter-classcom.example.**server.CORSFilter/filter-**class /filter filter-mapping filter-namecorsFilter/**filter-name url-pattern/*/url-pattern /filter-mapping - And this is an example of filter, maybe you should set any kind of security based on the Origin header package com.example.server; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.**ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import javax.servlet.http.**HttpServletRequest; import javax.servlet.http.**HttpServletResponse; public class CORSFilter implements Filter { public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { HttpServletRequest req = (HttpServletRequest) servletRequest; HttpServletResponse resp = (HttpServletResponse) servletResponse; String o = req.getHeader(Origin); if (options.equalsIgnoreCase(**req.getMethod())) { resp.setHeader(Allow, GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS); if (o != null) { resp.addHeader(Access-**Control-Allow-Origin, o); resp.addHeader(Access-**Control-Allow-Methods, POST, GET, OPTIONS); resp.addHeader(Access-**Control-Allow-Headers, content-type,pageurl,x-gwt-**permutation,x-gwt-module-base* *); resp.setContentType(text/**plain); } resp.getWriter().flush(); return; } if (o != null) { resp.addHeader(Access-**Control-Allow-Origin, o); } if (filterChain != null) { filterChain.doFilter(req, resp); } } @Override public void destroy() { } @Override public void init(FilterConfig arg0) throws ServletException { } } The server part works with RPC, RF, RequestBuilder, gwtquery-ajax and any other js approach. - Manolo On Tue, Oct 16, 2012 at 9:01 AM, Thomas Broyer t.br...@gmail.com wrote: On Tuesday, October 16, 2012 8:58:49 AM UTC+2, Manikanda raj S wrote: CORS don't work with GWT Servlets, only with RequestBuilder. There's no reason it wouldn't work. What did you try? -- 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/-/**6FgCPqIoH6QJhttps://groups.google.com/d/msg/google-web-toolkit/-/6FgCPqIoH6QJ . To post to this group, send email to google-we...@**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=enhttp://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 view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/NrwwZIdQSVQJ. 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
Re: GWT Serialization
On Tuesday, October 16, 2012 3:36:44 PM UTC+2, Manikanda raj S wrote: Thanks for the Code Manolo. But i would also like to separate the code as of now into GWT Client part as one and Servlet Part as other. This is not a problem, provided the shared classes (RPC interfaces and the objects sent over the wire) are available to both projects (either one depends on the other, or you create a third project for shared code; see https://github.com/tbroyer/gwt-maven-archetypes for examples) One more thing i want GWT Serialization externalized is, if we can have it externalized, then we can probably use the same for Android Development too. This is a Bad Idea™. GWT-RPC is meant to be consumed by clients that are built from the exact same source as the server. That works well for online webapps, where deploying a new version is a no-brainer. For installed clients and offline webapps, it doesn't work well, as you cannot be sure when your clients will be updated to the latest version; and running several serialization policies in the server is not always possible. This is one of the reasons RequestFactory was created. Your interfaces (RequestContexts and proxies) define a contract between the clients and the server (add to that the serialization format and you have a protocol). The contract can change slightly on the server side without necessarily breaking the clients (new service methods or new properties simply won't be used by older clients). If we can convert the same to Objective C,we can use it for IPhone too. J2ObjC for the win! http://code.google.com/p/j2objc/ But I'm afraid it won't work for RequestFactory either (on the other hand, you have a stable protocol, so you can implement it in ObjC). If you run on AppEngine, you might want to have a look at Google Cloud Endpoints. -- 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/-/Qb7gXFz2resJ. 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
Correct me if I am wrong. You have a GWT application up and running on your application server (jetty, tomcat, or similar) and now you want to move your compiled app (HTML/Javascript) to an external web server on a different domain/host. To do so you have two options: 1.) Enable CORS on your server using a servlet filter that sits in front of your GWT-RPC server services. Only downside is that CORS does not work with IE6 and IE7 at all and it only works on IE8 / IE9 if you use the XDomainRequest object instead of XMLHttpRequest. Not sure if GWT's RequestBuilder (that is used by GWT-RPC internally) already handles this (http://caniuse.com/#search=CORS) 2.) Most likely you can configure the external web server to proxy specific URL requests to your server. That means when your GWT app makes a GWT-RPC request to http://customerdomain.com/app/service , the web server can internally redirect the request to http://yourserver.com/app/service. In that case you don't need CORS because your GWT client side app doesn't even know that the data comes from your server. If you want 3rd party developers, Android/iPhone apps accessing your server, you should really think about *adding a new API* to your server that does not depend on GWT. Your GWT app can still use GWT-RPC so you dont have to rewrite it. A common way to do so ist to provide *an additional REST API using JSON/XML* that can easily be used by different non-GWT clients. That way you don't have to rewrite all the GWT serialization code for your non-GWT clients (Android/iPhone) and you don't have any trouble if you want to upgrade your GWT app to a newer GWT version (this could break GWT serialization of non-GWT clients if GWT internals have changed and your GWT serialization library, in lets say Objective-C, does not reflect these changes yet. So you need to update these non-GWT apps as well. You dont want that.). Personally I found flatpack-java promising (https://github.com/perka/flatpack-java). Hope this helps and I have understood you correctly. -- 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/-/9DI6dJ2CYbkJ. 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
Thanks Guys, it's been really a lot of help here. I will definitely try these things. On Tuesday, October 16, 2012 8:20:02 PM UTC+5:30, Jens wrote: Correct me if I am wrong. You have a GWT application up and running on your application server (jetty, tomcat, or similar) and now you want to move your compiled app (HTML/Javascript) to an external web server on a different domain/host. To do so you have two options: 1.) Enable CORS on your server using a servlet filter that sits in front of your GWT-RPC server services. Only downside is that CORS does not work with IE6 and IE7 at all and it only works on IE8 / IE9 if you use the XDomainRequest object instead of XMLHttpRequest. Not sure if GWT's RequestBuilder (that is used by GWT-RPC internally) already handles this ( http://caniuse.com/#search=CORS) 2.) Most likely you can configure the external web server to proxy specific URL requests to your server. That means when your GWT app makes a GWT-RPC request to http://customerdomain.com/app/service , the web server can internally redirect the request to http://yourserver.com/app/service. In that case you don't need CORS because your GWT client side app doesn't even know that the data comes from your server. If you want 3rd party developers, Android/iPhone apps accessing your server, you should really think about *adding a new API* to your server that does not depend on GWT. Your GWT app can still use GWT-RPC so you dont have to rewrite it. A common way to do so ist to provide *an additional REST API using JSON/XML* that can easily be used by different non-GWT clients. That way you don't have to rewrite all the GWT serialization code for your non-GWT clients (Android/iPhone) and you don't have any trouble if you want to upgrade your GWT app to a newer GWT version (this could break GWT serialization of non-GWT clients if GWT internals have changed and your GWT serialization library, in lets say Objective-C, does not reflect these changes yet. So you need to update these non-GWT apps as well. You dont want that.). Personally I found flatpack-java promising ( https://github.com/perka/flatpack-java). Hope this helps and I have understood you correctly. -- 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/-/cQtKHVKCAr8J. 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
What you want is easy to do using requestbuilder + autobeans. Autobeans are thought to handle json string representations and convert them to javaobjects, they work in server and client sides and are full testable. http://code.google.com/p/gwt-autobean-binding/ http://code.google.com/p/google-web-toolkit/wiki/AutoBean Another option I use very often in client side because of its simplicity and performance is gwtquery ajax + json-databinding http://code.google.com/p/gwtquery/wiki/Ajax http://code.google.com/p/gwtquery/wiki/DataBinding In both cases you can use any json backend. - Manolo On Sat, Oct 13, 2012 at 12:35 PM, Manikanda raj S slsm...@gmail.com wrote: I'm using GWT RPC Calls for Server Side Request so far and it's pretty good. I'm planning on separating my Code into Servlets and GWT Client Side. Since i'm using RPC calls, it seems impossible. The Reason i want to do like this is , i'm planning to provide white labeling option for my App. So if i could separate the code to client code and servlets, i can simply provide the White Labeled client code to my Partners to host on their server. I have checked with GWT RequestBuilder and 'Access-Control Allow-Origin : Origin from Client Header' and it works fine. However i need to implement gwt-serialization over RequestBuilder request and Servlet Responses. How can i do this ..? Things I like to make: - RequestBuilder sending Serializable String(Which is a * IsSerialiazible* object) to Servlet. - Servlet deserializes the String to Java Object,Processes and Returns the String Response of a '*IsSerialiazable*' (Another) Object. - The Response String received in GWT RequestBuilder deseriailizes it back to a Java Object(JS after Compiling). -- 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/-/ZNwK3SwtKOUJ. 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 Serialization
Hi Manolo, Thanks for the links. But i have been using GWT RPC in my Application for quite some time and it would be a pretty big work to migrate all those from GWT-RPC Serialization to Autobeans or json databinding. That's why i specifically asked for GWT Serialization externally. Any ideas on Externalized GWT Serialization ..? On Monday, 15 October 2012 12:35:49 UTC+5:30, Manuel Carrasco wrote: What you want is easy to do using requestbuilder + autobeans. Autobeans are thought to handle json string representations and convert them to javaobjects, they work in server and client sides and are full testable. http://code.google.com/p/gwt-autobean-binding/ http://code.google.com/p/google-web-toolkit/wiki/AutoBean Another option I use very often in client side because of its simplicity and performance is gwtquery ajax + json-databinding http://code.google.com/p/gwtquery/wiki/Ajax http://code.google.com/p/gwtquery/wiki/DataBinding In both cases you can use any json backend. - Manolo On Sat, Oct 13, 2012 at 12:35 PM, Manikanda raj S sls...@gmail.comjavascript: wrote: I'm using GWT RPC Calls for Server Side Request so far and it's pretty good. I'm planning on separating my Code into Servlets and GWT Client Side. Since i'm using RPC calls, it seems impossible. The Reason i want to do like this is , i'm planning to provide white labeling option for my App. So if i could separate the code to client code and servlets, i can simply provide the White Labeled client code to my Partners to host on their server. I have checked with GWT RequestBuilder and 'Access-Control Allow-Origin : Origin from Client Header' and it works fine. However i need to implement gwt-serialization over RequestBuilder request and Servlet Responses. How can i do this ..? Things I like to make: - RequestBuilder sending Serializable String(Which is a * IsSerialiazible* object) to Servlet. - Servlet deserializes the String to Java Object,Processes and Returns the String Response of a '*IsSerialiazable*' (Another) Object. - The Response String received in GWT RequestBuilder deseriailizes it back to a Java Object(JS after Compiling). -- 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/-/ZNwK3SwtKOUJ. To post to this group, send email to google-we...@googlegroups.comjavascript: . To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com javascript:. 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 view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Pfw2FLUTfxoJ. 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
So, I dont follow you. If you want to generate serialized strings in server side, you have to maintain the dependence with gwt rpc there, so why dont continuing using rpc-servlets, actually they serialize/deserialize to strings, and the same in the client side. As you say CORS works well with RPC. What is the goal of replacing gwt-rpc servlets by your own ones, or to use directly requestbuilder ? On Mon, Oct 15, 2012 at 8:35 PM, Manikanda raj S slsm...@gmail.com wrote: Hi Manolo, Thanks for the links. But i have been using GWT RPC in my Application for quite some time and it would be a pretty big work to migrate all those from GWT-RPC Serialization to Autobeans or json databinding. That's why i specifically asked for GWT Serialization externally. Any ideas on Externalized GWT Serialization ..? On Monday, 15 October 2012 12:35:49 UTC+5:30, Manuel Carrasco wrote: What you want is easy to do using requestbuilder + autobeans. Autobeans are thought to handle json string representations and convert them to javaobjects, they work in server and client sides and are full testable. http://code.google.com/p/gwt-**autobean-binding/http://code.google.com/p/gwt-autobean-binding/ http://code.google.com/p/**google-web-toolkit/wiki/**AutoBeanhttp://code.google.com/p/google-web-toolkit/wiki/AutoBean Another option I use very often in client side because of its simplicity and performance is gwtquery ajax + json-databinding http://code.google.com/p/**gwtquery/wiki/Ajaxhttp://code.google.com/p/gwtquery/wiki/Ajax http://code.google.com/p/**gwtquery/wiki/DataBindinghttp://code.google.com/p/gwtquery/wiki/DataBinding In both cases you can use any json backend. - Manolo On Sat, Oct 13, 2012 at 12:35 PM, Manikanda raj S sls...@gmail.comwrote: I'm using GWT RPC Calls for Server Side Request so far and it's pretty good. I'm planning on separating my Code into Servlets and GWT Client Side. Since i'm using RPC calls, it seems impossible. The Reason i want to do like this is , i'm planning to provide white labeling option for my App. So if i could separate the code to client code and servlets, i can simply provide the White Labeled client code to my Partners to host on their server. I have checked with GWT RequestBuilder and 'Access-Control Allow-Origin : Origin from Client Header' and it works fine. However i need to implement gwt-serialization over RequestBuilder request and Servlet Responses. How can i do this ..? Things I like to make: - RequestBuilder sending Serializable String(Which is a * IsSerialiazible* object) to Servlet. - Servlet deserializes the String to Java Object,Processes and Returns the String Response of a '*IsSerialiazable*' (Another) Object. - The Response String received in GWT RequestBuilder deseriailizes it back to a Java Object(JS after Compiling). -- 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/-/**ZNwK3SwtKOUJhttps://groups.google.com/d/msg/google-web-toolkit/-/ZNwK3SwtKOUJ . To post to this group, send email to google-we...@**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=enhttp://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 view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Pfw2FLUTfxoJ. 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.
GWT Serialization
I'm using GWT RPC Calls for Server Side Request so far and it's pretty good. I'm planning on separating my Code into Servlets and GWT Client Side. Since i'm using RPC calls, it seems impossible. The Reason i want to do like this is , i'm planning to provide white labeling option for my App. So if i could separate the code to client code and servlets, i can simply provide the White Labeled client code to my Partners to host on their server. I have checked with GWT RequestBuilder and 'Access-Control Allow-Origin : Origin from Client Header' and it works fine. However i need to implement gwt-serialization over RequestBuilder request and Servlet Responses. How can i do this ..? Things I like to make: - RequestBuilder sending Serializable String(Which is a *IsSerialiazible*object) to Servlet. - Servlet deserializes the String to Java Object,Processes and Returns the String Response of a '*IsSerialiazable*' (Another) Object. - The Response String received in GWT RequestBuilder deseriailizes it back to a Java Object(JS after Compiling). -- 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/-/ZNwK3SwtKOUJ. 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.
Problems with GWT serialization logic (in a case of RPC)
Hello! Most recently, I encountered a rather strange situation. The problem lies in the fact that GWT refuses to serialize the parent class of my DTO-entity, despite the fact that the main object he successfully serialize and then adds it to the whitelist RPC. Because of this, obviously, some of the fields emitted essentially because reflective getDeclaredFields() is invoked only for a main class, and a parent class for some reason considered as banned. Trying to solve this problem, I came to the decision only on the server side by writing custom serialization policy, and then everything was seemingly normal. But then, suddenly, another problem, namely the difference between the CRC meta-data on the client and server as a client of the fields were still not included. And now I'm a little confused what to do next and where to look for the solution The project structure is as follows: Framework - persistence - Peristence.gwt.xml Project - domain - Domain.gwt.xml - Persistence.gwt.xml web - App.gwt.xml - domain The assembly is carried out through the Maven GWT. P.S 1. Using AbstractDTO as return value for a method of service does not lead to visible improvements 2. All depending on the module are specified correctly (compileArtifactSource/) 3. All dependencies are published as a source-jars, and they certainly have needed to compile the entity. 4. At first I thought that the problem is due to the indirect dependence web of the persistence, but the direct addition of the latter as inherits - did not help. 5. All entities are Serializable 6. Implement IsSerializable for AbstractDTO - not an option, because persistence does not need to know about GWT Subject entities have a structure like the next one: == Entity - JPA entity (provides as a super-source/ item) persistence module interface IDTO extends Entity, Serializable { public Long getId(); public void setId( Long id ); } public abstract class AbstractDTO extends IDTO { private Long id; public void setId( Long id ) { this.id = id; } public Long getId() { return this.id; } } File: *Persistence.gwt.xml* module source path=persistence/ /module /persistence module domain module public interface ICategoryDTO extends IDTO { public String getName(); public void setName( String name ); } public class CategoryDAO extends AbstractDTO implements ICategoryDTO { private String name; public void setName( String name ) { this.name = name; } public String getName() { return this.name; } } File: *Domain.gwt.xml* module inherits name=com.somename.Persistence / source path=persistence/ /module /domain module web module @RemoteServiceRelativePath(../rpc/main.do) public interface ApplicationAccessService extends RemoteService { public AbstractDTO loadCategories(); } File: *Web.gwt.xml* module rename-to=Application inherits name='com.google.gwt.user.User' / inherits name=com.google.gwt.rpc.RPC/ inherits name='com.google.gwt.inject.Inject'/ inherits name=com.somename.Domain/ !-- Specify the app entry point class. -- entry-point class='com.somename.Application' / source path=client/ source path='service'/ super-source path=client/jre/ /module /web module == Guys, help me, please! Thanks! Cyril. -- 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 error with HTML String content
Joseph, In this case I'm just trying to send some HTML to the server so it can be saved as a log file for the user, but the issue here really has nothing to do with HTML, it is due to new line characters in the string...could be any string. I found and fixed the problem. It was due to some Atmosphere comet code that assumed the string would not have any new line chars...all is working now with that fixed. -Dave On May 1, 8:17 am, Joseph Lust lifeofl...@gmail.com wrote: Dave, I know this is not exactly the answer you're looking for, but why are you trying to serialize and send HTML over the wire like that? Why not use a Uibinder to build that HTML and just send the dynamic part over the wire, which is Apr 30 2012 15:11:33? This is how such work is typically done. Further, you just need to send a date object, so you can leave the formatting to the UiBinder on the clientside as well. I hope that helps as HTML is not typically parroted like that in GWT. Sincerely, Joseph -- 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 error with HTML String content
Touche, glad you got it sorted. I'll be on the lookout for newline characters in the future. 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/-/G4fm6MoVJ-YJ. 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 unit test GWT serialization?
I don't think you need to unit test GWT serialization since it's apart of GWT framework. you need to test you usage of the framework not the framework itself On Tuesday, 1 May 2012 05:10:07 UTC+3, dhoffer wrote: I'd like to write a unit test to test GWT serialization, any pointers on how to setup a unit test that would allow me to pass a variety of data structures from the client to the server and compare results? Is this even possible? -- 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/-/QEYW8I1dokoJ. 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 error with HTML String content
Dave, I know this is not exactly the answer you're looking for, but why are you trying to serialize and send HTML over the wire like that? Why not use a Uibinder to build that HTML and just send the dynamic part over the wire, which is Apr 30 2012 15:11:33? This is how such work is typically done. Further, you just need to send a date object, so you can leave the formatting to the UiBinder on the clientside as well. I hope that helps as HTML is not typically parroted like that in GWT. 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/-/hSwm6Mm9BGIJ. 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 unit test GWT serialization?
dhoffer, You can just test the Async callback as a whole. That should hit the serialization/deserialization calls. See the Google documentation of this process: https://developers.google.com/web-toolkit/doc/latest/DevGuideTesting#DevGuideAsynchronousTesting 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/-/zHO1Zi63KNAJ. 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 error with HTML String content
Using GWT 2.4. I'm trying to track down the root cause of this...not sure if I'm doing something wrong or this is a bug someplace. 30 Apr 2012 13:54:48,953 ERROR AtmosphereHandler []: Failed to deserialize message com.google.gwt.user.client.rpc.SerializationException: Too few tokens in RPC request at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java: 809) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserializeStringTable(ServerSerializationStreamReader.java: 735) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.prepareToRead(ServerSerializationStreamReader.java: 449) at org.atmosphere.gwt.server.AtmosphereGwtHandler.deserialize(AtmosphereGwtHandler.java: 283) at ipt.tas.chatdashboard.ui.gwt.server.AtmosphereHandler.deserialize(AtmosphereHandler.java: 68) at org.atmosphere.gwt.server.AtmosphereGwtHandler.doServerMessage(AtmosphereGwtHandler.java: 237) at org.atmosphere.gwt.server.AtmosphereGwtHandler.onRequest(AtmosphereGwtHandler.java: 183) at org.atmosphere.cpr.AsynchronousProcessor.action(AsynchronousProcessor.java: 217) at org.atmosphere.cpr.AsynchronousProcessor.suspended(AsynchronousProcessor.java: 166) at org.atmosphere.container.JettyCometSupport.service(JettyCometSupport.java: 99) at org.atmosphere.cpr.AtmosphereFramework.doCometSupport(AtmosphereFramework.java: 1162) at org.atmosphere.cpr.AtmosphereServlet.doPost(AtmosphereServlet.java: 293) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java: 362) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java: 216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java: 181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java: 729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java: 49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java: 152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java: 505) at org.mortbay.jetty.HttpConnection $RequestHandler.content(HttpConnection.java:843) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java: 211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java: 380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java: 395) at org.mortbay.thread.QueuedThreadPool $PoolThread.run(QueuedThreadPool.java:488) Caused by: java.lang.IndexOutOfBoundsException: Index: 11, Size: 11 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.extract(ServerSerializationStreamReader.java: 807) ... 30 more This happens when I send the following HTML as a string to the Atmosphere comet framework but that framework just seems to pass this to GWT's ClientSerializationStreamWriter ServerSerializationStreamReader. Here is the string that fails: div style=font-family: Arial; font-size: 10pt;div class=chatline style=text-indent:-10px; margin-left:10px;span class=timestamp-self style=color:#FF;(Apr 30 2012 15:11:33) / spanspan class=from-self style=color:#FF;tom: /spanspan class=messagea/span/div /div But this string works fine with same method: div style=font-family: Arial; font-size: 10pt;/div What's going on here? Is there some known restrictions sending HTML with GWT serialization? How to fix this? -Dave -- 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 unit test GWT serialization?
I'd like to write a unit test to test GWT serialization, any pointers on how to setup a unit test that would allow me to pass a variety of data structures from the client to the server and compare results? Is this even possible? -- 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 SERIALIZATION PROBLEM
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
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.
Explicitly access GWT serialization logic
I have a class which implements Serializable and GWT knows how to send objects over RPC. But I want to GET such an object from a Servlet (in order to allow browser caching). Is there any way to explicitly access GWT's underlying ability to serialize/unserialize my objects (and the same on the server) even if I am sending the object using a Servlet GET rather than RPC? 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: Explicitly access GWT serialization logic
Yes; see http://jectbd.com/?p=1174 (I haven't digged into the code, but that one recipe requires you have a RemoteService interface and implementing class) -- 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/-/INs580B9MSwJ. 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.
Eclipse ann GWT serialization
I currently have an issue when trying to run hosted mode through eclipse where the serialization policy filename is different to the compiled version. Also I have noticed that a new compile or a page refresh during hosted causes a new policy file to be created again with a different filename despite no changes being made to any of the source code. This makes trying to debug my application impossible wherever an RPC call is made, can anybody point me at areas to look at to try rectifying this? -- 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: Eclipse ann GWT serialization
I'm no expert by any means, but I recall having some issue with policy when Eclipse used JDK 7 for compilation and running development mode. After I configured it to use Java 1.6, everything went fine. --Markus 2011/11/3 Steve Parker pizak...@gmail.com: I currently have an issue when trying to run hosted mode through eclipse where the serialization policy filename is different to the compiled version. Also I have noticed that a new compile or a page refresh during hosted causes a new policy file to be created again with a different filename despite no changes being made to any of the source code. This makes trying to debug my application impossible wherever an RPC call is made, can anybody point me at areas to look at to try rectifying this? -- 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.
GWT Serialization--Default Constructor Presence
I noticed that all the Model classes which need to implement 'Serializable' interface need to have a default constructor in order to work properly. The Serialization otherwise fails. Why is it so? -- 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--Default Constructor Presence
Since reflection is used to instantiate the classes with something like SerializedType.newInstance() , the default constructor has to be present. If the mechanism would allow for instantiation using non- default constructor, that would have required more configuration in your code and also that would mean that the constructor argument values would have to be transfered on the wire outside the instance, also complicating things up. On May 24, 9:42 am, Nitish Upreti nitishupr...@gmail.com wrote: I noticed that all the Model classes which need to implement 'Serializable' interface need to have a default constructor in order to work properly. The Serialization otherwise fails. Why is it so? -- 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: Is gwt serialization backward compatible ?
any ideas or advises ? On 23 mar, 14:04, Kroc vincent.legen...@gmail.com wrote: I've serialized data with standard java way into files and database. As I'm dicovering RPC.encodeResponseForSuccess to inject data in web pages, I wondered to know if it's safe to store GWT serialized data into files and blobs for future use (either on client and server side) ? And if yes, is gwt (de)serialization procedure slower than stadard java serialization ? -- 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: Is gwt serialization backward compatible ?
I would not recommend either use GWT serialization or JVM serialization to store in a file, it isn't the main purpose. First, don't trust that GWT never change Serialization method in the future. Second, JVM serialization use serialversionuid to check if the .class is compatible and the version of JVM (a class serializate with 1.5 is not compatible with 1.6). I recomend use XML o JSON to store class. There are a lots of frameworks around to do this job. Juan 2011/3/24 Kroc vincent.legen...@gmail.com any ideas or advises ? On 23 mar, 14:04, Kroc vincent.legen...@gmail.com wrote: I've serialized data with standard java way into files and database. As I'm dicovering RPC.encodeResponseForSuccess to inject data in web pages, I wondered to know if it's safe to store GWT serialized data into files and blobs for future use (either on client and server side) ? And if yes, is gwt (de)serialization procedure slower than stadard java serialization ? -- 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.
Is gwt serialization backward compatible ?
I've serialized data with standard java way into files and database. As I'm dicovering RPC.encodeResponseForSuccess to inject data in web pages, I wondered to know if it's safe to store GWT serialized data into files and blobs for future use (either on client and server side) ? And if yes, is gwt (de)serialization procedure slower than stadard java serialization ? -- 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.
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.
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.
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.
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.
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.
Re: GWT serialization
no answer since 1 week!!! need help for the first stage of the project namely generation an xml template from GUI written in GWT Thanks On 13 oct, 10:18, MAM mersni.am...@gmail.com wrote: hi, i have to develop a tool based on GWT using the same mechanism that you have already mention (serialize/deserialize) GWT objects from/ toXMLfile: briefly, the tool will be able to serialize a GUI written in GWT (in input) intoXML/JSON (preferablyXML) file , and perform the reverse: read the createdXMLfile (template) and reconstruct the GUI. I'm newbie with GWT , so any idea will be welcome concerning the type of tool i can develop and tools, tutorials, library that seem useful Thanks On 17 août, 13:30, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybeXML/JSON or anything really. Then save that serialized object as axml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-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: GWT serialization
hi, i have to develop a tool based on GWT using the same mechanism that you have already mention (serialize/deserialize) GWT objects from/ to XML file: briefly, the tool will be able to serialize a GUI written in GWT (in input) into XML/JSON (preferably XML) file , and perform the reverse: read the created XML file (template) and reconstruct the GUI. I'm newbie with GWT , so any idea will be welcome concerning the type of tool i can develop and tools, tutorials, library that seem useful Thanks On 17 août, 13:30, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybeXML/JSON or anything really. Then save that serialized object as axml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-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: GWT serialization
I agree: Of course the GWT serialization is the most straightforward way for the communication. And I would recommend to use it as long as you don't have any special requirements. When you have one client and one server there's no reason for using XML or JSON. But as soon your client isn't the only one and you want to offer some kind of REST interface, XML and/or JSON definitely make sense. Then frameworks like Piriti or Acris (http://code.google.com/p/acris/wiki/ GWTJsonizer) can take care of mapping the XML / JSON to the client side POJOs. - Harald On 25 Aug., 17:44, dolcra...@gmail.com dolcra...@gmail.com wrote: I concur, seems like they're trying to overcomplicate it. Unless it requires either JSON or XML, but the OP did say theserialization format didn't matter. I would suggest GWT-RPCserializationas it is probably the easiest to setup. Then you just need to go to/from java objects to xml on the server side for storage. On Aug 25, 10:46 am, Brett Thomas brettptho...@gmail.com wrote: I just started with GWT so may be missing something - but why not just use the default GWTserializationby having the object implement IsSerializable. I've never done this, just remember reading about it. The source code from this tutorial looks helpfulhttp://developerlife.com/tutorials/?p=131 On Wed, Aug 25, 2010 at 10:33 AM, Harald Pehl harald.p...@googlemail.comwrote: The JSONserializationis only in the trunk and not yet available as downloadable version. As soon as I finished the documentation for it, there will be a new version in the downloads. In the meantime feel free to checkout the sources and build by yourself. You can take a look at the following unit tests to get a feeling of how the serializationworks: http://code.google.com/p/piriti/source/browse/trunk/core/src/test/jav... http://code.google.com/p/piriti/source/browse/trunk/core/src/test/jav... http://code.google.com/p/piriti/source/browse/trunk/core/src/test/jav... - Harald On 25 Aug., 15:00, Ciarán ciaran.mccann@gmail.com wrote: I have looked into pirtiy before and messed around with code, but it only seems to be go one way. JSON string to objects and not the other way around which is what I need. I have looked at ton's of librarys On Aug 18, 1:24 pm, Peter Simun si...@seges.sk wrote: pirity is the answer :)http://code.google.com/p/piriti/ You can serialize your object into XML/JSON and save the serialized object on the server. Peter On 17. Aug, 16:48 h., Ciarán ciaran.mccann@gmail.com wrote: Thanks for the reply. I am quite familiar with XML parsers, I used them in the past. Though in this situation its not suitable as inherited class most always work without having to define the added properties in the parsing. I need to serialize objects into some kind of file, save it and restore it at a later date. Thanks again On Aug 17, 2:21 pm, aditya sanas 007aditya.b...@gmail.com wrote: Hi The basic requirement for you is to deal with XML file So we have jxl.jar which provides APIs to interact with tags and elements in xml so using these API's that are generally known as XML parsers that is SAX or DOC parsers. so use by using these parsers you will be able to deal with XML files. It wont be that difficult for you once you learn how to use these parsers. You will need external jar file jxl.jar -- Aditya On Tue, Aug 17, 2010 at 6:00 PM, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@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
GWT serialization with fine-grained control
Hi all I have this DTO that i use in my GWT RPCs but also in other parts of my application. I had to improve the (java) serialization performance and now this class implements externalizable. In my serialization methods i use GzipStream to compress and uncompress the serialzed strem. I know that this custom serialization is not used in in GWT serialization, however now i cant GWT compile this class due to the Gzip imports. My question is: there is any solution to be able to continue using this class in GWT RPC by excluding the new methods from GWT compilation? Thanks João Ferreira -- 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: GWT serialization with fine-grained control
No, there's no way to mark only part of a class for server-side. You can use different versions of a class in the client and server by using the super-source technique though. That would mean having two different implementations of the same class. João Ferreira wrote: Hi all I have this DTO that i use in my GWT RPCs but also in other parts of my application. I had to improve the (java) serialization performance and now this class implements externalizable. In my serialization methods i use GzipStream to compress and uncompress the serialzed strem. I know that this custom serialization is not used in in GWT serialization, however now i cant GWT compile this class due to the Gzip imports. My question is: there is any solution to be able to continue using this class in GWT RPC by excluding the new methods from GWT compilation? Thanks João Ferreira -- 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: GWT serialization
I have looked into pirtiy before and messed around with code, but it only seems to be go one way. JSON string to objects and not the other way around which is what I need. I have looked at ton's of librarys On Aug 18, 1:24 pm, Peter Simun si...@seges.sk wrote: pirity is the answer :)http://code.google.com/p/piriti/ You can serialize your object into XML/JSON and save the serialized object on the server. Peter On 17. Aug, 16:48 h., Ciarán ciaran.mccann@gmail.com wrote: Thanks for the reply. I am quite familiar with XML parsers, I used them in the past. Though in this situation its not suitable as inherited class most always work without having to define the added properties in the parsing. I need to serialize objects into some kind of file, save it and restore it at a later date. Thanks again On Aug 17, 2:21 pm, aditya sanas 007aditya.b...@gmail.com wrote: Hi The basic requirement for you is to deal with XML file So we have jxl.jar which provides APIs to interact with tags and elements in xml so using these API's that are generally known as XML parsers that is SAX or DOC parsers. so use by using these parsers you will be able to deal with XML files. It wont be that difficult for you once you learn how to use these parsers. You will need external jar file jxl.jar -- Aditya On Tue, Aug 17, 2010 at 6:00 PM, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@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: GWT serialization
The JSON serialization is only in the trunk and not yet available as downloadable version. As soon as I finished the documentation for it, there will be a new version in the downloads. In the meantime feel free to checkout the sources and build by yourself. You can take a look at the following unit tests to get a feeling of how the serialization works: http://code.google.com/p/piriti/source/browse/trunk/core/src/test/java/name/pehl/piriti/client/gwttest/animal/JsonAnimalTest.java http://code.google.com/p/piriti/source/browse/trunk/core/src/test/java/name/pehl/piriti/client/gwttest/book/JsonBookTest.java http://code.google.com/p/piriti/source/browse/trunk/core/src/test/java/name/pehl/piriti/client/gwttest/simple/JsonAmoebaWriterTest.java - Harald On 25 Aug., 15:00, Ciarán ciaran.mccann@gmail.com wrote: I have looked into pirtiy before and messed around with code, but it only seems to be go one way. JSON string to objects and not the other way around which is what I need. I have looked at ton's of librarys On Aug 18, 1:24 pm, Peter Simun si...@seges.sk wrote: pirity is the answer :)http://code.google.com/p/piriti/ You can serialize your object into XML/JSON and save the serialized object on the server. Peter On 17. Aug, 16:48 h., Ciarán ciaran.mccann@gmail.com wrote: Thanks for the reply. I am quite familiar with XML parsers, I used them in the past. Though in this situation its not suitable as inherited class most always work without having to define the added properties in the parsing. I need to serialize objects into some kind of file, save it and restore it at a later date. Thanks again On Aug 17, 2:21 pm, aditya sanas 007aditya.b...@gmail.com wrote: Hi The basic requirement for you is to deal with XML file So we have jxl.jar which provides APIs to interact with tags and elements in xml so using these API's that are generally known as XML parsers that is SAX or DOC parsers. so use by using these parsers you will be able to deal with XML files. It wont be that difficult for you once you learn how to use these parsers. You will need external jar file jxl.jar -- Aditya On Tue, Aug 17, 2010 at 6:00 PM, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@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: GWT serialization
I just started with GWT so may be missing something - but why not just use the default GWT serialization by having the object implement IsSerializable. I've never done this, just remember reading about it. The source code from this tutorial looks helpful http://developerlife.com/tutorials/?p=131 On Wed, Aug 25, 2010 at 10:33 AM, Harald Pehl harald.p...@googlemail.comwrote: The JSON serialization is only in the trunk and not yet available as downloadable version. As soon as I finished the documentation for it, there will be a new version in the downloads. In the meantime feel free to checkout the sources and build by yourself. You can take a look at the following unit tests to get a feeling of how the serialization works: http://code.google.com/p/piriti/source/browse/trunk/core/src/test/java/name/pehl/piriti/client/gwttest/animal/JsonAnimalTest.java http://code.google.com/p/piriti/source/browse/trunk/core/src/test/java/name/pehl/piriti/client/gwttest/book/JsonBookTest.java http://code.google.com/p/piriti/source/browse/trunk/core/src/test/java/name/pehl/piriti/client/gwttest/simple/JsonAmoebaWriterTest.java - Harald On 25 Aug., 15:00, Ciarán ciaran.mccann@gmail.com wrote: I have looked into pirtiy before and messed around with code, but it only seems to be go one way. JSON string to objects and not the other way around which is what I need. I have looked at ton's of librarys On Aug 18, 1:24 pm, Peter Simun si...@seges.sk wrote: pirity is the answer :)http://code.google.com/p/piriti/ You can serialize your object into XML/JSON and save the serialized object on the server. Peter On 17. Aug, 16:48 h., Ciarán ciaran.mccann@gmail.com wrote: Thanks for the reply. I am quite familiar with XML parsers, I used them in the past. Though in this situation its not suitable as inherited class most always work without having to define the added properties in the parsing. I need to serialize objects into some kind of file, save it and restore it at a later date. Thanks again On Aug 17, 2:21 pm, aditya sanas 007aditya.b...@gmail.com wrote: Hi The basic requirement for you is to deal with XML file So we have jxl.jar which provides APIs to interact with tags and elements in xml so using these API's that are generally known as XML parsers that is SAX or DOC parsers. so use by using these parsers you will be able to deal with XML files. It wont be that difficult for you once you learn how to use these parsers. You will need external jar file jxl.jar -- Aditya On Tue, Aug 17, 2010 at 6:00 PM, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2bunsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@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.comgoogle-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-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: GWT serialization
I concur, seems like they're trying to overcomplicate it. Unless it requires either JSON or XML, but the OP did say the serialization format didn't matter. I would suggest GWT-RPC serialization as it is probably the easiest to setup. Then you just need to go to/from java objects to xml on the server side for storage. On Aug 25, 10:46 am, Brett Thomas brettptho...@gmail.com wrote: I just started with GWT so may be missing something - but why not just use the default GWT serialization by having the object implement IsSerializable. I've never done this, just remember reading about it. The source code from this tutorial looks helpfulhttp://developerlife.com/tutorials/?p=131 On Wed, Aug 25, 2010 at 10:33 AM, Harald Pehl harald.p...@googlemail.comwrote: The JSON serialization is only in the trunk and not yet available as downloadable version. As soon as I finished the documentation for it, there will be a new version in the downloads. In the meantime feel free to checkout the sources and build by yourself. You can take a look at the following unit tests to get a feeling of how the serialization works: http://code.google.com/p/piriti/source/browse/trunk/core/src/test/jav... http://code.google.com/p/piriti/source/browse/trunk/core/src/test/jav... http://code.google.com/p/piriti/source/browse/trunk/core/src/test/jav... - Harald On 25 Aug., 15:00, Ciarán ciaran.mccann@gmail.com wrote: I have looked into pirtiy before and messed around with code, but it only seems to be go one way. JSON string to objects and not the other way around which is what I need. I have looked at ton's of librarys On Aug 18, 1:24 pm, Peter Simun si...@seges.sk wrote: pirity is the answer :)http://code.google.com/p/piriti/ You can serialize your object into XML/JSON and save the serialized object on the server. Peter On 17. Aug, 16:48 h., Ciarán ciaran.mccann@gmail.com wrote: Thanks for the reply. I am quite familiar with XML parsers, I used them in the past. Though in this situation its not suitable as inherited class most always work without having to define the added properties in the parsing. I need to serialize objects into some kind of file, save it and restore it at a later date. Thanks again On Aug 17, 2:21 pm, aditya sanas 007aditya.b...@gmail.com wrote: Hi The basic requirement for you is to deal with XML file So we have jxl.jar which provides APIs to interact with tags and elements in xml so using these API's that are generally known as XML parsers that is SAX or DOC parsers. so use by using these parsers you will be able to deal with XML files. It wont be that difficult for you once you learn how to use these parsers. You will need external jar file jxl.jar -- Aditya On Tue, Aug 17, 2010 at 6:00 PM, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@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.comgoogle-web-toolkit%2Bunsubs cr...@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: GWT serialization
pirity is the answer :) http://code.google.com/p/piriti/ You can serialize your object into XML/JSON and save the serialized object on the server. Peter On 17. Aug, 16:48 h., Ciarán ciaran.mccann@gmail.com wrote: Thanks for the reply. I am quite familiar with XML parsers, I used them in the past. Though in this situation its not suitable as inherited class most always work without having to define the added properties in the parsing. I need to serialize objects into some kind of file, save it and restore it at a later date. Thanks again On Aug 17, 2:21 pm, aditya sanas 007aditya.b...@gmail.com wrote: Hi The basic requirement for you is to deal with XML file So we have jxl.jar which provides APIs to interact with tags and elements in xml so using these API's that are generally known as XML parsers that is SAX or DOC parsers. so use by using these parsers you will be able to deal with XML files. It wont be that difficult for you once you learn how to use these parsers. You will need external jar file jxl.jar -- Aditya On Tue, Aug 17, 2010 at 6:00 PM, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@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: GWT serialization
Right now Piriti just supports serialization into JSON. XML will follow in one of the next releases. In case the whole thing happens on the client consider using html5 offline storage: http://www.w3.org/TR/offline-webapps/ http://code.google.com/p/gwt-mobile-webkit/ - Harald On 18 Aug., 14:24, Peter Simun si...@seges.sk wrote: pirity is the answer :)http://code.google.com/p/piriti/ You can serialize your object into XML/JSON and save the serialized object on the server. Peter On 17. Aug, 16:48 h., Ciarán ciaran.mccann@gmail.com wrote: Thanks for the reply. I am quite familiar with XML parsers, I used them in the past. Though in this situation its not suitable as inherited class most always work without having to define the added properties in the parsing. I need to serialize objects into some kind of file, save it and restore it at a later date. Thanks again On Aug 17, 2:21 pm, aditya sanas 007aditya.b...@gmail.com wrote: Hi The basic requirement for you is to deal with XML file So we have jxl.jar which provides APIs to interact with tags and elements in xml so using these API's that are generally known as XML parsers that is SAX or DOC parsers. so use by using these parsers you will be able to deal with XML files. It wont be that difficult for you once you learn how to use these parsers. You will need external jar file jxl.jar -- Aditya On Tue, Aug 17, 2010 at 6:00 PM, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@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.
GWT serialization
Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-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: GWT serialization
Hi The basic requirement for you is to deal with XML file So we have jxl.jar which provides APIs to interact with tags and elements in xml so using these API's that are generally known as XML parsers that is SAX or DOC parsers. so use by using these parsers you will be able to deal with XML files. It wont be that difficult for you once you learn how to use these parsers. You will need external jar file jxl.jar -- Aditya On Tue, Aug 17, 2010 at 6:00 PM, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-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-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: GWT serialization
Thanks for the reply. I am quite familiar with XML parsers, I used them in the past. Though in this situation its not suitable as inherited class most always work without having to define the added properties in the parsing. I need to serialize objects into some kind of file, save it and restore it at a later date. Thanks again On Aug 17, 2:21 pm, aditya sanas 007aditya.b...@gmail.com wrote: Hi The basic requirement for you is to deal with XML file So we have jxl.jar which provides APIs to interact with tags and elements in xml so using these API's that are generally known as XML parsers that is SAX or DOC parsers. so use by using these parsers you will be able to deal with XML files. It wont be that difficult for you once you learn how to use these parsers. You will need external jar file jxl.jar -- Aditya On Tue, Aug 17, 2010 at 6:00 PM, Ciarán ciaran.mccann@gmail.com wrote: Hi, I am currently working on a GWT app that requires me to serializes an object client side into maybe XML/JSON or anything really. Then save that serialized object as a xml/json/.ser file. Then at a later date read that file and reconstruct my object from it. I have been searching for days for an answer to this, used several external library, read tutorials, GWT documentation and I still not closer to a solution. Am I totally missing something here? It was very easy to do this in plan Java, but GWT I just can seem to get it working. 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-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.comgoogle-web-toolkit%2Bunsubs cr...@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: unit testing GWT serialization
I was hoping for something a little lighter-weight than selenium or GWTTestCase, something I could just run through quickly before check- in's. After playing around with GWT code, I've assembed some code that helps me test scenario #2 (enclosed at end of post), to test if GWT RPC can successfully serialize/deserialize an object at runtime. This is not perfect, but does help me test for some of the nuances that have burned me in the past. For example, this test helps me test that SOME_OBJECT_GWT_CANT_SERIALIZE will fail the checkGwtSerializability() test. public static class SerializableClass implements Serializable{ public void someMethod(){ } } public static SerializableClass SOME_OBJECT_GWT_CANT_SERIALIZE = new SerializableClass(){ @Override public void someMethod(){ // test overriding some method in this class } }; public static void checkGwtSerializability(Object o) throws RuntimeException{ HostedModeClientOracle hmco =new HostedModeClientOracle(); HasValues command = new ReturnCommand(); HasValuesCommandSink hvcs = new HasValuesCommandSink(command); CommandServerSerializationStreamWriter out = new CommandServerSerializationStreamWriter( hmco, hvcs); try { out.writeObject(o); } catch (SerializationException e) { throw new RuntimeException(Object not serializable: + o + Caused by: + e.getMessage(), e); } } On Jul 24, 7:37 am, Uberto Barbini ube...@ubiland.net wrote: Have you tried with gwt unittest? I don't recall exactly, but we wrote some of them but then we decided to remove them from our TDD flux because they were tooking too much time to run. Now we use unittest server side (also for gwt object that doesn't require js compilation) and selenium test for the whole app. cheers Uberto On Sat, Jul 24, 2010 at 3:40 PM, Eric ebatz...@gmail.com wrote: Hi All, Has anyone written simple unit tests to test: 1) if a class will go in to the serialization policy file at compile time? and 2) if GWT RPC successfully serializable/deserializable an object at runtime? This has ended up being a fragile part of our application as we fix/ enhance so it would be great to introduce junits to help us prevent regressions in these areas. Thanks!, Eric (This is somewhat of a repeat post, but I rephrased the question since I got no responses on the last post.) -- 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.- 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-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.
unit testing GWT serialization
Hi All, Has anyone written simple unit tests to test: 1) if a class will go in to the serialization policy file at compile time? and 2) if GWT RPC successfully serializable/deserializable an object at runtime? This has ended up being a fragile part of our application as we fix/ enhance so it would be great to introduce junits to help us prevent regressions in these areas. Thanks!, Eric (This is somewhat of a repeat post, but I rephrased the question since I got no responses on the last post.) -- 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: unit testing GWT serialization
Have you tried with gwt unittest? I don't recall exactly, but we wrote some of them but then we decided to remove them from our TDD flux because they were tooking too much time to run. Now we use unittest server side (also for gwt object that doesn't require js compilation) and selenium test for the whole app. cheers Uberto On Sat, Jul 24, 2010 at 3:40 PM, Eric ebatz...@gmail.com wrote: Hi All, Has anyone written simple unit tests to test: 1) if a class will go in to the serialization policy file at compile time? and 2) if GWT RPC successfully serializable/deserializable an object at runtime? This has ended up being a fragile part of our application as we fix/ enhance so it would be great to introduce junits to help us prevent regressions in these areas. Thanks!, Eric (This is somewhat of a repeat post, but I rephrased the question since I got no responses on the last post.) -- 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: real gwt serialization
@Kozura - No, not a constant. A constant is hard-coded data. Instead, you need the ability to dynamically generate data, serialize it and store it in the host jsp. Take a look at this blog post - http://www.techhui.com/profiles/blogs/simpler-and-speedier-gwt-with and a follow-up by folks at Lombardi http://development.lombardi.com/?p=1174. It explains how to achieve this. --Sri On 29 May 2010 09:21, kozura koz...@gmail.com wrote: Sounds like you just want a constant, can you just create the objects as static finals in your client code? No serialization or any such needed, just comes as part of the code. On May 28, 4:38 pm, rjcarr rjc...@gmail.com wrote: So I understand gwt's rpc serialization and I've been using it for quite some time. However, I'm wondering if there is a manual javascript serialization? Let me explain ... Passing things over rpc works great for dynamic data, but what if you have initialization data that doesn't change? Since it is initialization data you want it available when the page loads and not have to worry about timing issues. So, here's what I'm looking for. Say you already have a valid rpc serializable type and you've created an object out of it. I'd like to serialize this to javascript so I can write it directly into my webpage (via php, jsp, etc). Then, something in gwt would be able to reconstitute this into a java object for use with gwt. I know I can write such a thing, and I've done it before, it just seems so close to rpc serialization that it might already be done? -- 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.comgoogle-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-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.
real gwt serialization
So I understand gwt's rpc serialization and I've been using it for quite some time. However, I'm wondering if there is a manual javascript serialization? Let me explain ... Passing things over rpc works great for dynamic data, but what if you have initialization data that doesn't change? Since it is initialization data you want it available when the page loads and not have to worry about timing issues. So, here's what I'm looking for. Say you already have a valid rpc serializable type and you've created an object out of it. I'd like to serialize this to javascript so I can write it directly into my webpage (via php, jsp, etc). Then, something in gwt would be able to reconstitute this into a java object for use with gwt. I know I can write such a thing, and I've done it before, it just seems so close to rpc serialization that it might already be done? -- 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: real gwt serialization
Sounds like you just want a constant, can you just create the objects as static finals in your client code? No serialization or any such needed, just comes as part of the code. On May 28, 4:38 pm, rjcarr rjc...@gmail.com wrote: So I understand gwt's rpc serialization and I've been using it for quite some time. However, I'm wondering if there is a manual javascript serialization? Let me explain ... Passing things over rpc works great for dynamic data, but what if you have initialization data that doesn't change? Since it is initialization data you want it available when the page loads and not have to worry about timing issues. So, here's what I'm looking for. Say you already have a valid rpc serializable type and you've created an object out of it. I'd like to serialize this to javascript so I can write it directly into my webpage (via php, jsp, etc). Then, something in gwt would be able to reconstitute this into a java object for use with gwt. I know I can write such a thing, and I've done it before, it just seems so close to rpc serialization that it might already be done? -- 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.
Persistence based on GAE and GWT serialization
Hi guys, I started experimenting with GAE (Google AppEngine) and I find persistence coding-style beautiful. But, there is the problem with use with GWT, since the annotations import from javax.jdo.annotations package (with obviously is unknown to GWT) and the PersistenceManagerFactory acts very similar to Hibernate's session mechanism (attaching objects returned by a query to the manager). Do you know of any *good* solutions for this matter? I ended up coding a second mirror class (like UserVO which reflects the members of User - at least the ones that are serializable) and a mapping mechanism from persistence classes = VO classes, which is used on server-side when handling RPC objects. While this may work, it increased the code needed by 170% (number taken from 1 persistence class of mine, Greeting + the two additional classes, GreetingVO, GreetingDataObject). Is there a better way than this (like ignoring certain imports)? 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 serialization
Hi all, Thx for all replies.. I have fixed the problem..It caused by the wrong Hibernate Query Language. I try to load the CalonMahasiswa table record which has Fakultas_id and ProgramStudi_id foreign key. In my HQL, I didn't join fetch the Fakultas and ProgramStudi table and it caused the error.. Thx for you all guys! Viva GWT!! Regards, Retha --~--~-~--~~~---~--~~ 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
On Jun 18, 4:29 am, retha pasalli re...@wacana-inti.com wrote: [snip] Can you help me with this error? Have I missed something? When I try to call other object service, it works. But I don't know why it doesn't when I try to call a service contains ProgramStudi object. I don't know why, but the seems to indicate that the ProgramStudi is not listed in the whitelist file (.gwt.rpc), which is generated by the GWT when you compile your module/server. Sure everything went right with the compile, and there were no errors there? Perhaps try a full rebuild? Gert --~--~-~--~~~---~--~~ 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
Can you list the source code of Fakultas.class as well as its dependencies? I think the problem is from Fakultas as well as its dependencies. Jim http://www.gwtorm.com - GWT ORM http://code.google.com/p/dreamsource-orm/ On Jun 18, 3:23 am, gscholt gsch...@gmail.com wrote: On Jun 18, 4:29 am, retha pasalli re...@wacana-inti.com wrote: [snip] Can you help me with this error? Have I missed something? When I try to call other object service, it works. But I don't know why it doesn't when I try to call a service contains ProgramStudi object. I don't know why, but the seems to indicate that the ProgramStudi is not listed in the whitelist file (.gwt.rpc), which is generated by the GWT when you compile your module/server. Sure everything went right with the compile, and there were no errors there? Perhaps try a full rebuild? Gert --~--~-~--~~~---~--~~ 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
Hi, Classic Hibernate entity serialization issue. See here (http://noon.gilead.free.fr/gilead/index.php? page=presentation) for details and solution... Hope this helps Bruno On 18 juin, 14:18, Jim jim.p...@gmail.com wrote: Can you list the source code of Fakultas.class as well as its dependencies? I think the problem is from Fakultas as well as its dependencies. Jimhttp://www.gwtorm.com- GWT ORMhttp://code.google.com/p/dreamsource-orm/ On Jun 18, 3:23 am, gscholt gsch...@gmail.com wrote: On Jun 18, 4:29 am, retha pasalli re...@wacana-inti.com wrote: [snip] Can you help me with this error? Have I missed something? When I try to call other object service, it works. But I don't know why it doesn't when I try to call a service contains ProgramStudi object. I don't know why, but the seems to indicate that the ProgramStudi is not listed in the whitelist file (.gwt.rpc), which is generated by the GWT when you compile your module/server. Sure everything went right with the compile, and there were no errors there? Perhaps try a full rebuild? Gert --~--~-~--~~~---~--~~ 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 serialization
Hi, I meet this error on my gwt project : Jun 18, 2009 8:18:06 AM org.apache.catalina.core.ApplicationContext log 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:696) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl (ServerSerializationStreamWriter.java:659) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize (ServerSerializationStreamWriter.java:593) 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:530) 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: 637) at javax.servlet.http.HttpServlet.service(HttpServlet.java: 717) 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:191) 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:845) 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.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) 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:678) ... 27 more Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'com.wii.integra.domain.ProgramStudi$$EnhancerByCGLIB$$52642e86' 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:591) 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:530) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeClass (ServerSerializationStreamWriter.java:636) at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl (ServerSerializationStreamWriter.java:666) at
Re: GWT Serialization with CustomFieldSerializer fails because of SerializationPolicy
I agree with that, i'm using a generic DTO too with a MapString, Object because i don't want to bother to create an IServiceInterfaceAsync for every RPC method i need. So telling in an annotation to GWT which objects are likely to travel over http would be nice. However if we could provide something more flexible than annotation config, it would be nice. My RPC service is part of my framework, and i don't want to have to modify the API to mark the serializable implemenation DTOs. On 18 avr, 22:35, fvisticot fvisti...@gmail.com wrote: +1, a way to specify Object to serialize would be fine !!! On Apr 17, 10:20 pm, Daniel Kurka kurka.dan...@googlemail.com wrote: this is exactly what i was thinking. we need a way to specify the classes that are okay to serialiaze with the service 2009/4/17 Vitali Lovich vlov...@gmail.com Hasn't been accepted - just opened. Anyone can open issues against GWT. That being said, I think there could be room for improvement. For instance, if you specify a serializable interface or serializable abstract class, you should be allowed to enumerate all the various types that can possibly go across the wire in anannotationso as to provide more contextual information that the compiler simply doesn't otherwise have access to at compile time. @Transfers({A.class, B.class, C.class, D.class}) Serializable foo(Serializable[] x); etc. which limits the compiler to only look at A, B, C, D when it comes across trying to compile this RPC function. This would solve a lot of issues make the expressiveness much more powerful. On Fri, Apr 17, 2009 at 3:18 AM, Salvador Diaz diaz.salva...@gmail.comwrote: Frankly I don't see how that issue could be accepted, the fact that you have to mark all your serializable objects as Serializable or IsSerializable has been there from the beginning. It's related to the way the compiler has to know at compile time what objects are allowed to travel through RPCs and how they should be serialized. You simply cannot expect it to magically detect the types that will be added to your String, Object map. On Apr 16, 10:14 pm, kurka.dan...@googlemail.com wrote: I added my concerns to this issue in the gwt issue tracker: http://code.google.com/p/google-web-toolkit/issues/detail?id=3521 --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
+1, a way to specify Object to serialize would be fine !!! On Apr 17, 10:20 pm, Daniel Kurka kurka.dan...@googlemail.com wrote: this is exactly what i was thinking. we need a way to specify the classes that are okay to serialiaze with the service 2009/4/17 Vitali Lovich vlov...@gmail.com Hasn't been accepted - just opened. Anyone can open issues against GWT. That being said, I think there could be room for improvement. For instance, if you specify a serializable interface or serializable abstract class, you should be allowed to enumerate all the various types that can possibly go across the wire in an annotation so as to provide more contextual information that the compiler simply doesn't otherwise have access to at compile time. @Transfers({A.class, B.class, C.class, D.class}) Serializable foo(Serializable[] x); etc. which limits the compiler to only look at A, B, C, D when it comes across trying to compile this RPC function. This would solve a lot of issues make the expressiveness much more powerful. On Fri, Apr 17, 2009 at 3:18 AM, Salvador Diaz diaz.salva...@gmail.comwrote: Frankly I don't see how that issue could be accepted, the fact that you have to mark all your serializable objects as Serializable or IsSerializable has been there from the beginning. It's related to the way the compiler has to know at compile time what objects are allowed to travel through RPCs and how they should be serialized. You simply cannot expect it to magically detect the types that will be added to your String, Object map. On Apr 16, 10:14 pm, kurka.dan...@googlemail.com wrote: I added my concerns to this issue in the gwt issue tracker: http://code.google.com/p/google-web-toolkit/issues/detail?id=3521 --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
Hasn't been accepted - just opened. Anyone can open issues against GWT. That being said, I think there could be room for improvement. For instance, if you specify a serializable interface or serializable abstract class, you should be allowed to enumerate all the various types that can possibly go across the wire in an annotation so as to provide more contextual information that the compiler simply doesn't otherwise have access to at compile time. @Transfers({A.class, B.class, C.class, D.class}) Serializable foo(Serializable[] x); etc. which limits the compiler to only look at A, B, C, D when it comes across trying to compile this RPC function. This would solve a lot of issues make the expressiveness much more powerful. On Fri, Apr 17, 2009 at 3:18 AM, Salvador Diaz diaz.salva...@gmail.comwrote: Frankly I don't see how that issue could be accepted, the fact that you have to mark all your serializable objects as Serializable or IsSerializable has been there from the beginning. It's related to the way the compiler has to know at compile time what objects are allowed to travel through RPCs and how they should be serialized. You simply cannot expect it to magically detect the types that will be added to your String, Object map. On Apr 16, 10:14 pm, kurka.dan...@googlemail.com wrote: I added my concerns to this issue in the gwt issue tracker: http://code.google.com/p/google-web-toolkit/issues/detail?id=3521 --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
this is exactly what i was thinking. we need a way to specify the classes that are okay to serialiaze with the service 2009/4/17 Vitali Lovich vlov...@gmail.com Hasn't been accepted - just opened. Anyone can open issues against GWT. That being said, I think there could be room for improvement. For instance, if you specify a serializable interface or serializable abstract class, you should be allowed to enumerate all the various types that can possibly go across the wire in an annotation so as to provide more contextual information that the compiler simply doesn't otherwise have access to at compile time. @Transfers({A.class, B.class, C.class, D.class}) Serializable foo(Serializable[] x); etc. which limits the compiler to only look at A, B, C, D when it comes across trying to compile this RPC function. This would solve a lot of issues make the expressiveness much more powerful. On Fri, Apr 17, 2009 at 3:18 AM, Salvador Diaz diaz.salva...@gmail.comwrote: Frankly I don't see how that issue could be accepted, the fact that you have to mark all your serializable objects as Serializable or IsSerializable has been there from the beginning. It's related to the way the compiler has to know at compile time what objects are allowed to travel through RPCs and how they should be serialized. You simply cannot expect it to magically detect the types that will be added to your String, Object map. On Apr 16, 10:14 pm, kurka.dan...@googlemail.com wrote: I added my concerns to this issue in the gwt issue tracker: http://code.google.com/p/google-web-toolkit/issues/detail?id=3521 --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
any more suggestions? Create a marker interface for the objects that you want to go through RPCs and type your Map with it: public interface DTO extends Serializable{ } ... The you declare your Map as: MapString, DTO Would that work ? --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
Using IsSerializable instead of Serializable should also cut down on the number of objects (although of course you have to modify your classes if you marked them as Serializable only). On Thu, Apr 16, 2009 at 6:10 AM, Salvador Diaz diaz.salva...@gmail.comwrote: any more suggestions? Create a marker interface for the objects that you want to go through RPCs and type your Map with it: public interface DTO extends Serializable{ } ... The you declare your Map as: MapString, DTO Would that work ? --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
I added my concerns to this issue in the gwt issue tracker: http://code.google.com/p/google-web-toolkit/issues/detail?id=3521 --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
perhaps can we use annotations like @gwt.typeArgs Those are deprecated, you should really avoid using them a simple java class containing a MapString,Object Can't you just use a MapString, Serializable ? If the map is going to be travelling through RPCs you really shouldn't be putting objects that don't implement Serializable into it. Cheers, Salvador For every service gwt has a list of classes which can be Serialized (whitelist). If my understanding is right this list is generated by the compiler at compile time by analizing the members of a class. But we can have classes (which ARE serializable) inside our transient map, but gwt will not serialize this classes because of the SerializationPolicy (these classes could not be found by the compiler at compile time). Is there any way to extend the white list of SerializationPolicy.java ? If I add all classes as private members to my class the members are found and the class can be serialized, but this is anoying and we cant do this for all classes (we dynamically decide which classes we need to transfer) Anyone got any expierence with that? Maybe open an issue about this? --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
The problem is that the compiler will create the code for al objects in the classpath that implement serialiazable (which are more ore less 1+). This results in enormous compile time and huge javascript... absolutely not doable any more suggestions? 2009/4/15 Salvador Diaz diaz.salva...@gmail.com perhaps can we use annotations like @gwt.typeArgs Those are deprecated, you should really avoid using them a simple java class containing a MapString,Object Can't you just use a MapString, Serializable ? If the map is going to be travelling through RPCs you really shouldn't be putting objects that don't implement Serializable into it. Cheers, Salvador For every service gwt has a list of classes which can be Serialized (whitelist). If my understanding is right this list is generated by the compiler at compile time by analizing the members of a class. But we can have classes (which ARE serializable) inside our transient map, but gwt will not serialize this classes because of the SerializationPolicy (these classes could not be found by the compiler at compile time). Is there any way to extend the white list of SerializationPolicy.java ? If I add all classes as private members to my class the members are found and the class can be serialized, but this is anoying and we cant do this for all classes (we dynamically decide which classes we need to transfer) Anyone got any expierence with that? Maybe open an issue about this? --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
I have exactly the same issue with post: http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/1b7e3851b943b130/2aa2077f4e6c90e1#2aa2077f4e6c90e1 I have used the Serializable solution but my code/library contains a lot of Serializable classes as well... I really would like to avoid this solution... Is it not possible: 1. to implement the SerializationPolicy and add the class that are Serializable. 2. define annotations in the RPC service with allowed Serializable objects. Fred On Apr 15, 9:30 pm, Daniel Kurka kurka.dan...@googlemail.com wrote: The problem is that the compiler will create the code for al objects in the classpath that implement serialiazable (which are more ore less 1+). This results in enormous compile time and huge javascript... absolutely not doable any more suggestions? 2009/4/15 Salvador Diaz diaz.salva...@gmail.com perhaps can we use annotations like @gwt.typeArgs Those are deprecated, you should really avoid using them a simple java class containing a MapString,Object Can't you just use a MapString, Serializable ? If the map is going to be travelling through RPCs you really shouldn't be putting objects that don't implement Serializable into it. Cheers, Salvador For every service gwt has a list of classes which can be Serialized (whitelist). If my understanding is right this list is generated by the compiler at compile time by analizing the members of a class. But we can have classes (which ARE serializable) inside our transient map, but gwt will not serialize this classes because of the SerializationPolicy (these classes could not be found by the compiler at compile time). Is there any way to extend the white list of SerializationPolicy.java ? If I add all classes as private members to my class the members are found and the class can be serialized, but this is anoying and we cant do this for all classes (we dynamically decide which classes we need to transfer) Anyone got any expierence with that? Maybe open an issue about this?- 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 -~--~~~~--~~--~--~---
GWT Serialization with CustomFieldSerializer fails because of SerializationPolicy
For data transport we use a simple java class containing a MapString, Object This map is transient and we serialize it with a custom field serializer. This works fine for most situations. For every service gwt has a list of classes which can be Serialized (whitelist). If my understanding is right this list is generated by the compiler at compile time by analizing the members of a class. But we can have classes (which ARE serializable) inside our transient map, but gwt will not serialize this classes because of the SerializationPolicy (these classes could not be found by the compiler at compile time). Is there any way to extend the white list of SerializationPolicy.java ? If I add all classes as private members to my class the members are found and the class can be serialized, but this is anoying and we cant do this for all classes (we dynamically decide which classes we need to transfer) Anyone got any expierence with that? Maybe open an issue about this? --~--~-~--~~~---~--~~ 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 with CustomFieldSerializer fails because of SerializationPolicy
I have the same issue with an RPC service witch return a ListObject... The compiler does not find the type of elements that could be included in the list... As a workarround i'm obliged to create dummy methods using the classes that could be included in the list... I would like to know how to extend the SerializationPolicy (whiteList...) ?? perhaps can we use annotations like @gwt.typeArgs On 14 avr, 16:36, Daniel Kurka kurka.dan...@googlemail.com wrote: For data transport we use a simple java class containing a MapString, Object This map is transient and we serialize it with a custom field serializer. This works fine for most situations. For every service gwt has a list of classes which can be Serialized (whitelist). If my understanding is right this list is generated by the compiler at compile time by analizing the members of a class. But we can have classes (which ARE serializable) inside our transient map, but gwt will not serialize this classes because of the SerializationPolicy (these classes could not be found by the compiler at compile time). Is there any way to extend the white list of SerializationPolicy.java ? If I add all classes as private members to my class the members are found and the class can be serialized, but this is anoying and we cant do this for all classes (we dynamically decide which classes we need to transfer) Anyone got any expierence with that? Maybe open an issue about this? --~--~-~--~~~---~--~~ 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 ???
Hi, Thanks for our reply, well I was considering doing DTO but thought there were a better way to do it. I hoped someone had a better way. But Ok I getting to it creating my DTOs. Cheers, Jero On Mar 26, 6:20 pm, Jason Essington jason.essing...@gmail.com wrote: If you don't have access to the source for your hibernate objects, then you'll need to create DTOs (data transfer objects) that are essentially identical to your hibernate objects. You can then manually marshal the values, or use a bean mapping library such as Dozer to do the work automagically. I generally use this technique even when I have the source for my server side objects as most of my objects have information that is not appropriate to send to the client anyway. -jason On Mar 26, 2009, at 7:41 AM, jero wrote: Hi, I am new to GWT and I have been playing around with GWT. Now I want to retrieve via hibernate using a RemoteService call ths content from a database. I have already a jar (provided by the db guys) where the domain is reflected. The problem I have is when I use it I always receive serialization problems form some classes of the domain. I know that if I extend my entity classes wit IsSerializable than the serialization works fine and I have no problem. I have been reading around and found that if you add your class to the *.gwt.rpc file than this would to the trick, well for me it didn't work, still serialization problem. I googled and found the Gilead project (former hibernate4gwt), what I don't like is that I have to extend my entity classes, but I am not allowed I am not maintining the db classes. So I am a bit stuck and after googling for last few days I didn't manage to find a proper solution. How can I get rid of the serialization problem, any suggestions are welcome? Thanks, Jero --~--~-~--~~~---~--~~ 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 Serialization ???
Hi, I am new to GWT and I have been playing around with GWT. Now I want to retrieve via hibernate using a RemoteService call ths content from a database. I have already a jar (provided by the db guys) where the domain is reflected. The problem I have is when I use it I always receive serialization problems form some classes of the domain. I know that if I extend my entity classes wit IsSerializable than the serialization works fine and I have no problem. I have been reading around and found that if you add your class to the *.gwt.rpc file than this would to the trick, well for me it didn't work, still serialization problem. I googled and found the Gilead project (former hibernate4gwt), what I don't like is that I have to extend my entity classes, but I am not allowed I am not maintining the db classes. So I am a bit stuck and after googling for last few days I didn't manage to find a proper solution. How can I get rid of the serialization problem, any suggestions are welcome? Thanks, Jero --~--~-~--~~~---~--~~ 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 ???
If you don't have access to the source for your hibernate objects, then you'll need to create DTOs (data transfer objects) that are essentially identical to your hibernate objects. You can then manually marshal the values, or use a bean mapping library such as Dozer to do the work automagically. I generally use this technique even when I have the source for my server side objects as most of my objects have information that is not appropriate to send to the client anyway. -jason On Mar 26, 2009, at 7:41 AM, jero wrote: Hi, I am new to GWT and I have been playing around with GWT. Now I want to retrieve via hibernate using a RemoteService call ths content from a database. I have already a jar (provided by the db guys) where the domain is reflected. The problem I have is when I use it I always receive serialization problems form some classes of the domain. I know that if I extend my entity classes wit IsSerializable than the serialization works fine and I have no problem. I have been reading around and found that if you add your class to the *.gwt.rpc file than this would to the trick, well for me it didn't work, still serialization problem. I googled and found the Gilead project (former hibernate4gwt), what I don't like is that I have to extend my entity classes, but I am not allowed I am not maintining the db classes. So I am a bit stuck and after googling for last few days I didn't manage to find a proper solution. How can I get rid of the serialization problem, any suggestions are welcome? Thanks, Jero --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Raw GWT serialization
Hi everyone, It's my first message in this group so if I'm wrong to post my question here, tell me where I can do it. I've read all documentation that I found about the GWT-RPC serialization mechanism, with a particular attention to the Google Web Toolkit and Client-Server communications by Miguel Mendez. And I would like to know how I can deserialized data on the client side by my own ?? Actually I encode data on server-side with the RPC.encodeResponseForSuccess() method and I try to read it with a ClientSerializationStreamReader which throws an exception without an details, just java.lang.Integer/3438268394. Any help will be really appreciated. 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 Serialization issue with detachable JDO class
Unfortunately, the GWT serialization process is not really neither documented nor extensible :-( I opened a RFE about it (http://code.google.com/p/google-web-toolkit/ issues/detail?id=1291can=1), but it is still marked as new an no one seems to care about it. That's why the solution implemented on Gilead seems to me the only one compatible without modifying GWT source code. Note that BlazeDS (the serialization library for Flex framework) has been *thought* to be extensible and provides extensions points with adapters and factory concept. I would really hope that GWT developers will be inspired by it when they will refactor the RPC serialization process. Regards Bruno On 15 fév, 01:37, Prempena pascal.rempena...@gmail.com wrote: Yes, I've read in detail all the Gilead documentation and also tried the examples. Good job indeed! But it is a pity to have to duplicate an object already available to be used at the client side, just because of serialization issues. We should be able to customize the GWT serialization process in order to have a completely opened data transfer between the server and the client. Do you know if there is some detailed documentation about the GWT serialization? On 14 fév, 21:07, noon bruno.marches...@gmail.com wrote: Hi, It really looks like similar issues with Hibernate entities (failure on GWT serialization). The solution I implemented on Gilead library (http:// gilead.sourceforge.net) is based on beanlib, that clones your entities to make them acceptable to GWT serializer. Hope this helps Bruno On 14 fév, 13:18, Prempena pascal.rempena...@gmail.com wrote: Hi, I would like to be able to use JDO objects, persisted by Datanucleus, directly in the GWT client, after the class has been serialized from the server to the client via the GWT serialization mechanism. It works fine when working with transient JDO objects. I'm able to move the object back and forth between the client and the server without any issue. Unfortunately, when the class is tagged as detachable (with the goal to allow the update of the object in the datastore when coming back to the server), the GWT Serialization doesn't work, due to some objects added by the enhancement process: Object[] jdoDetachedState. Of course, I would like to avoid JDO Object copy to a POJO serializable by GWT: it is waste of time and painful to do. Any Idea to help me to find a solution or a workaround to solve this issue? Thanks in advance,- Masquer le texte des messages précédents - - Afficher le texte des messages précédents - --~--~-~--~~~---~--~~ 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 Serialization issue with detachable JDO class
Hi, I would like to be able to use JDO objects, persisted by Datanucleus, directly in the GWT client, after the class has been serialized from the server to the client via the GWT serialization mechanism. It works fine when working with transient JDO objects. I'm able to move the object back and forth between the client and the server without any issue. Unfortunately, when the class is tagged as detachable (with the goal to allow the update of the object in the datastore when coming back to the server), the GWT Serialization doesn't work, due to some objects added by the enhancement process: Object[] jdoDetachedState. Of course, I would like to avoid JDO Object copy to a POJO serializable by GWT: it is waste of time and painful to do. Any Idea to help me to find a solution or a workaround to solve this issue? 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-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 issue with detachable JDO class
Yes, I've read in detail all the Gilead documentation and also tried the examples. Good job indeed! But it is a pity to have to duplicate an object already available to be used at the client side, just because of serialization issues. We should be able to customize the GWT serialization process in order to have a completely opened data transfer between the server and the client. Do you know if there is some detailed documentation about the GWT serialization? On 14 fév, 21:07, noon bruno.marches...@gmail.com wrote: Hi, It really looks like similar issues with Hibernate entities (failure on GWT serialization). The solution I implemented on Gilead library (http:// gilead.sourceforge.net) is based on beanlib, that clones your entities to make them acceptable to GWT serializer. Hope this helps Bruno On 14 fév, 13:18, Prempena pascal.rempena...@gmail.com wrote: Hi, I would like to be able to use JDO objects, persisted by Datanucleus, directly in the GWT client, after the class has been serialized from the server to the client via the GWT serialization mechanism. It works fine when working with transient JDO objects. I'm able to move the object back and forth between the client and the server without any issue. Unfortunately, when the class is tagged as detachable (with the goal to allow the update of the object in the datastore when coming back to the server), the GWT Serialization doesn't work, due to some objects added by the enhancement process: Object[] jdoDetachedState. Of course, I would like to avoid JDO Object copy to a POJO serializable by GWT: it is waste of time and painful to do. Any Idea to help me to find a solution or a workaround to solve this issue? Thanks in advance,- Masquer le texte des messages précédents - - Afficher le texte des messages précédents - --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Problems with GWT serialization
I am having trouble creating GWT user defined data types that are serializable. I get a compiler error saying something like Type X was not serializable and has no concrete serializable subtypes. For example I have: public interface IDisplayableU extends IsSerializable{ U getURL(); } public class GWTDisplayable implements IDisplayableURL, IsSerializable{ URL getURL(); } Note GWTDisplayable does have a no-arg constructor. Why do I get this error? I have a subtype and they both implement IsSerializable (although the docs say only one need this). -Dave --~--~-~--~~~---~--~~ 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 !!!!
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 !!!!
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 !!!!
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 !!!!
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 !!!!
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 !!!!
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 -~--~~~~--~~--~--~---