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
13
votes
3 answers

Jersey jax.rs client 2.5 follow redirect from HTTP to HTTPS

I have a setup where tomcat server hosting my REST servers redirects calls from HTTP (port 9080) to HTTPS ( port 9443 ). I'm using jersey 2.5 implementation and cannot manage to configure the clients to follow redirections. I've found this SO…
devlearn
  • 1,725
  • 2
  • 17
  • 30
13
votes
8 answers

Unable to Mock Glassfish Jersey Client response object

I am having problems with creating a mock Response object to use with my unit tests. I am using org.glassfish.jersey.core.jersey-client version 2.3.1 to implement my RESTful client and mockito version 1.9.5 to help me with mock objects. Here is my…
12
votes
1 answer

Read JAX-RS body InputStream twice

I have a JAX-RS logging filter to log request and response details, something like this: public class LoggingFilter implements ContainerRequestFilter, ContainerResponseFilter { @Override public void filter(final ContainerRequestContext…
zappee
  • 20,148
  • 14
  • 73
  • 129
12
votes
2 answers

How to annotate JAX-RS on an interface while using Jersey

This question had been asked a few times before, however the answers doesn't seem to work and/or Jersey has moved on with more changes. I'm exposing some REST APIs using JAX-RS and Jersey (version 2.24). And I wish to annotate the interface with…
Alavalathi
  • 713
  • 2
  • 9
  • 21
12
votes
3 answers

"Could not find a suitable constructor" when extracted interface from my resource class with Jersey 2

How can I make Jersey understand that it should use a concrete class instead of the interface for a resource? I had a working app with a Status resource. Then I extracted an interface IStatus, and moved all JAX-RS annotations there. Now, I…
user384729
  • 403
  • 1
  • 7
  • 16
12
votes
2 answers

MultiException when custom jersey param throws exception

NOTE: All code to reproduce this problem is available at https://gist.github.com/SrikanthRao/c9fc35e6fe22a74ab40c http://localhost:8080/date/bean?date=2014-13-23 (using BeanParam) produces "{"code":500,"message":"There was an error processing your…
Srikanth
  • 11,564
  • 3
  • 23
  • 28
12
votes
1 answer

Jersey MessageBodyWriter not found for media type=text/plain

I'm trying to follow the Jersey docs to enable a non-200 response if an error occured (https://jersey.java.net/documentation/latest/representations.html#d0e3586) My code looks like…
Little Code
  • 1,315
  • 2
  • 16
  • 37
12
votes
1 answer

Maven dependencies needed for Jersey 2.x (2.6)

I'm trying to migrate from Jersey 1.x (1.2) to 2.x (2.6), I have trouble identifying the exact maven dependencies, jersey documentation is not comprehensive enough, it doesn't mention what maven dependencies are needed for the new version. Does…
Asela Senanayake
  • 351
  • 2
  • 6
  • 21
12
votes
1 answer

AsyncResponse ConnectionCallback does not fire in Jersey

For asynchronous programming, Jersey (JAX-RS) provides a ConnectionCallback callback that is to be executed when a connection is broken. From the Jersey docs: As some async requests may take long time to process the client may decide to terminate…
ricb
  • 1,197
  • 2
  • 12
  • 23
12
votes
1 answer

Detecting client-aborting request Jersey

I have Jersey providing a restfull web service. It happens often that the client aborts request done via ajax, with the ajax abort methods like is explained here abort ajax request On server side I get the following output. Which is not nice to see.…
LMG
  • 966
  • 1
  • 12
  • 28
12
votes
4 answers

How to use Asynchronous Callbacks in Jersey 2 in tomcat 7

How to use asynchronous callbacks of jersey 2 in tomcat server. I found some examples in Jersey manual : https://jersey.java.net/documentation/latest/user-guide.html#d0e8496. But the issue occurs when I'm tring to test following code with this:…
anij
  • 1,322
  • 5
  • 23
  • 39
12
votes
1 answer

Grizzly Server with static content and REST resource

I have a Jersey REST 2.5.1 service which is served through a Grizzly server. Everything works fine so far. I want to add some static content, which is also served through Grizzly and provided from my JAR file. Therefore I use CLStaticHttpHandler.…
qqilihq
  • 10,794
  • 7
  • 48
  • 89
12
votes
2 answers

Specify Custom Application Context

We are migrating some of our data services from Jersey 1.x using jersey-spring to Jersey 2.x using jersey-spring3. We have a few test classes that inherit from JerseyTest. Some of these classes use custom applicationContext.xml files that are not…
robert.andre.brink
  • 263
  • 1
  • 3
  • 9
11
votes
2 answers

java.net site closed, not able to access jersey documentation

I'm not able to access jersey documentation from, https://jersey.java.net/ Has jersey documentation been moved to a new location?
Arham
  • 2,072
  • 2
  • 18
  • 30
11
votes
0 answers

jersey warning "is not resolvable to a concrete type" on generic type

I'm using Jersey 2.25 and Google Guava BiMap within my service. I have declared a member variable of my webservice class with BiMap>. After my Jetty server starts I get the warning: WARNING: Parameter 1 of type…
Phil
  • 119
  • 5