Bug with boolean field?

2 views
Skip to first unread message

PDB

unread,
May 29, 2007, 1:01:33 PM5/29/07
to GWT Jsonizer
I am tying to use the parser, but I get an exception running the
following line...

MyObj params = (MyObj) JsonizerParser.parse(jsonizer, strToken);

Exception:
org.juglar.gwt.jsonizer.client.JsonizerException: null
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNative(ModuleSpaceIE6.java:
435)
at
com.google.gwt.dev.shell.ie.ModuleSpaceIE6.invokeNativeHandle(ModuleSpaceIE6.java:
211)
at
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeHandle(JavaScriptHost.java:
93)
at
org.juglar.gwt.jsonizer.client.base.BeanJsonizer.setProperties(BeanJsonizer.java:
69)
at
org.juglar.gwt.jsonizer.client.base.BeanJsonizer.asJavaObject(BeanJsonizer.java:
104)
at
org.juglar.gwt.jsonizer.client.JsonizerParser.parse(JsonizerParser.java:
48)

In fact, it is not working when there is a boolean field in the pojo.

Cheers,
PDB

Andrés Testi

unread,
May 29, 2007, 2:09:09 PM5/29/07
to GWT Jsonizer
Hi PDB. Can you reproduce the MyObj class code, and the strToken
value?

PDB

unread,
May 30, 2007, 4:45:13 AM5/30/07
to GWT Jsonizer
Here is the real class:

public class PagedListParametersTest {

private int page;

private boolean paged;

private int currentSort;

public PagedListParametersTest() {
super();
page = -1;
}

public int getCurrentSort() {
return currentSort;
}

public void setCurrentSort(int currentSort) {
this.currentSort = currentSort;
}

public boolean getPaged() {
return paged;
}

public void setPaged(boolean paged) {
this.paged = paged;
}

public int getPage() {
return page;
}

public void setPage(int page) {
this.page = page;
}
}

The strToken value: {"page":-1,"currentSort":0,"paged":false}


The code I used for the test:
try {
final PagedListParametersTestJsonizer jsonizerTest =
(PagedListParametersTestJsonizer) GWT
.create(PagedListParametersTestJsonizer.class);

PagedListParametersTest params = new PagedListParametersTest();
String strToken = jsonizerTest.asString(params);
GWT.log(strToken, null);

params = (PagedListParametersTest) JsonizerParser.parse(jsonizerTest,
strToken);
} catch (JsonizerException e) {
GWT.log("Error getting the params object ", e);
}


Please note that if I take off the the paged attribute (private
boolean paged), it will run smoothly...
By the way, it is possible to get your project source code somewhere?

Thanks,
PDB

Andrés Testi

unread,
May 30, 2007, 12:28:53 PM5/30/07
to GWT Jsonizer
It's very strange. I will reproduce your code in Eclipse and then I
will response you. The source code is available under the gwt-
jsonizer.jar file. Remember, GWT requires binaries and sources to
compile. You can unzip gwt-jsonizer.jar to browse all source code.
Cheers.
Reply all
Reply to author
Forward
0 new messages