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

How can I exclude null fields form my JSON request in Jersey?

What I'm trying to do is to avoid null fields in my request. I use this Jersey dependencies org.glassfish.jersey.core jersey-client 2.5
Alex
  • 2,091
  • 6
  • 31
  • 49
4
votes
0 answers

How can I run integration tests on a jersey application without restarting the server for every test?

I'm working on adding integration tests to an existing java web application which makes use of Spring and Jersey. Many of our other services are packaged as WARs, but this is packaged as a JAR with all dependencies. In said other services, we use…
4
votes
2 answers

How to use @FormParam if form elements are dynamically created

Since html form elements are dynamically created in this application, the number of elements are not known. How does one obtain element information using @FormParam annotation? For example, the below code obtains information for two form elements: …
vdep
  • 3,541
  • 4
  • 28
  • 54
4
votes
4 answers

How to unit test Jersey + Guice: ServiceLocator?

By using HK2's guice-bridge I managed to integrate Jersey 2.x with Guice 3.x. public class MyApp extends ResourceConfig { @Inject public MyApp(ServiceLocator serviceLocator) { packages("com.mycompany"); ... …
stephanos
  • 3,319
  • 7
  • 33
  • 47
4
votes
1 answer

ClassNotFoundException: javax.ws.rs.client.ClientBuilder

I´m trying to consume a Jersey Rest Service from a Web Application (Dynamic Web App in eclispe) as follows: Client client = ClientBuilder.newBuilder().build(); // Here is the error WebTarget target = client.target("url/rest").path("List"); String…
Keetah
  • 261
  • 1
  • 5
  • 15
4
votes
2 answers

java.net.UnknownHostException: Test: Test: unknown error Failed to get local InetAddress for VMID

I am using c3p0 for connection pooling in my spring-jersey1.8 restful web service. While starting the application, I am getting the following error: [com.mchange.v2.c3p0.impl.C3P0ImplUtils] INFO - Failed to get local InetAddress for VMID. This is…
user3608352
  • 397
  • 2
  • 5
  • 15
4
votes
2 answers

How do I set Content-Length when returning large objects in Jersey JAX-RS server

I sometimes want to return a large (several MB) binary object as a response from a JAX-RS resource method. I know the size of the object, and I want the Content-Length header to be set on the response, and I don't want chunked transfer encoding to…
Mikael Ståldal
  • 374
  • 1
  • 3
  • 11
4
votes
0 answers

jersey error java.lang.IncompatibleClassChangeError: Implementing class in jetty embedded

running jersey 2.5.1 and embedding jetty jetty-9.1.2.v20140210 I want an embedded jetty server capable of servlet 3x as well as jersey. I know that my jetty instance works as servlet handler and static file hander. however the following details I…
4
votes
1 answer

Jersey default media type if not Accept header is present

In Jersey User Guide i read the following: @GET @Produces({"application/xml", "application/json"}) public String doGetAsXmlOrJson() { ... } If both are equally acceptable then the former will be chosen because it occurs first. However in my…
IJR
  • 552
  • 1
  • 6
  • 10
4
votes
1 answer

Java REST API for Large file uploads

I'm developing a REST API using Jersey and I need to add large file uploading via REST API. I tried with small files and its working. However, the API will be used to upload large files which will have size of 2GB - 5GB, since it will be used to…
User 99x
  • 1,011
  • 1
  • 13
  • 39
4
votes
2 answers

JAX RS 2 using Jersey client getting " HTTP 404 Not found " but same URL is working on browser

I am new to JAX RS and Jersey 2. My simple rest resource server side program "Hello World" is working fine and I am able to access it by any browser and Advance Rest Client application of google chrome. But when I have written a JAX RS Jersey 2…
Pawan
  • 41
  • 1
  • 1
  • 2
4
votes
1 answer

Rest Service on Wildfly PathParam empty

I am building a REST Service using JEE 7 and deploying it on WildFLy 8. Everything seems to be working as it should except for the PathParam which is not. My code is as follows: web.xml:
Remcoder
  • 215
  • 2
  • 12
4
votes
2 answers

Interrupt a long running Jersey Client operation

I am using the Oracle Jersey Client, and am trying to cancel a long running get or put operation. The Client is constructed as: JacksonJsonProvider provider = new JacksonJsonProvider(new ObjectMapper()); ClientConfig clientConfig = new…
Sheldon Warkentin
  • 1,706
  • 2
  • 14
  • 31
4
votes
3 answers

java.lang.IllegalAccessError while trying to test a jersey REST webservice deployed on TomEE

I have a Jersey-based REST webservice which is working fine when deployed on Glassfish. When I deploy the same war file on Apache TomEE+ 1.6 version, i get the exception java.lang.IllegalAccessError: tried to access method…
user3465324
  • 121
  • 2
  • 4
4
votes
1 answer

Spring Jersey: java.lang.NoSuchMethodError: org.glassfish.jersey.server.ServerProperties.getValue?

My web.xml looks like InventoryApplication org.glassfish.jersey.servlet.ServletContainer
daydreamer
  • 87,243
  • 191
  • 450
  • 722
1 2 3
99
100