Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

jersey REST: catching custom exceptions in proxy-driven client

878719Jul 28 2011 — edited Jul 28 2011
Hi all,

I have a jersey REST server and client, both sharing an annotated interface of the service. The service methods can throw custom Exceptions (say, a 'CustomException').
The client is calling the service by using a service-proxy of that interface, so it should be aware of all class-types that is used by the interface including the Exception types.
But when a CustomException is thrown by the server, the client does not get this type, but a more generic jax-ws Exception. I was assuming that for a proxy-service the Exception class will be recreated out from the response, but that seems to be not the case.

So is the only way to catch custom exception from the server to the same custom exception in the client by using an Exception-Mapper?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 25 2011
Added on Jul 28 2011
2 comments
649 views