Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Exception serialization in ITeamModelledRestService

Hi,

Whenever any service implementing ITeamModelledRestService, throws an exception, it is shown as following in my browser -


The server encountered an internal error () that prevented it from fulfilling this request.


I am using RTC 1.0 installed over tomcat.

How can I make the server returns back error details ?
Also, if I am writing my own service and throw an exception which I define, will Jazz component code take care of it's serialization ? What is the best method to return back error messages to the browser ?

Thanks
- Vibha

0 votes



5 answers

Permanent link
I understand what you're saying.

I'm suggesting that you take the offending URI, put in into the address
bar of a browser (outside the context of your javascript app), append
the query parameters that I suggested, and observe the output in the
browser's window. This is not a programmable solution - just a
debugging trick to see if there are any server-generated messages that
you're missing..

If your server component is not in control of the exception, there is no
way for you to interject message into the exception.

There is currently no XML serialization of exception information in the
response. If this is something you'd like to see in a subsequent
release, please file an enhancement request against the respository
component.

vssinha wrote:
Hello Todd,

We have our UI implemented in DOJO and it understands the XML
serialization that is returned. It would be too much work to shift to
text/json representation now.

Is there any other way I can return an error message back to the
browser client ? I am ok not returning the whole exception trace but
just a one line message or error code.

Thanks
- Vibha



--
Todd Lainhart
Jazz Repository/Foundation Team

0 votes


Permanent link
Hello Todd,

We have our UI implemented in DOJO and it understands the XML serialization that is returned. It would be too much work to shift to text/json representation now.

Is there any other way I can return an error message back to the browser client ? I am ok not returning the whole exception trace but just a one line message or error code.

Thanks
- Vibha

0 votes


Permanent link
vssinha wrote:
Hello Todd,

I am using xml serialization.

Thanks
- Vibha


Diagnostic exception serialization in XML is not available at the
moment, unfortunately. Regardless, try what I previously suggested to
see if you can get additional information (using text/json). There's a
chance that you might get back some useful information.

--
Todd Lainhart
Jazz Repository/Foundation Team

0 votes


Permanent link
Hello Todd,

I am using xml serialization.

Thanks
- Vibha

0 votes


Permanent link
vssinha wrote:
Hi,

Whenever any service implementing ITeamModelledRestService, throws an
exception, it is shown as following in my browser -

The server encountered an internal error () that prevented it from
fulfilling this request.

I am using RTC 1.0 installed over tomcat.

How can I make the server returns back error details ?
Also, if I am writing my own service and throw an exception which I
define, will Jazz component code take care of it's serialization ?
What is the best method to return back error messages to the browser
?

Thanks
- Vibha


Are you implementing a browser client (e.g. Dojo-based) to communicate
with your service, or are you using the browser to just get these error
diagnostics? Is your wire representation JSON?

Conventionally, Jazz web-based clients request the wire representation
of the server response as JSON, and read programmatically the error
information encoded as such.

There are some internal (i.e. unsupported) diagnostics that might help
you get data back to the browser for inspection. Add the following
query parameters to your URI in the browser's address bar (in addition
to the parameters that your service expects) and see if this helps:

?_mediaType=text/json&_asText=true&_prettyPrint=true

If you're lucky, you'll see some error information formatted as JSON in
the browser's page-rendering area.

--
Todd Lainhart
Jazz Repository/Foundation Team

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,930

Question asked: Sep 18 '08, 7:06 a.m.

Question was seen: 6,335 times

Last updated: Sep 18 '08, 7:06 a.m.

Confirmation Cancel Confirm