users@jersey.java.net

Question

From: Benjamin Renaud <benjamin.renaud_at_gmail.com>
Date: Fri, 18 Sep 2009 21:59:10 -0700

Hi Everyone,

I am using 1.1.2-ea, and while running a simple client get:

BasicAuthenticationClientFilter authFilter =
                new BasicAuthenticationClientFilter("*******", "*******");
        Client client = Client.create();
        client.addFilter(authFilter);
        client.setFollowRedirects(true);
        WebResource webResource =
client.resource("https://myserver.com/customers.xml");
        serviceSideKickData = webResource.get(String.class);

I get:

java.lang.NullPointerException
        at javax.ws.rs.core.MediaType.valueOf(MediaType.java:119)
        at com.sun.jersey.api.client.ClientResponse.getType(ClientResponse.java:593)
        at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:516)
        at com.sun.jersey.api.client.ClientResponse.getEntity(ClientResponse.java:491)
        at com.sun.jersey.api.client.WebResource.handle(WebResource.java:561)
        at com.sun.jersey.api.client.WebResource.get(WebResource.java:179)
        at com.taskdock.internal.customer.CustomerAction.execute(CustomerAction.java:82)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:168)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)

I am just trying to get the XML in string form.

I'll be moving on to handler once I get there. It looks like
MediaType's delegate instance is null and that's causing the issue
when ClientResponse tries to get the MediaType from valueOf.

Thanks in advance,
Benjamin