Not. Also, Jersey does not call client.close() in the event of an exception, and does not make JerseyClient AutoCloseable .
You can easily check it out. The client throws an IllegalStateException if you call the method after closing:
Client client = ClientBuilder.newClient(); client.close(); client.target("http://stackoverflow.com").request().get();
But you can call the method after throwing an exception:
Client client = ClientBuilder.newClient(); try { client.target("http://foo.bar").request().get();
So closing is your job.
Update: JAX-RS 2.1 will use AutoClosables .
source share