Questions tagged [jersey]
Jersey is the open source, production quality, JAX-RS (JSR 311, JSR 339) Reference Implementation for building RESTful Web services.
10,415
questions
0
votes
1
answer
19
views
Handling "Conflicting Setter Definitions" with Jackson in Jersey for Overloaded Methods
Hello Stack Overflow community,
I am encountering an issue with Jackson in a Jersey-based application, specifically dealing with "Conflicting setter definitions for property" error related ...
-1
votes
0
answers
56
views
Unresolved compilation problem: XmlRootElement cannot be resolved to a type
I am trying to use the @XmlRootElement annotation on the Alien class but I am getting the following exception:
jakarta.servlet.ServletException:
org.glassfish.jersey.server.ContainerException: java....
-1
votes
1
answer
31
views
java.lang.NoSuchMethodError: boolean org.glassfish.jersey.internal.config.SystemPropertiesConfigurationModel.hasProperty(java.lang.String)
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>9.1.0</version>
<scope>provided</scope>
&...
1
vote
0
answers
50
views
How to configure two separate Jersey servlet containers for individual endpoints
I am implementing the following two Jersey servlets in the server side:
<servlet>
<servlet-name>DocService</servlet-name>
<servlet-class>org.glassfish.jersey....
0
votes
0
answers
20
views
I can't upload a war file by wildfly 10 because of missing dependencies
I tried to upload an application called app.war to wildfly 10 server. This wildfly was turned on using java 1.8u172.
On the other side, I generated the war file using Netbeans. The java platform to ...
0
votes
0
answers
22
views
CANNOT register maven jersey service as Eureka Client
I am aware of some dependencies problem between Spring Cloud and Jersey.
I need to register my TeaStore service (currently trying with one of them) made in Maven, Jakarta, Jersey and NOT spring.
This ...
0
votes
0
answers
16
views
Issue while migrating jersey API from WAS8.5 to WAS9
I am trying to migrate jersey API from WAS 8.5 to WAS 9.
While starting application in WAS 8.5 Jersey is getting initialize properly as below:
Scanning for root resource and provider classes in the ...
0
votes
0
answers
26
views
RolesAllowedDynamicFeature not invoked in Jersey
My Jakarta Application class is:
@ApplicationPath("/app")
@RolesAllowed("admin")
public class Application extends ResourceConfig {
public Application() {
System.out....
1
vote
1
answer
53
views
Jersey: StreamingOutput in a chunked fashion without setting OUTBOUND_CONTENT_LENGTH_BUFFER to 0?
I am using Jersey to stream "chunked" output, and my client wishes to read and display partial results as they are streamed.
Here is example code of what I am doing:
@Path("streaming&...
0
votes
0
answers
24
views
Why is Jersey not seeing my new endpoint method?
I have a SpringBoot/JAX-RS service that has been working fine for a while. I'm trying to add a temporary endpoint method to one resource class with existing endpoint methods. For some reason, Jersey ...
0
votes
1
answer
67
views
Migrate Jersey webservices to Java 17 java.lang.NoClassDefFoundError: Could not initialize class org.glassfish.jersey.internal.inject.Providers
I'm currently in the process of upgrading my Maven-based Java project from JDK 8 to JDK 17. During this transition, I've encountered a specific error message that's impeding my progress.
Currently i'm ...
0
votes
0
answers
17
views
Using Jersey how to write an api which produces text/event-stream or json determined at runtime
i am currently trying to implement an api which depending on the value of a query parameter will produce either text/event-stream response or json response. Is there any way to do that using Jersey ...
0
votes
1
answer
69
views
Spring 6 and Jersey 3 -> 404 Not Found
I am migrating from Spring 5 to Spring 6.0.13 and I am having problem with Jersey 3.1.1.
In WebInitializer :
public class WebInitializer implements WebApplicationInitializer {
@Override
...
0
votes
0
answers
42
views
Jersey not invoking GSON Handler for String
I created a simple project to test jersey + GSON, available at https://github.com/i23098/jerseyGsonHandler
I created GsonMessageBodyHandler implements MessageBodyReader<Object>, ...
0
votes
0
answers
14
views
During tomcat/jersey shutdown while long polling, the ServletContextListener hook is delayed by 7 seconds, why?
My Setup is Windows10 / eclipse / tomcat8 / jersey.
I have a simple backend that handles some ajax long polling from the front-end.
Now, if there is no front-end running, when I want tomcat to stop, I ...
0
votes
0
answers
13
views
Preventing Jersey log from logging in catalina.out
I have following code to create Jersey client (my application is using an older version of Jersey).
Client client = Client.create();
client.addFilter(new LoggingFilter(System.out))
The problem: my ...
0
votes
1
answer
189
views
Configuration Swagger Spring Boot 2.7 + Jersey
I configured a swagger for a private API on a spring boot application. These endpoints are made with spring.
There is also a public API on the same server with endpoints made with Jersey.
I configured ...
0
votes
0
answers
17
views
Handle batching of requests inside an endpoint method
I have a use case to collect requests from clients , batch them and then the combined request is to be sent for processing, with the result of processing to be having sent back to each of the clients....
0
votes
0
answers
17
views
Jersey web app failing with Injection failure error [duplicate]
I have a simple web application using Jersey 2.39 and hosted in jetty.
my web.xml settings are
<servlet>
<servlet-name>TestServlet</servlet-name>
<servlet-class>
...
0
votes
0
answers
12
views
Internal server error Maven web service (jersey-quickstart-grizzly template)
I have the following pom.xml file configuration. I'm new in Java and try to run a basic restful web service using Maven.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="...
0
votes
1
answer
219
views
How to make PATCH request using Jersey client?
WebTarget target = client.target(url); client.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND,true);
Response response = target
.request(MediaType....
1
vote
1
answer
52
views
JAX-RS Apache CXF vs Jersey implementations. Encoding
Just wondering if such a code shouldn't return the same using different implementation of JAX-RS? I'm not really into Java.
import java.util.*;
import javax.ws.rs.client.Client;
import javax.ws.rs....
0
votes
0
answers
48
views
Fix Tomcat 10 400 for multipart/form-data
I am using Tomcat 10 and Jersey 3.1.0 (with jersey-media-multipart).
Then I have setup this resource:
@POST
@Path("/upload")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces(MediaType....
0
votes
0
answers
36
views
Getting request entity in Jersey's ClientRequestFilter
My application is using Jersey client and I want to deploy it on AWS and access resources that require request authentication using AWS SigV4.
I have looked at client code examples specific to the ...
0
votes
0
answers
107
views
Jersey 3 does not work with Tomcat 10 and return 404
I am having application that use Tomcat 10.
Java 17
My build System is Gradle.
I am trying to use Jersey 3 Servlet
My web.xml config:
<servlet>
<servlet-name>jersey-servlet</...
0
votes
1
answer
314
views
Upgrading spring boot 3 with Jersey client: ClassCastException: attempting to castjar:file:
I'm upgrading my java spring boot app to spring boot 3.
I upgraded org.glassfish.jersey.core:jersey-client from version 2 to 3.1.3, that use jakarta instead of javax package.
The problem is that one ...
0
votes
1
answer
118
views
java.lang.IllegalArgumentException: The implementation class org.glassfish.jersey.inject.hk2.RequestContext must be in the Singleton scope
I am upgrading a Tomcat web applications from Tomcat 9.0.78 to 10.0.14 and moved all my imports from the javax.servelet name space to jakarta.servelt name space and have also upgraded hibernate.
While ...
0
votes
0
answers
49
views
Jersey @Valid Annotation Issue: NullPointerException at InjectingConstraintValidatorFactory
I am working on a Java Jersey application where I need to validate JSON request bodies using the @Valid annotation. However, I am encountering a NullPointerException that I can't seem to resolve. ...
0
votes
0
answers
21
views
unable to inject multiple datasources into jersey
Hi Im tring to inject multiple datasources into jersey using mybatis.
`
class app extends RestApplication<config>
{
MyBatisBundle mybatis=new MyBatisBundle();
public void ...
0
votes
1
answer
38
views
maven Assembly plugin is not appending/merging META-INF/services/ spi.AutoDiscoverable
We are using and the jar build with dependencies will have
META-INF/services/org.glassfish.jersey.internal.spi.AutoDiscoverable with value "a.b.client.sdk.common.client.AutoConfigService"
...
0
votes
2
answers
28
views
Cannot get the name of zip file created by jersy api
I created jersey rest post api with spring boot to return a zip file with such a filename, with postman i can download the zip file but not with real filename and in the response headers i can't find ...
0
votes
1
answer
198
views
Is Jersey client 3.1.3 jdk8 compatible?
I use
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>3.1.3</version>
</dependency>
...
0
votes
0
answers
21
views
How can I config my JerseyConfig with docker
I tried to make a REST API with spring and launching it with docker. But my jerseyConfig seems a bit broken.
I can run my spring API on my computer but it doesn't seem to work on docker and I don't ...
1
vote
0
answers
31
views
How to modify Jersey client code to do client certificate authentication?
We have some code that was written a while ago that acts as an SSL client but only does server-authenticated SSL:
protected String retrieveResponse(String request) throws IOException {
Client ...
0
votes
0
answers
32
views
Jersey - how to continue with next servlet filter on 404?
I'd like to use Jersey (3.1.3) to filter http requests at endpoint /x as follows:
if /x exists: serve the request,
if /x does not exist: continue with the next servlet filter in the chain that may ...
0
votes
1
answer
78
views
NoSuchMethodError: org.glassfish.jersey.internal.LocalizationMessages.WARNING_PROPERTIES()Ljava/lang/String
I'm getting this error below, I've tried excluding Jersey from every dependency and have the versions synced, but still getting the error. I've isolated every jersey I can think of. Could FasterXML be ...
0
votes
1
answer
44
views
How to access header value passed while calling api in postman?
@POST
@Path("/id")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public Response getDetails(DetailsRequest detailsRequest) {[![enter image description here][1]][...
0
votes
0
answers
27
views
what is the class com.sun.jersey.config.feature.DisableXmlSecurity in latest jersey versions
I am working on migration of a project which uses below jersey param
com.sun.jersey.config.feature.DisableXmlSecurity
I am not able to find a replacement for the same in latest jersey library which is ...
0
votes
0
answers
38
views
javax.servlet.ServletException and The ResourceConfig Error
I have a very simple HelloWorld JAX-RS application which is using jersey-servlet. Getting the above error, no matter howmuch I try I keep getting this error. I even corrected the package names in web....
1
vote
0
answers
60
views
Can't find Javax class in latest Jersey/Dropwizard version in Maven project
As I understand it, Jakarta replaced the Javax namespace a bit ago, and Jersey did the necessary work to support this change as of v3.0. I've got a legacy project that I've been trying to drag from ...
0
votes
1
answer
235
views
How do I upgrade Helidon, Jersey, Spock etc. to Java 17?
Can someone point me to a project, preferably GitHub, where there is an example of our key technologies working under Java 17 so I can get a sense of harmonious dependency versions?
org.spockframework....
0
votes
0
answers
18
views
Looking for a correct way to inject a jersey resource to a POJO class
I have implemented Jersey SSE, My requirement is to send notificaion to connected clients when there is a data chnage on the server.
Well My SSE is working, now I am trying to tie it up with the code ...
-1
votes
1
answer
31
views
Jersey RESTful mapping returns null object or MismatchedInputException
My frontend server sends a json built from a VueJS form.
I am trying to get, to map and to parse this json using Jersey 2.32.
{
"objetDesLiensDuTheme": {
"id": 7195,
...
0
votes
0
answers
43
views
Undetermined registration of resources while migrating to Jersey 3.1.x
While migrating from Tomcat 9.x/Jersey 2.x to Tomcat 10.1.x/Jersey 3.1.x we are recognizing indetermined behaviour of registering resource classes when deploying a webapp as .war file. Our .war file ...
0
votes
0
answers
42
views
Dropwizard Jersey Configuration to group resources to specific rootPaths
I'm working on a project with many existing API endpoints define across many resource classes. Currently we have a urlPattern defined as /api/* but want to add another set of resources for internal ...
0
votes
0
answers
21
views
Not able to see localhost:port/sample/OpenApi.json after configuring jetty server with swagger-ui
i have configured a jersey servlet for exposing swagger ui using the configuration mentioned here.
Link.
@ApplicationPath("/sample")
public class JerseyApplication extends ResourceConfig {
...
0
votes
0
answers
123
views
java.util.ServiceConfigurationError: com.fasterxml.jackson.databind.Module: com.fasterxml.jackson.datatype.jdk8.Jdk8Module not a subtype
In my project We used jersey 2.40 and jackson-core 2.15.2.
When we run this project I get below error.
Exception: A MultiException has 2 exceptions. They are:
java.util.ServiceConfigurationError: com....
0
votes
0
answers
72
views
Spring Boot not accepting the given url. Giving 400 instead of 404
I am trying to map a URL with REST API in Spring Boot.
url: http://localhost.charlesproxy.com:8080/content/storage/path/someid/x/y/resource/{"reltype":"http://ns.example.com/...
0
votes
0
answers
25
views
IllegalArgumentException Error while trying to update aws java SDK version
I have 2 project mycodecore and mycodeweb, mycodeweb is a jersey web project and it uses mycodecore as dependency which has all aws sdk implementation,
recently I am trying to update aws quicksight ...
1
vote
0
answers
15
views
How do I dump the configuration of a jersey web application?
When things go wrong with a jersey web application, you hit endpoints that you believe exist, and those endpoints return 404 Not Found.
The code 404 Not Found means that what one believes is so, and ...