users@jersey.java.net

jersey.api.client.ClientHandlerException

From: Amy Yang (amyyang) <"Amy>
Date: Wed, 30 Jun 2010 12:15:17 -0700

Hi,
 
I am trying to test a GET from a Jersey Server. I got
"jersey.api.client.ClientHandlerException" at the line in red below.
Could you please point me to any link or doc that can help me resolve
this issue.
 
 
 public String getRequest (String uri){
    DefaultApacheHttpClientConfig config = new
DefaultApacheHttpClientConfig();
    config.getState().setCredentials(null, null, -1, "Administrator",
"abc123");
    ApacheHttpClient client = ApacheHttpClient.create(config);
    WebResource webResource = client.resource(uri);
    String response = (String)webResource.get(String.class);
    return response;
 }
 
 
com.sun.jersey.api.client.ClientHandlerException:
javax.net.ssl.SSLHandshakeException:
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target

at
com.sun.jersey.client.apache.ApacheHttpClientHandler.handle(ApacheHttpCl
ientHandler.java:264)

at com.sun.jersey.api.client.Client.handle(Client.java:569)

at com.sun.jersey.api.client.WebResource.handle(WebResource.java:556)

at com.sun.jersey.api.client.WebResource.get(WebResource.java:179)

at
com.cisco.cucms.cupm.rest.client.webServices.RESTfulServicesEngine.getRe
quest(RESTfulServicesEngine.java:58)

at
com.cisco.cucms.cupm.rest.client.test.RESTfulClientTest.test(RESTfulClie
ntTest.java:34)

Thanks,
Amy