Questions tagged [jersey-2.0]

Jersey 2.0 is the open source, early access JAX-RS 2.0 (JSR-339) reference implementation for building RESTful Web services. Only use this tag if your question specifically pertains to Jersey 2.0.

Jersey is an open source framework for developing RESTful web services in Java and the reference implementation for JAX-RS 2.0 (JSR-339)

2300 questions
15
votes
3 answers

HK2 failure has been detected in a code that does not run in an active Jersey Error scope

Currently I am developing a jersey based RESTful application and would like to use DPI in my resources. (Note: Version of jersey is 2.23.1 and the servlet container is tomcat 8.5.3.) Therefore I followed the tutorial Chapter 23. Custom Injection…
Sebastian Frey
  • 488
  • 1
  • 4
  • 13
15
votes
1 answer

Jersey version issue: MessageBodyReader not found for media type=application/xml

While writing a simple Jersey client that was consuming XML data, I came across this exception "MessageBodyReader not found for media type=application/xml". All of my settings, including the jersey-client as maven dependencies was just fine. The…
Anant
  • 1,356
  • 1
  • 11
  • 9
15
votes
4 answers

ClientAbortException when using Jersey 2.13

I'm using Jersey 2.13 in my web application for retrieving data async. There are some cases where requests take some time (i.E. when executing complex reports) until their response returns to the client. When the client does not wait for the async…
Chip
  • 382
  • 2
  • 9
15
votes
2 answers

How to iterate over MultivaluedMap and extract the key and its corresponding first value?

Here is my code its my first attempt . But what is the correct way to do this. private Map prepareParameters(MultivaluedMap queryParameters) { Map parameters = new HashMap(); …
John Doe
  • 2,752
  • 5
  • 40
  • 58
14
votes
5 answers

Using Jackson ObjectMapper with Jersey

I'm using Jersey 2.4 to create a simple REST interface that serves up a JSON object. My problem is that I'm trying to use the fasterxml Jackson annotations to control the output and this is not working for me. I have put the annotations into my bean…
jcstockdale
  • 149
  • 1
  • 1
  • 6
14
votes
5 answers

JAX WS RS using Jersey - returning Collection, Map etc

I'm using Jersey 2.3 My WS endpoint class : @Path("/employees") public class EmployeeWSEndpoint { @Context Request request; @GET @Path("/allEmployees") @Produces(MediaType.APPLICATION_JSON) public List
Kaliyug Antagonist
  • 3,512
  • 9
  • 51
  • 103
13
votes
3 answers

How to get instance of javax.ws.rs.core.UriInfo

Is there any implementation of javax.ws.rs.core.UriInfo which I can use to create an instance quickly for testing. This interface is long, I just need to test something. I don't want to waste time on whole implementation of this interface. UPDATE: I…
Aqeel Ashiq
  • 1,988
  • 5
  • 24
  • 57
13
votes
3 answers

Jersey 2.6 Jackson provider registering

I'm implementing REST web service with Jersey 2.6, I'm having troubles of registering a Jackson Provider for JSON support, I have implemented according to the jeresy documentation…
Asela Senanayake
  • 351
  • 2
  • 6
  • 21
13
votes
1 answer

Jersey 2.3 Setting Priority for ContainerRequestFilter

public class MyApplication extends ResourceConfig { public MyApplication() { /* // Register resources and providers using package-scanning. packages("com.keylesson.service"); // Register my custom provider - not needed…
curiousengineer
  • 2,196
  • 5
  • 40
  • 59
13
votes
4 answers

Filter Jersey request based on form data

In Jersey 1.x, you can use ContainerRequest.getFormParameters() to do request filtering on the form data, but I don't see an obvious equivalent in Jersey 2.x. I've implemented the ContainerRequestFilter interface which gives me access to a…
Mike
  • 4,722
  • 1
  • 27
  • 40
13
votes
2 answers

Jersey 2 filter uses Container Request Context in Client Request Filter

I have a Jersey 2 Web Service that upon receiving a request, makes another request to another web service in order to form the response for the original request. So, when client "A" makes a request to my web service "B", "B" makes a request to "C"…
oggmonster
  • 4,672
  • 10
  • 51
  • 73
13
votes
2 answers

Trouble creating a simple singleton class in Jersey 2 using built-in Jersey dependency injection

I am having trouble getting a very basic implementation of a singleton class off the ground with Jersey 2 (2.7) and only Jersey's built-in HK2 dependency injection. I am running this on Tomcat. My goal is to create a singleton instance of a support…
ricb
  • 1,197
  • 2
  • 12
  • 23
13
votes
5 answers

NoSuchFieldError: INCLUDE_ALL

I am using Jersey with Spring on GAE. I get the following exception: Uncaught exception from servlet java.lang.NoSuchFieldError: INCLUDE_ALL at org.glassfish.jersey.server.ResourceConfig$State. (ResourceConfig.java:110) at…
balderman
  • 22,927
  • 7
  • 34
  • 52
13
votes
2 answers

What is best approach for implementing Jersey 2.x on Tomcat 8?

I have Knowledge of the Web container and Tomcat and can deploy static and dynamic web sites. But I am new to REST and Jersey. I have read the 2.6 user's guide, reviewed many sites and youtube videos. There seems to be a lot of info on 1.x Jersey…
rss181919
  • 427
  • 1
  • 5
  • 16
13
votes
2 answers

Jersey 2.6 with Jackson JSON deserialization

My goal is to make web calls and convert returned JSON to POJOs. I'm trying to use Jersey+Jackson for this but am getting exceptions when running. My maven pom file includes the following dependencies -
ashutosh
  • 649
  • 1
  • 8
  • 21