This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Propogate CustomException from servlet

 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application where the Swing UI client communicates to a servlet using serialized object IO.
My problem is I want to propagate custom exceptions to the UI. I have created a super class extending Throwable and all my custom exceptions subclass it.
Whenever I wanted to throw an exception, it tried wrapping it inside the ServletException/IOException.

On the client side I never get the ServletException but only the IOException.
From the IOException the call to getCause returns null.
Surprisingly I can see my custom exception on the server side stack trace.

What am I doing wrong?

PS. As a workaround I started writing my custom exception to the output stream and the code is working now. But I am sure this is not the correct solution.
[ July 15, 2008: Message edited by: Maneesh Godbole ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic