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
92
votes
1 answer

What exactly is the ResourceConfig class in Jersey 2?

I have seen a lot of Jersey tutorials that starts with something like @ApplicationPath("services") public class JerseyApplication extends ResourceConfig { public JerseyApplication() { packages("com.abc.jersey.services"); } } without…
Chin
  • 19,717
  • 37
  • 107
  • 164
91
votes
18 answers

java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer

I am trying to build a simple hello world application for two days using Jersey + Google app engine. For simple AppEngine project I followed these tutorials and both works just…
M-Wajeeh
  • 17,204
  • 10
  • 66
  • 103
88
votes
2 answers

Why use JAX-RS / Jersey?

Sorry, this questions sounds silly, but after developing some of my RESTful services using Jersey, I asked myself the question -- If REST is just an architecture, and not a protocol like SOAP, why do we need a specification like JAX-RS? I actually…
WinOrWin
  • 2,107
  • 3
  • 19
  • 25
86
votes
1 answer

Difference com.sun.jersey and org.glassfish.jersey

What is the difference between com.sun.jersey and org.glassfish.jersey? Currently I have my REST service working on com.sun.jersey and I want to write tests, but I can't find a good tutorial for this (nothing seems to work). However, I can find good…
user1226868
  • 1,708
  • 5
  • 18
  • 29
84
votes
10 answers

RESTful application on Google App Engine Java?

I would like to create a RESTful app on Google App Engine. I would like to provide XML and JSON services. I have briefly experimented with Restlet, Resteasy, and Jersey. I haven't had much success with any of them, other than some simple examples in…
JP Richardson
  • 38,609
  • 36
  • 119
  • 151
82
votes
6 answers

How to handle CORS using JAX-RS with Jersey

I'm developing a java script client application, in server-side I need to handle CORS, all the services I had written in JAX-RS with JERSEY. My code: @CrossOriginResourceSharing(allowAllOrigins =…
user2773716
  • 865
  • 1
  • 7
  • 5
81
votes
25 answers

The ResourceConfig instance does not contain any root resource classes

What's going wrong here? The ResourceConfig instance does not contain any root resource classes. Dec 10, 2010 10:21:24 AM com.sun.jersey.spi.spring.container.servlet.SpringServlet initiate SEVERE: Exception occurred when…
cmani
  • 979
  • 1
  • 6
  • 10
80
votes
14 answers

MessageBodyWriter not found for media type=application/json

I am facing issues while consuming JAX-RS services as JSON. Below I have added my code. This is my service class: //Sets the path to base URL + /hello @Path("/hello")…
Fahad Mullaji
  • 1,332
  • 5
  • 15
  • 30
78
votes
2 answers

Why order of Maven dependencies matter?

I thought that the order of Maven dependencies doesn't matter before and regard this as a pro of it. And this is my old pom.xml's dependencies: org.glassfish.jersey.containers
Elderry
  • 1,902
  • 5
  • 31
  • 45
78
votes
1 answer

Example of using StreamingOutput as Response entity in Jersey

Can someone post an example of how in Jersey to set StreamingOutput as an entity in a Response object? I haven't been able to find an example of this.
David Loy
  • 963
  • 1
  • 8
  • 14
77
votes
3 answers

How to POST a JSON object to a JAX-RS service

I am using the Jersey implementation of JAX-RS. I would like to POST a JSON object to this service but I am getting an error code 415 Unsupported Media Type. What am I missing? Here's my…
Naresh
  • 23,937
  • 33
  • 132
  • 204
76
votes
6 answers

File upload along with other object in Jersey restful web service

I want to create an employee information in the system by uploading an image along with employee data. I am able to do it with different rest calls using jersey. But I want to achieve in one rest call. I provide below the structure. Please help me…
Sambit
  • 7,625
  • 7
  • 34
  • 65
75
votes
4 answers

How to choose between Jersey, Apache Wink and JBoss RESTEasy?

I just heard about Apache Wink, and I was wondering what differences it had compared to Jersey or JBoss RESTEasy. What can be done in one that the other two can't? We've been using Jersey for some of our internal projects mostly for it's…
Nick Klauer
  • 5,893
  • 5
  • 42
  • 68
75
votes
5 answers

Java REST implementation: Jersey vs CXF

What do you think is the advantages/disadvantages between this two libraries? Which of these two are best suited for production environment? By the way I will be using JSON instead of XML. I also would like to know what library is most supported by…
dexter
  • 1,869
  • 2
  • 14
  • 13
73
votes
10 answers

Ignore self-signed ssl cert using Jersey Client

I'm using the Jersey Client library to run tests against a rest service running on jboss. I have https set up fine on the server (running on localhost), using a self signed cert. However whenever I run my tests with the https url I get the…
Chris Salij
  • 3,096
  • 5
  • 26
  • 43