Hi, the sample code i sent you actually works even if i switch to gwt 2.7. (superdevmode).
In my sample i specify the json string inline; i'd try to do the same to investigate further. good luck, Alberto. On Fri Feb 06 2015 at 2:51:36 PM Ali Akhtar <[email protected]> wrote: > Jens, that was just a typo I made in pasting the code. The actual code has > the right class name. > > Alberto, I'm on gwt 2.7.0 . Does it work with that? The json string > is: {"value":"tesst"} > > On Fri, Feb 6, 2015 at 6:47 PM, Alberto Mancini <[email protected]> > wrote: > >> Hi, >> just tested your code and actually seems to work using gwt/trunk so maybe >> it has something to do with the version you are using or the 'response' >> text. >> >> >> My EntryPoint: >> --- >> >> RequestBeanFactory factory = GWT.create(RequestBeanFactory.class); >> >> AutoBean<MyBean> ab = AutoBeanCodex.decode(factory, MyBean.class, >> "{\"value\":\"ciao\"}"); >> >> GWT.log("Decode 1"); >> >> MyBean result = ab.as(); >> >> GWT.log("Decode 2: " + result.toString()); >> >> GWT.log("Result: " + result.getValue()); >> --- >> >> >> Browser console: >> Decode 1 >> SuperDevModeLogger.java:71 Decode 2: com..._MyBeanAutoBean$2@1 >> SuperDevModeLogger.java:71 Result: ciao >> >> ----- >> >> >> Cheers, >> A. >> >> On Fri Feb 06 2015 at 2:32:42 PM Ali Akhtar <[email protected]> wrote: >> >>> Seems like this error only occurs when I try to access a property of the >>> deserialized bean. I changed my code to the following: >>> >>> Console.debug("Response-- " + response.getText()); >>> >>> >>> >>> >>> AutoBean<MyBean> ab = AutoBeanCodex.decode(factory, MyBean.class, >>> response.getText()); >>> Console.debug("Decode 1"); >>> >>> >>> InitResult result = ab.as(); >>> Console.debug("Decode 2: " + result.toString()); >>> >>> >>> Console.debug("Result: " + result.getValue()); >>> >>> >>> >>> >>> I now get the output: >>> >>> Response-- {"value":"tesst"} >>> Decode 1 >>> Decode 2: com.myModule.MyBeanAutoBean$2@1 >>> >>> com.google.gwt.core.client.JavaScriptException: (ReferenceError) : >>> Ljava_util_List_2_classLit_0_g$ is not defined >>> Unknown.endVisitType_1_g$(MyModule-0.js@7:63876) >>> Unknown.traverse_1_g$(MyModule-0.js@18:61737) >>> Unknown.accept_5_g$(MyModule-0.js@8:61687) >>> Unknown.maybeCreateCoder_0_g$(MyModule-0.js@12:64201) >>> Unknown.visitValueProperty_3_g$(MyModule-0.js@8:64216) >>> Unknown.traverseProperties_0_g$(MyModule-0.js@20:4376) >>> Unknown.traverse_0_g$(MyModule-0.js@10:4303) >>> Unknown.accept_4_g$(MyModule-0.js@8:4168) >>> Unknown.doCoderFor_0_g$(MyModule-0.js@17:63727) >>> Unknown.getOrReify_0_g$(MyModule-0.js@16:4217) >>> >>> >>> >>> >>> Bean definition: >>> >>> public interface MyBean extends Serializable >>> { >>> public String getValue(); >>> public void setValue(String value); >>> } >>> >>> >>> public interface RequestBeanFactory extends AutoBeanFactory >>> { >>> public AutoBean<MyBean> myBean(); >>> } >>> >>> >>> >>> Any ideas? >>> >>> -- >>> 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 [email protected]. >>> To post to this group, send email to [email protected] >>> . >>> Visit this group at http://groups.google.com/group/google-web-toolkit. >>> For more options, visit https://groups.google.com/d/optout. >>> >> -- >> You received this message because you are subscribed to a topic in the >> Google Groups "Google Web Toolkit" group. >> To unsubscribe from this topic, visit >> https://groups.google.com/d/topic/google-web-toolkit/RzsjqX2gGd4/unsubscribe >> . >> To unsubscribe from this group and all its topics, send an email to >> [email protected]. >> > >> To post to this group, send email to [email protected]. >> Visit this group at http://groups.google.com/group/google-web-toolkit. >> For more options, visit https://groups.google.com/d/optout. >> > -- > 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 [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/google-web-toolkit. > For more options, visit https://groups.google.com/d/optout. > -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.
