We had to downgrade our Jersey version from 1.7 to 1.0.3.1 due to the client using Java 5 (and 1.7 did not seem compatible). When using 1.7, we were able to happily connect to the server using the code snippet below. When we downgraded, we only get Error 500s (via a UniformInterfaceException) yet the URL in the error message still works within my browser.
This is our first time working with Jersey - were any major changes made to how URLs are called from 1.0.3.1 to 1.7? Should we change the way we make these types of calls?
WebResource service = client.resource(CPC_SECURE_BASE_URL); //base URL is the server's URL
System.out.println(service.path("customer").path("0007023210").accept(
MediaType.TEXT_XML).get(String.class));
Full stack trace:
com.sun.jersey.api.client.UniformInterfaceException: GET https://<address removed>/app/customer/0007023210 returned a response status of 500
at com.sun.jersey.api.client.WebResource.handle(WebResource.java:563)
at com.sun.jersey.api.client.WebResource.get(WebResource.java:179)
at com.jersey.client.RestClient.retrieveXMLResource(RestClient.java:66)
at com.jersey.client.RestClient.main(RestClient.java:91)
Update - I just tried running the code with Jersey 1.2 (as it is the last version that will run on Java 5) and I now get an Error 401 returned. I have confirmed that everything is still working with Java 6+Jersey 1.7.