On Sep 21, 2010, at 4:50 AM, Justin Ransom Dallas wrote:
> Hello Everyone ,
> I am using Jersey as a REST client in a Glassfish v3 server.
> When I run the client from a servlet I seem to always get this error
> no matter what I do , however if I run it from a Main file , it
> works like a charm. Does anyone know what the problem could be ? I
> am using Jersey core 1.5
>
Do you mean 1.1.5?
Are you distributing Jersey jars in the WEB-INF/lib? If so the version
of Jersey in the WEB-INF/lib is clashing with the version distributed
with GlassFish. So i recommend just using the version with GlassFish
or overriding/upgrading.
https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html
#glassfish
Paul.
> WARNING: StandardWrapperValve[CreditServlet]: PWC1406:
> Servlet.service() for servlet CtServlet threw exception
> java.lang.AbstractMethodError
> at
> com
> .sun
> .jersey
> .core
> .spi
> .factory
> .MessageBodyFactory._getMessageBodyReader(MessageBodyFactory.java:229)
> at
> com
> .sun
> .jersey
> .core
> .spi
> .factory
> .MessageBodyFactory.getMessageBodyReader(MessageBodyFactory.java:215)
> ...
> ClientConfig config = new DefaultClientConfig();
> Client client = Client.create(config);
> WebResource webResource = client.resource("https://someurl.com");
>
> ClientResponse response2 = webResource.path("/
> somepath").get(ClientResponse.class);
> System.out.println( response2.getStatus() );
> System.out.println( response2.getHeaders().get("Content-Type") );
> String entity = response2.getEntity(String.class);
> System.out.println(entity);