Skip to main content

Posts

Showing posts with the label jersey

Jersey Client: Cache-Manager for Conditional GET?

Jersey has wonderful support for server-side handling of Preconditions to respond to a Conditional-GET-request. On the client-side it seems a bit less elegant/manual. As far as I know you'd need to store the metadata of the entity yourself (etag, last-modified header) and make a decision, when to set which headers, evaluate the response code, update your local cache of entity/metadata ... etc. Do you know of a ready, free implementation that wraps up the conditonal GET? I found this example , where the poster is using CacheManager and CacheEntry ; I suspect his own implementation. Shouldn't this be part of Jersey Client itself?

Exception while trying to use jersey and jaxb

The following code: @POST @Path("/previous-status/{current}") @Consumes(MediaType.APPLICATION_XML) @Produces(MediaType.TEXT_PLAIN) public String getPreviousStepStatus(@PathParam("current") JAXBElement<WorkflowStep> step) { WorkflowStep wfStep = step.getValue(); return DBAccessor.getPrevStepStatus(wfStep); } Produces the following exception: javax.servlet.ServletException: Servlet.init() for servlet Jersey Rest Service threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) org.apach