*
The moose likes Web Services and the fly likes Jersey Response issue driving me batty! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Jersey Response issue driving me batty!" Watch "Jersey Response issue driving me batty!" New topic
Author

Jersey Response issue driving me batty!

Manny Garcia
Greenhorn

Joined: Apr 04, 2007
Posts: 28
Hi,

I'm using jersey 1.8 from the jersey bundle and running on glassfish 3.1. I'm writing a REST web service and all has been peachy, until I need to send a specific response code. Every time I try to get a ResponseBuilder object I get a very generic jersey exception. Here's my code:



The method errors out on line 20. Note I know that this code doesn't do anything useful. I'm attempting to return a 403 response with a custom header. In my testing I deliberately call the method with parameters that will cause a ForbiddenException (a custom exception) to be thrown. Here is the error I see when I attempt to execute line 20 above:


Prior to this the method's return type was JSONObject and I wasn't attempting to modify the response in any way and life was hunky-dory. Does anyone have any ideas what I could do to make this work? I've been at it for hours.


Regards,

Manny
Manny Garcia
Greenhorn

Joined: Apr 04, 2007
Posts: 28
Well, I found something that worked. I did not find any documentation that said to do it this way, but it has the virtue of working:




Regards,

Manny
 
 
subject: Jersey Response issue driving me batty!
 
Similar Threads
Strange problem - works on maven glassfish but not on Tomcat
Glassfish deployment issues
Jersey Hibernate Problem
Web Service For Optical Character Recognition
REST Web Services using jersey in Apache Tomcat Server throwing ConnectionException