users@jersey.java.net

[Jersey] Jersey Client WebResource question

From: Kevin Duffey <andjarnic_at_yahoo.com>
Date: Tue, 29 May 2012 14:52:45 -0700 (PDT)

Hi,

I am trying to track down an issue and I am not sure if it's related to a similar issue I've seen sometimes with browsers. Basically, I am integrating one app with another via REST, the client app uses Jersey Client and creates a static WebResource instance at the start/deploy of the app. During development, I sometimes redeploy the rest service app. The IP/url does not change. When I do this, the rest call to the service no longer works using the client WebResource instance. If I redeploy the client app, it then works again. My gut is telling me somehow the client WebResource is no longer good because I redeployed the service app. I don't know if this is the case or not, but since the ip/url does not change, I am not sure why this would be a problem. My only guess is that the WebResource opens a stream to the server side and when I redeploy the server side, it gets closed. If this is the case, (or if not but the WebResource instance is no longer good),
 is there some way to detect/be notified that the instance of the WebResource is no good and recreate it? It's not null.. I don't get an NPE when reusing it.


Thanks.