Questions tagged [jersey]
Jersey is the open source, production quality, JAX-RS (JSR 311, JSR 339) Reference Implementation for building RESTful Web services.
10,327
questions
1
vote
1
answer
23
views
How to register AnnotationConfigWebApplicationContext in JettyHttpContainerFactory?
I am trying to integrate the Spring DI container using the jersey-container-jetty-http dependency.
Here is my code:
var applicationContext = new AnnotationConfigWebApplicationContext();
...
0
votes
0
answers
17
views
Use the same ObjectMapper/JsonSerializer for writing to file as used by Jersey for Responses
I'm using both JSON and XML Serialization in Jersey
ApplicationConfig.java
register(JacksonFeature.class);
Resource classes
@Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
Now for ...
0
votes
0
answers
17
views
How can the server error response be sent when the Jersey ThreadPoolExecutorProvider rejects the request?
So at server end, we have extended the org.glassfish.jersey.spi.ThreadPoolExecutorProvider for having a bounded BlockingQueue of Runnable tasks, overriding the corePoolSize and MaximumPoolSize.
When ...
0
votes
0
answers
20
views
Null Data when trying to insert Faculty Data during POST REQUEST
Hello I'm trying to insert the faculty data into the database with this json input, Faculty data needs to be inserted into the faculty table, student data into student table, subject data into subject ...
0
votes
0
answers
31
views
500 Internal Server Error when trying to insert faculty data with POST request
Hello I'm trying to insert data into multiple tables using one POST request with jersey. I don't know how to do it and this is the error so far:
This is the json data that I'm trying to do the POST ...
0
votes
2
answers
32
views
RESTful API, Jersey, POST request 415 Unsupported Media Type
I am new to RESTful services and jersey. I am trying to send a POST request (using postman) for this function.
@Path("/bikes")
public class BikesResource {
@POST
@Consumes ({...
0
votes
0
answers
29
views
How to create a POST request for a file upload
I am currently uploading some files via the API from Opentext Content Server 21.2. I have already implemented most of the method calls. I can upload files, create folders, delete files and so on. ...
0
votes
0
answers
16
views
com.sun.jersey.api.client.ClientHandlerException when trying to make an Envelope on DocuSign API
That's my code, I'm trying to make an Embedded Sending within my app, I have got to this point deconstructing some code from the API usage examples (that in my opinion, could be better as it has a lot ...
0
votes
0
answers
19
views
Memory consumption in my Jersey application keeps growing with time
Memory consumption in my application keeps growing with time. This app uses Lucene and search is performed using Rest endpoints that searched Lucene directories. Around 10 different directories are ...
0
votes
1
answer
31
views
What is best practise when creating new threads when inside a servlet container?
Today I was looking at some web app code that used Executors.newSingleThreadScheduledExecutor() on a per request basis to poll a REST API for a final status (think COMPLETE, FAILED, etc.). Knowing ...
1
vote
0
answers
44
views
How to create a RESTful API with Jersey + Grizzly + Guice + Hibernate
I've spent some time trying to create a RESTful API with Jersey, Grizzly, Guice and Hibernate, and I'm having a very difficult time wrapping my head around how to wire everything together. This is ...
0
votes
0
answers
37
views
OpenApi Swagger generate Java RestTemplate client
I'm using Openapi 3 to generate java http client.
In my maven plugin configuration, I'm using "resttemplate" :
So I was expecting as a result Spring RestTemplate classes to make HTTP calls.
...
0
votes
0
answers
14
views
javax.ws.rs.core.Response injection problem during deploy on Payara
I'm here for a short answer - I don't hide it -, trying to make working my rest api.
I copied a code template and the environment is the same: Payara5.
My class:
import javax.ws.rs.core.Response;
...
0
votes
1
answer
22
views
How do I get config paramerters from my web.xml in Jersey?
I have been trying to get parameters from my web.xml file from within my Jakarta JAX-RS resource. My web.xml is as follows:
<web-app>
<servlet>
<servlet-name>Jersey REST ...
1
vote
0
answers
37
views
How can I determine if I'm inside Jersey request scope?
I have some code that will run both inside Jersey request context and outside of Jersey request context (in another thread). I have a piece of data I want to access in both cases that's optional, but ...
0
votes
0
answers
32
views
URI template of the newly created target must not be null
I am facing the following exception when the below piece of code is executed.. I am using Jersey client to make the call.
public class EventListenerClient {
private static final String path = &...
0
votes
0
answers
43
views
SpringFox version compatibility with spring boot and Jersey
Configuring Swagger UI for a Jerysey + Spring boot application is complicated due to common dependencies.
Is there any documentation, that provides version compatibility of SpringFox with versions of ...
0
votes
0
answers
39
views
glassfish.jersey.server.internal.scanning.ResourceFinderException:java.io.FileNotFoundException:/home/1.8.3/BOOT-INF/classes(No such file or directory
I am trying to upgrade the spring boot version from 1.5.22.RELEASE to 2.2.4.RELEASE. I'm able to compile the application successfully and I'm able to start the application. I've fixed all the ...
0
votes
1
answer
46
views
Initialization failure on JAXRS Jersey SpringBoot REST API [duplicate]
A simple image upload controller consuming multipart/form-data fails to initialize.
The controller code
@POST
@Path("/image")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@...
0
votes
1
answer
32
views
Glassfish Jersey + Weld creates AbstractMethodError
I have a web-application based on JDK8, Tomcat7 (V2.1), Jersey (2.35) and CDI-Weld (2.4.8.Final)
Since I am starting tht web container, I receive this exception always twice. These two exceptions will ...
0
votes
1
answer
45
views
java.lang.ClassNotFoundException: com.sun.jersey.server.impl.container.servlet.Include from [Module \"deployment.myproject_dev.war\" from Service Modu
I am running a web project using IntelliJ and wildfly server. I have set up the project using the guidelines of the company, when I run wilfly server from intellij, I get the following error:
00:14:42,...
0
votes
1
answer
98
views
GET REQUEST does not return faculty data properly causes 500 Internal Server Error
I'm trying to return the faculty data with it's corresponding students, professors, subjects and grade, I get this Error 500:
I want postman to return this: to display the faculty that is searched by ...
0
votes
0
answers
45
views
why do I get this error while using maven, jax-rs, java, and rest?
Below is my code, I am using command line tool, jax-rs, rest apis and java
I get this error: "SEVERE: MessageBodyWriter not found for media type = text/plain, type=class java.util.ArrayList, ...
0
votes
1
answer
43
views
Jersey Support is Jersey 2.35 not Jersey 3.x
I have a server I built a few years ago which provides both REST endpoints and websocket.
It packages as a jar file (as opposed to war) with an embedded Jetty server. Rest is provided by Jersey(2.26)....
0
votes
0
answers
61
views
Multipart to JSON (Jackson) for HTTP request (Jersey)
ObjectMapper objectMapper = new ObjectMapper();
MultiPart multipart = new MultiPart();
multipart.bodyPart(new FormDataBodyPart("metadata", objectMapper.writeValueAsString(new Metadata(Type, &...
0
votes
0
answers
15
views
What client receives if exception happens in jersey server and exception mapper is not implemented at server
Consider there are two microservices A and B, both using glassfish jersey.
If A call B, and there happens and exception at B but no exception mapper available to handle that at B.
What A will see in ...
2
votes
1
answer
31
views
Spring OAuth 2.0 with jersey request : response 401 Unauthorized after entering correct credentials
Here is my problem: when I try to call this method, I got this error
InboundJaxrsResponse{
context=ClientResponse{method=POST,
uri=http://localhost:9001/oauth/token, status=401,
reason=...
0
votes
1
answer
26
views
<MessageBodyWriter not found for media type=application/json, using JDeveloper
I'm trying to return a json format data using Jakarta RESTful Web Services
While using Jdeveloper however I'm getting the following error with http internal server error 500
this the following ...
0
votes
0
answers
37
views
Jersey doesnt show list null value
I migrated from apache 7 to apache 10 using JAX-RS now when i have a null list it doesnt show up on the json, the most I can get is [] , but I need the list value of null to show
enter image ...
0
votes
0
answers
32
views
JAX-RS Client says returned a response status of 406 Not Acceptable but it working for JSON request
Stack trace:
[java] Exception in thread "main" com.sun.jersey.api.client.UniformInterfaceException: GET http://localhost:8080/xxxxx/resourcesP/xml/ returned a response status of 406 Not ...
0
votes
0
answers
31
views
Embedded Jersey 3 with Jetty into existing Application
i am trying to embed a HTTP-Server into an existing java Application. My goal is to create a small rest API as an interface to send commands to the server application it runs in.
I planned using ...
1
vote
0
answers
33
views
Session Control Java - GET Cookie from Request and Pass it to POST request
I am actually stuck in a data fetching API. In its documentation it has been mentioned that I have to make a call to the login API first then using its Authorization header and cookie (returned in ...
0
votes
0
answers
30
views
Java: Got Jersey's ContainerException when receiving formdata, but fine when received raw JSON data
I'm currently working on a plugin for Killbill, using Jooby for developing the servlet. The servlet will receive a notification from payment gateway and process the update into internal Killbill ...
-1
votes
0
answers
37
views
Jersey client with ApacheConnector provider and connection pooling failing after pool exhausted
I "upgraded" my jersey client to use the ApacheConnector provider and PoolingHttpClientConnectorManager to get more throughput out of my http connections and to save resources:
...
0
votes
1
answer
35
views
SQL syntax Error on Java Jersey GET CRUD operation
I'm trying to retrieve the information of the faculty with the students attending it and the subjects corresponding to the student.
Here is the SQL error:
java.sql.SQLSyntaxErrorException: You have an ...
0
votes
1
answer
15
views
Dropwizard/Jersey resource handler not correctly parsing json data
I'm working on a Dropwizard/Jersey backend. In one particular case, the data sent is not being parsed into the appropriate object. If I add @NotEmpty to a string field, I get a 422 error. Here is the ...
0
votes
1
answer
41
views
im getting a bad request 400 when I try to send some registration information to the server Cannot deserialize instance of out of START_ARRAY token
im still learning how to do this, and its my first time of full stack, im getting a an error 400 bad request when I try to parse json to the server and I don't know why, can you help me understand
my ...
0
votes
2
answers
62
views
why does tomcat show 404 response message for an existing resource?
I'm new to implementing web services and I'm doing it with jax-rs API using eclipse IDE for java-ee developers 2022.
I have written a simple web service that returns a response object including a java ...
0
votes
1
answer
29
views
Getting an SQL syntax error doesn't when trying to do GET REQUEST
Hello I'm trying to display the Student data with his corresponding subject based on the subject_id foreign key and displaying the result on GET REQUEST. I don't know how I need to rewrite the SQL ...
1
vote
1
answer
63
views
What happens if we have both jackson-jaxrs-json-provider and jersey-media-json-binding.jar in the class path at /WEB-INF/lib directory?
I am working on a web application managed by Apache ant builder. We recently upgraded jersey from 2.17 to 2.35 and all the related dependencies in the class path. After upgrading i noticed one error ...
0
votes
0
answers
38
views
How to upgrade jersey from version 2.17 to 2.35?
I am working on a legecy product which is using jersey 2.17 and have been asked to update to jersey 2.35.
What are all the pre-requisite thta needs to be taken care of while upgrading to version 2.35?
...
1
vote
0
answers
58
views
JSON key:values changes after upgrading jersey from 2.17 to 2.35
I have an web application which is currently on jersey-2.16. After I upgrade it to jersey-2.35 I see the JSON responses(JSON key to be specific) is getting capitalized.
JSON response in jesrsey-2.17
{
...
0
votes
0
answers
27
views
Issue with ExceptionMapper in Jersey
I have two classes that implements ExceptionMapper interface.
IllegalArgumentExceptionMapper to handle IllegalArgumentException:
@Slf4j
@Provider
public class IllegalArgumentExceptionMapper implements ...
0
votes
1
answer
37
views
Problem with JDK 8 vs JDK 15 Jersey WebResource
I have a problem with a web resource. I am requesting data from a server. If I run the program with JDK 15, everything works without problems. When I run the program with JDK 8 I get the error 403 ...
0
votes
0
answers
38
views
How to create FileDataBodyPart from a JSONObject?
I am trying to invoke a multipart/form-data request which is accepting a FileDataBodyPart (application/json) as parameter using Jersey client. At client-side, I have the input data in the form of ...
0
votes
1
answer
33
views
Java Jersey Consume Response is giving back 415 (unsupported media type)
Not sure what I have done wrong. I have my data model
Waypoint.java:
@XmlRootElement
public class Waypoint {
@XmlElement
private String test;
public String getTest() {
...
0
votes
0
answers
21
views
Persist HttpServletRequest request to database
TLDR: what is the best way to serialise a request to a db?
We want to save all incoming request data to a database so a job runner can pick this up later and process it.
There are different types of ...
0
votes
0
answers
20
views
how to translate ServletException to status code in jax-rs / jersey
One of the controller resolution failed because of a dependency creation failure. That dependency is met with 403 from aws. (I am assuming controllers are request scope and thus gets instantiated on ...
0
votes
1
answer
44
views
Project as dependency not packaged in .war file
I have a Jersey Tomcat project B that depends on another similar project A, I am developing on Eclipse.
When I run A on it's own, it runs with no problems. The export configuration for its build path ...
1
vote
1
answer
38
views
How does a request reaches Resource class in Jersey RESTful API?
I have been using Jersey, Tomcat, and Dropwizard for quite some time. But I am still not able to get what all actions happen from the point a request reaches port 8080 of a server to the point when it ...