Questions tagged [jersey]

Jersey is the open source, production quality, JAX-RS (JSR 311, JSR 339) Reference Implementation for building RESTful Web services.

Jersey is an open source framework for developing RESTful web services in Java and the production-ready reference implementation for JAX-RS 1.1 (JSR-311) and JAX-RS 2.0 (JSR-339). It is included in GlassFish open source application server and WebLogic application server from Oracle, and can be used with other web servers including the lightweight HTTP server included in JDK.

10403 questions
49
votes
7 answers

Jersey Client API - authentication

I'm using the Jersey client API to submit SOAP requests to a JAX-WS webservice. By default Jersey is somehow using my Windows Nt credentials for authentication when challenged. Can anyone explain where Jersey does this in the code? And can it be…
cdugga
  • 3,849
  • 17
  • 81
  • 127
49
votes
4 answers

How does one intercept a request during the Jersey lifecycle?

I've used Jersey for the better part of a year now and have just stumbled upon a problem to which I can't find the answer: how do you intercept (or hook into) the Jersey request lifecycle? Ideally, I'd be able to perform some custom…
cww
  • 1,128
  • 1
  • 8
  • 15
49
votes
11 answers

Change Dropwizard default ports

I have a Dropwizard based Jersey REST service running on the default ports 8080(service) and 8081(admin), I need to change the default ports to something that is less commonly used, I am not able to find any information to do so , can someone please…
user1965449
  • 2,849
  • 6
  • 34
  • 51
48
votes
7 answers

jersey web service json utf-8 encoding

I made a small Rest webservice using Jersey 1.11. When i call the url that returns Json, there are problems with the character encoding for non english characters. The corresponding url for Xml ("test.xml" makes it utf-8 in the starting xml-tag. How…
Jojje
  • 1,749
  • 3
  • 25
  • 44
47
votes
7 answers

org.glassfish.jersey.internal.RuntimeDelegateImpl NOT FOUND

I am using jersey for my project and tring to parse a URI from a string. UriBuilder.fromUri("http://localhost:8000").build(); The code is simple, but I get a error below java.lang.ClassNotFoundException:…
Spark8006
  • 635
  • 1
  • 7
  • 15
46
votes
2 answers

JAX-RS (Jersey) custom exception with XML or JSON

I have a REST service built using Jersey. I want to be able to set the MIME of my custom exception writers depending on the MIME that was sent to the server. application/json is returned when json is received, and application/xml when xml is…
Oskar
  • 1,047
  • 2
  • 12
  • 19
46
votes
6 answers

Handling custom error response in JAX-RS 2.0 client library

I am starting to use the new client API library in JAX-RS and really loving it so far. I have found one thing I cannot figure out however. The API I am using has a custom error message format that looks like this for example: { "code": 400, …
Chuck M
  • 1,175
  • 3
  • 17
  • 26
45
votes
5 answers

HTTPS using Jersey Client

How do I send GET requests using the Jersey Client API to a server which runs on the HTTPS protocol. Is there any sample code that I can use ?
Stormshadow
  • 6,769
  • 9
  • 33
  • 34
44
votes
3 answers

Handling Multiple Query Parameters in Jersey

In the web service I'm working on, I need to implement a URI with query parameters which look like /stats?store=A&store=B&item=C&item=D To break it down, I need to be able to use query parameters to specify data from multiple/all stores and data for…
ZKSteffel
  • 1,115
  • 5
  • 13
  • 22
44
votes
1 answer

Session management : How to generate Authentication token for REST service ? (Jersey)

I am trying to implement session management in my REST service. I came to know these guidelines while surfing : Not using server side sessions - it violates the RESTful principle. Using HTTP Basic authentication - Not possible right now, as I am…
dev
  • 11,071
  • 22
  • 74
  • 122
44
votes
10 answers

Jersey ContainerRequestFilter not triggered

I'm trying to use a ContainerRequestFilter to enforce some authentication on a Tomcat based Jersey application. I followed this document. Problem : the filter is never triggered The filter class : @Provider public class AuthFilter implements…
koyaga
  • 1,005
  • 1
  • 9
  • 14
43
votes
4 answers

What objects can I inject using the @Context annotation?

I'm new to JAX-RS and I'm trying to understand how the @Context annotation is supposed to work. At the javadoc there is a list of six classes (Application, UriInfo, Request, HttpHeaders, SecurityContext, Providers). However I find code on the web…
idrosid
  • 7,983
  • 5
  • 44
  • 41
42
votes
7 answers

jersey security and session management

Is there a way to get session management or security programatically in Jersey, e.g. web-application session management? Or are transactions, sessions, and security all handled by the container in which the Jersey application is deployed?
Adhir
  • 749
  • 3
  • 11
  • 20
42
votes
7 answers

Jersey + Jackson JSON date format serialization - how to change the format or use custom JacksonJsonProvider

I am using Jersey + Jackson to provide REST JSON services layer for my application. The problem I have is that the default Date serialization format looks like that: "CreationDate":1292236718456 At first I thought it is a UNIX timestamp... but it…
adrin
  • 3,738
  • 8
  • 40
  • 60
42
votes
5 answers

Listing all deployed rest endpoints (spring-boot, jersey)

Is it possible to list all my configured rest-endpoints with spring boot? The actuator lists all existing paths on startup, I want something similar for my custom services, so I can check on startup if all paths are configured correctly and use this…
Jan Galinski
  • 11,768
  • 8
  • 54
  • 77