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]
.com> To
[email protected]
2008-10-21 12:19 cc
Subject
Please respond to Re: "error parsing result" error in
[EMAIL PROTECTED] Tuscany JSON-RPC
he.org
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/
<<inline: graycol.gif>>
<<inline: pic27685.gif>>
<<inline: ecblank.gif>>
JSONRPCServiceServlet1.3.2.java
Description: Binary data
JSONRPCServiceServlet1.3.1.java
Description: Binary data
