This change might have gone only into trunk, and we are talking about
a 1.4 release for sometime next month.
If you need to check the latest source code, it's available at :

https://svn.apache.org/repos/asf/tuscany/java/sca/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java


On Tue, Oct 21, 2008 at 12:49 AM, ZhiYong Mao <[EMAIL PROTECTED]> wrote:
> Hi Luciano
>
> What we used is Tuscany SCA 1.3.1, but I did not find any code like you
> mentioned in source code 1.3.1 and 1.3.2, here are the source files for the
> 2 versions:
> (See attached file: JSONRPCServiceServlet1.3.2.java)(See attached file:
> JSONRPCServiceServlet1.3.1.java)
> But I saw the following change from the TUSCANY-1961, why?
>
> Best regards!
>
> Jacky Mao , Software Engineer
> IBM GPSG Wuhan Perform Center
> Tel : 0086-027-87406266-1212
> E-Mail: [EMAIL PROTECTED]
> "Luciano Resende" <[EMAIL PROTECTED]>
>
>
> "Luciano Resende" <[EMAIL PROTECTED]>
>
> 2008-10-21 12:19
>
> Please respond to
> [email protected]
>
> To
> [email protected]
> cc
>
> Subject
> Re: "error parsing result" error in Tuscany JSON-RPC
> Hey ZhiYong
>
>   What release are you using ? This might have already been fixed by
> TUSCANY-1961 by adding the following code
>
>      JSONRPCResult errorResult = new
> JSONRPCResult(JSONRPCResult.CODE_REMOTE_EXCEPTION, id, e.getCause() );
>
>   Please let me know if you still see the mentioned behavior with current
> code.
>
> [1] https://issues.apache.org/jira/browse/TUSCANY-1961
>
>
>
> On Sun, Oct 19, 2008 at 11:28 PM, ZhiYong Mao <[EMAIL PROTECTED]> wrote:
>> Hi
>>
>> I found there would be an error "error parsing result" while call by
>> JSON-RPC and we could not get the actual error message if the java code
>> threw a exception, which results from the error message is not valid JSON
>> string, for example:
>> {"error":com.ibm.iq.innovation.marketplace.biz.exception.BizException: A
>> Group named Jacky's team already exists.,"id":2}
>>
>> So I think it would be better to fix it like this:
>> =>Line 246 in
>> org.apache.tuscany.sca.binding.jsonrpc.provider.JSONRPCServiceServlet:
>> Change the following code: =>
>> jsonResponse.put("error", e.getCause());
>> to the code as follows: =>
>> /**********************************************************
>> * add json error object into error so that
>> * the client javascript can parse them correctly.
>> */
>> Throwable t=e.getCause();
>> JSONObject jsonError = new JSONObject();
>> jsonError.put("code", HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
>> jsonError.put("msg", t.getMessage());
>> jsonError.put("trace", t.getClass().getName());
>> jsonResponse.put("error", jsonError);
>> /************************************************/
>>
>> Best regards!
>>
>> Jacky Mao , Software Engineer
>> IBM GPSG Wuhan Perform Center
>> Tel : 0086-027-87406266-1212
>> E-Mail: [EMAIL PROTECTED]
>
>
>
> --
> Luciano Resende
> Apache Tuscany, Apache PhotArk
> http://people.apache.org/~lresende
> http://lresende.blogspot.com/
>
>



-- 
Luciano Resende
Apache Tuscany, Apache PhotArk
http://people.apache.org/~lresende
http://lresende.blogspot.com/

Reply via email to