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
11
votes
2 answers

Jersey returns 404 with any error status code?

I have this useless endpoint in path "/test": @PUT public Response doSomething() { return Response.status(409).build(); } and I test it this way: @Test public void uselessTest() { put("/test").then().assertThat().statusCode(409); } But I get…
Héctor
  • 24,444
  • 35
  • 132
  • 243
11
votes
2 answers

Jersey 2.6 REST Service upgraded to Java 8 tomcat 8 exception:java.lang.NoSuchMethodError: javax.validation.Configuration.getBootstrapConfiguration

We have a war that expose rest service over jersey 2.6 with validation based on hibernate-4.2.7 validation (implements validation-api-1.0.0.GA). Everything worked fine before we upgraded to java 8 and tc-server 3.1.X. After upgrading to java 8 it…
Haim Raman
  • 11,508
  • 6
  • 44
  • 70
11
votes
1 answer

Closing connection in GET request using Jersey Client 2.22.1

I am using Jersey client for REST calls from Java code: org.glassfish.jersey.core jersey-client 2.22.1 In my GET request, …
Dev
  • 13,492
  • 19
  • 81
  • 174
11
votes
2 answers

Server Sent Event Client with additional Cookie

I am trying to unit test a Server Sent Event resource with an additional cookie. I am already using Jersey for the EventSource and JavaX for the client. The following code works fine: WebTarget target = ClientBuilder.newBuilder() …
svenkubiak
  • 645
  • 1
  • 7
  • 19
11
votes
2 answers

Cannot inject HttpServletRequest in ContainerRequestFilter via @Context jersey2.x and weblogic 12.1.3

I was not able to inject HttpServletRequest in ContainerRequestFilter via @Context in Jersey 2.22.1 using weblogic 12.1.3. I researched several places that this issue exists and in many places I see that it is fixed in Jersey 2.4, but I am still…
ravi.sankar.ch
  • 113
  • 1
  • 6
11
votes
2 answers

Optional params in REST API request using Jersey 2.21

I'm playing around with Jersey 2.21 and I'd like to know if it's possible to have an "optional" param which can, or not, be present in the request made to the server. I want to successfully access this two…
JorgeGRC
  • 1,032
  • 2
  • 18
  • 37
11
votes
3 answers

Jersey 2.x: How to add Headers on RESTful Client

I've already looked at How to add Headers on RESTful call using Jersey Client API, however this is for Jersey 1.x. How do I set a header value (such as an authorization token) in Jersey 2.21? Here is the code I'm using: public static String…
Joshua Kissoon
  • 3,269
  • 6
  • 32
  • 58
11
votes
1 answer

HK2 Factory invoked prior to Jersey filter when @Context is used for setter/field/constructor injection

I've been able to inject into my jersey resource from a filter as per How to inject an object into jersey request context?. This allows me to successfully inject into a method parameter: @GET public Response getTest(@Context MyObject myObject) { //…
rndgstn
  • 321
  • 2
  • 7
11
votes
1 answer

Jersey 2.x Custom Injection Annotation With Attributes

I am in the process of migrating from DropWizard 0.7.1 to 0.8.1. This includes migrating from Jersey 1.x to 2.x. In my implementation that uses Jersey 1.18.1, I had a MyProvider (changed all class names for simplicity's sake) that implements…
Eric Bernier
  • 459
  • 1
  • 7
  • 17
11
votes
1 answer

Why does jersey have no error log when the status is 500?

This is my web.xml: Jersey REST Service org.glassfish.jersey.servlet.ServletContainer
Chao
  • 865
  • 8
  • 21
11
votes
3 answers

Using default Providers/MessageBodyWriters in Jersey 2

Just starting with Jersey, I've been trying to reproduce the simple example in the latest Jersey documentation 'building responses'. This part, as far as I understand, should show how Response and ResponseBuilder can be used to easily return a…
Mark Tielemans
  • 1,528
  • 3
  • 20
  • 40
11
votes
1 answer

Performance degradation after moving to jersey 2

We're working on a server using spring 4, embedded jetty 9 and jersey. Recently, we moved to jersey 2.13 and we noticed a degradation in performance. I performed some investigations using YourKit. I saw that there is a massive CPU usage in…
nahsh
  • 729
  • 1
  • 6
  • 15
11
votes
3 answers

REST JAX-RS javax.ws.rs.ProcessingException:

I am getting below exception whenever my REST client code makes a call to the REST service using below code: Code: public void putWatcher(Watcher watcher) { System.out.println("In REST Client putWatcher.***********"); target =…
user3275095
  • 1,605
  • 4
  • 24
  • 36
11
votes
3 answers

Jersey 2.8 client is not ignoring unknown properties during deserialization

I am using Jersey Client 2.8 and trying to register my own Jackson configurator which will sets custom ObjectMapper properties. public class ConnectionFactory { private final Client client; public ConnectionFactory() { ClientConfig…
Onkar Deshpande
  • 301
  • 4
  • 15
11
votes
5 answers

jersey 2.7 issue while running it on apache tomcat 7.0

I am creating a jersey application using apache tomcat 7.0 and eclipse. I have created a dynamic web project in eclipse and have defined a resource file as:- import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import…
Timothy Drisdelle
  • 395
  • 3
  • 5
  • 14