Andreas Junghans wrote:
Hi,

Am 06.08.2007 um 14:13 schrieb vbZ:

thank You for Your response. But I have still the trouble with convertion JSONObject to my Object:

The rcp request is:
{"service":"com.tietoenator.nas.common.ui.qooxdoo.RTOrder","method":"t esObj","id":2,"params":[{"$ $initialized":true,"classname":"com.tietoenator.nas.common.ui.qooxdoo. Result","name":"com.tietoenator.nas.common.ui.qooxdoo.Result","basenam e":"Result","constructor":[Class com.tietoenator.nas.common.ui.qooxdoo.Result],"message":"some text","ret":1}],"server_data":null}

my java object Result has defined default constructor, getters/setters

Then it should work. Could you send the source of your Result class (or at least a skeleton that shows all the constructor and method signatures)?

Regards,

   Andreas


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Hi,

I found the bug at class net.sf.qooxdoo.rpc.RemoteCallUtils, method toJava(Object obj, Class targetType), line 136.

There isn;t check to null of desc variable. All works fine, if I add the test;

          --- added                if (desc != null) {
--- line 137 PropertyUtils.setSimpleProperty(bean, name, toJava(jsonObject.get(name), desc.getPropertyType()));
         --- added                  }

Could You fix it, please?


Here is the JS object which I'm sending trough RPC call:

qx.Class.define("vbz.Result",
{
 extend : Object,

 members :
 {
    ret: 232,
    str: 'some value'
   }
});

This is the request:

{"service":"vbz.RTOrder","method":"testObj","id":1,"params":[{"$$initialized":true,"ret":232,"str":"some value","classname":"vbz.Result","name":"vbz.Result","basename":"Result","constructor":[Class vbz.Result
]}],"server_data":null}

The property classname does not exist's at my javabean vbz.Result, the PropertyUtils.getPropertyDescriptor(bean, name); retuns null and the PropertyUtils.setSimpleProperty(bean, name, toJava(jsonObject.get(name), desc.getPropertyType())); try to invoke method getPropertyType() on null.

vbZ


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to