7,768 questions
0
votes
0
answers
50
views
Why does JAX-RS UriBuilder not double encode
Consider this method:
import javax.ws.rs.core.UriBuilder;
import java.net.URI;
public class AnyParamRedirecter {
/**
* Generate a URI to target.com with one query parameter "...
0
votes
1
answer
100
views
JAX-RS REST API returns 200 OK immediately, but JSON body arrives delayed only on my computer
I have a JAX-RS REST API that gets live images from a camera.
The camera returns a multipart response (XML + JPEG), which I parse in the service and then return as JSON in the response.
Problem:
When ...
0
votes
1
answer
79
views
DOCX file generated by JAX-RS API shows compatibility error in Word
I am generating a .docx file in a JAX-RS API.
When I save it directly to disk like this:
try (FileOutputStream fos = new FileOutputStream("localSavedFile.docx")) {
outputDocument(fos);
}
...
0
votes
0
answers
47
views
How to Override OIDCClientRegistrationProvider in Keycloak 26 with Custom Fields in the Request Body
I'm trying to override the built-in OIDCClientRegistrationProvider in Keycloak 26 to handle a custom field webhook_uris in the OIDC client registration payload. This worked in Keycloak 15, but fails ...
0
votes
0
answers
51
views
Setting up the validator gives errors Jersey
I am trying to set up the bean validation in my jersey server. I would like to assure that everytime I get an email in this bean it is not null. But with this current setup, everytime jersey tries to ...
0
votes
0
answers
110
views
JAX-RS (Quarkus) How to get resource method from URL?
I need to call a resource (resource B) from another resource (resource A), but I don't know which resource is B; I am getting a URL as a string.
How do I get which resource/method matches the given ...
0
votes
0
answers
43
views
DuplicateDeploymentIdException when deploying multiple similar WARs in TomEE
I am deploying two separate same WAR files on Apache TomEE 10+. The WARs are named:
webapi.war
webapi1.war
Error Logs:
`Caused by: org.apache.openejb.DuplicateDeploymentIdException: Application cannot ...
1
vote
1
answer
65
views
Is it compatible MatrixParams in SWAGGER UI with JAXRS annotations?
Im working on a project based on JAXRS annotations. Im configuring a Swagger UI to sumarize all the endpoints of the project and to execute them from there. Im implementing OAS 3 which supports ...
0
votes
0
answers
64
views
JAX-RS method defined in parent class not exposed under base: {"REST.request": { } } section of metrics endpoint
I have a parent class that exposes as a REST endpoint a common method for all my rest services.
My child classes which are JAX-RS resources implement their own specific methods and expose their ...
0
votes
0
answers
50
views
How to debug "Connection refused" within a running container?
I have a Quarkus application that uses the jakarta.ws.rs.client.Client to call another REST endpoint. On my local PC everything works fine.
However, after deploying it to our DMZ, that Quarkus ...
0
votes
1
answer
43
views
delay call to readEntity on Response
(Jakarta/RestEasy)
My application is a client to a third-party REST api. I'm trying to add an abstraction layer when calling one of its endpoints.
This abstraction layer could be anything, but for ...
0
votes
1
answer
88
views
providing support of progress of File transfer in percentage
How to Show File Transfer Progress Percentage in Java with HttpURLConnection?
I am currently working on an API that downloads a file from a server and writes the content to a specified location using ...
0
votes
0
answers
32
views
Jersey Root Resources and Sub-Resources Performance for Large-Scale Applications
I'm working on a backend for a frontend application for a portal that has grown over the last years and already counts over 2500 unique endpoints/rest methods. We're using Jersey for our RESTful ...
1
vote
1
answer
178
views
CDI 4.0 Integration with Jakarta REST 3.1 in WildFly server
I am trying to understand JAX-RS, CDI integration in Wildfly, specifically how the bean lifecycle looks like. The following behaviour is not what I expected. Below is drilled down example.
@Dependent
@...
0
votes
1
answer
106
views
Format of java.sql.Timestamp in JSON has changed
When upgrading a rest service from JEE7 to jakarta.jakartaee-api (v 10.0.0) there is an unwanted change in format of java.sql.Timestamp timestamps. The timestamps used to be like this
{"timestamp&...
0
votes
1
answer
86
views
CDI in Jakarta REST without @Context (deprecated)
If @Context is going to be deprecated, what I would one accomplish what @Context Application does (in an implementation-neutral way) when using SeBootstrapfor instance, given that the Application ...
0
votes
0
answers
26
views
API path is 404 Not Found for JAXRS and Jersey project
I am starting to use JAXRS to build a small application. I started with just a simple API that returns a hello world string on an API GET /api/hello. Here is my progress but I can't seem to let it ...
0
votes
0
answers
46
views
How to read Form Data in JAX RS response?
Problem: I have to make JAX RS client call for GET HTTP method. But, the response is a Form data. I need help in knowing how to read the response which is of type FormData.
Ex:
ClientConfig config = ...
0
votes
1
answer
80
views
JAX-RS Tomcat 9.0.21 404 – Not Found when accessing resource
I am trying to learn JAX-RS by using JDK 17, Maven 3.9.5, Tomcat 9.0.21. I used the archetype jersey-quickstart-webapp from GlassFish to generate a project.
I simply built the project and deployed the ...
1
vote
1
answer
322
views
How do I do a multipart/form file upload with jax-rs on wildfly 34 (jakartaee 10 project)
I've the following methods which are not working on Wildfly 34 but working perfectly on OpenLiberty:
@POST
@Path("/upload")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void uploadFiles(@...
1
vote
1
answer
173
views
How to properly add HTTP header in WebService Client (Spring Web Services)
Does anyone know how to properly add HTTP headers in a Soap Web Service client generated by jaxws from a wsdl file?
I can access the services from SoapUI, but when I try to access them from my Spring ...
2
votes
2
answers
311
views
Summary and description for the Path Item Object of OpenAPI
I am developing REST API using quarkus-rest implamentation of Jakarta REST (formerly known as JAX-RS). I also use quarkus-smallrye-openapi extension to generate my API specification (OpenAPI v3).
How ...
0
votes
1
answer
106
views
I have a java webapp hosted in tomcat using JAX-RS that i get a 404 when trying to access endpoint
I have a webapp where I am deploying the war file to a tomcat server. I am always getting a 404. In the catalina.out, i see the deployment but get no error.
The app runs fine as an exploded war on my ...
0
votes
1
answer
50
views
MicroProfile Rest Client : how to uncompress gzip Content-Type
I'm calling an endpoint to get a CSV file :
@RegisterRestClient
@Path("/catalogs")
public interface Client {
@GET
@Produces(MediaType.TEXT_PLAIN)
@Path("/{catalog}/content/...
0
votes
1
answer
67
views
JAX-RS: Several different ContextResolver<ObjectMapper>?
I have a backend server running on JAX-RS (RestEasy flavour).
Some of the endpoint responses contain dates, which I want to be formatted as ISO strings.
@Value // Lombok annotation
public class ...
0
votes
0
answers
37
views
JAX-RS uri template not capturing expected string
I have a simple api
@GET
@Path("res/{res-path :.*}")
public Response getRes(@PathParam("res-path") String resource) {
System.out.println(resource);
}
I was under impression ...
2
votes
1
answer
66
views
JAX-RS implementation for Vert.x that supports coroutines?
There are samples for using JAX-RS and coroutines with Vert.x.
But how can I have both?
Resteasy-vertx doesn't seem to support coroutines.
Quarkus REST (FKA RESTEasy Reactive) supports JAX-RS, ...
1
vote
1
answer
59
views
@RolesAllowed in Apache CXF
I'm trying to migrate a JAX-RS application from Jersey to Apache CXF. I'm not using Spring, so I'm trying to configure it by extending javax.ws.rs.core.Application.
I also implemented
public class ...
0
votes
1
answer
42
views
JAX-RS resource is not forwarding to JSP file
I'm having trouble creating a web service to redirect to a JSP file. I'm getting the following error when running the url of the created web service:
ERROR [stderr] (default task-2) java.lang....
0
votes
1
answer
81
views
Migrate JAX-RS project from Jetty to OpenLiberty
I would like to migrate a simple JAX-RS project from Jetty to OpenLiberty.
The problem are two methods of the ResourceConfig class (Jersey's), that are called at the end of the constructor to ...
1
vote
1
answer
57
views
Swagger useGenericResponse with specific endpoints
Right now, using swagger-codegen-cli v3.0.24 (unable to use latest at the moment) to generate jaxrs-cxf server API, I can set the property in my config.json useGenericResponse to true to support using ...
0
votes
1
answer
122
views
JaxRS: Generating incomplete JSON, Unable to serialize property 'finalScores' from FinalScoreResponse
I have an endpoint that when called gives this error:
2024-10-23 12:21:14,135 SEVERE [org.ecl.yas.int.SerializationContextImpl] (executor-thread-3) Generating incomplete JSON
2024-10-23 12:21:14,136 ...
0
votes
0
answers
26
views
Tomcat JAX-RS 404 page not found [duplicate]
I have created a jakarta rest service project
and then when I run it, I got 404 error
there's no interface after I visit the path.
I created these two classes:
package com.mpsoft.generateur;
import ...
0
votes
1
answer
76
views
remove JSESSIONIDVERSION in set-cookie
In my project, I want to rename the JSESSIONIDVERSION cookie. I have already renamed the JSESSIONID to another name, but I am unsure how to rename JSESSIONIDVERSION.
We are using JAX-RS, NGINX, Payara ...
0
votes
1
answer
68
views
How to obtain the name of a bad QueryParam in the custom BadRequest message?
Consider this JAX-RS / RestEasy endpoint:
@GET
@Path("/my-endpoint")
@Produces(MediaType.TEXT_PLAIN)
public Response myEndpoint(@QueryParam("mySuperParam") @NotNull final ...
0
votes
2
answers
69
views
How to read a data object via a factory method from the JSON body in a REST request in JAX-RS?
In a Java REST service using JAX-RS (Jersey 3.1.1, Jackson 2.14.2), I have an immutable data object, say:
public class MyDataObj {
private int a;
public static MyDataObj valueOf(String jsonStr)...
0
votes
0
answers
75
views
Entity stream is closed in ContainerResponseFilter
I am trying to capture the request body string using entity stream in both request filter and response filter. But when I try to fetch request body string entity stream in the response filter, I get ...
0
votes
0
answers
115
views
JSONObject["metaData"] is not a string (class org.json.JSONObject). after upgrading from Java 11 to Java 17
I've recently upgraded from Java 11 to Java 17. After this upgrade, I started getting the above issue, I don't face this issue with JDK 11.
The JSON string that causes the issue contains nested JSON ...
1
vote
0
answers
174
views
OpenFeign/Feign with JAX-RS support for BeanParam only works on paper. Change my mind
I am trying to use OpenFeign/Feign to latch onto my JAX-RS based REST API. In most cases I use @BeanParam POJOs to capture all @PathParam, @QueryParam, etc. parameters. Unfortunately, Feign fails to ...
0
votes
1
answer
206
views
How to select a RESTEasy Client Backend for the MicroProfile Rest Client?
Regarding Jersey, it allows the selection of the underlying Client Transport Connectors using a property [1], as shown in the following example:
Client client = ClientBuilder.newBuilder().
...
1
vote
0
answers
23
views
How to retrieve the matching @Produces content type in a resource method?
I have a resource method that can produce JSON-LD (preferred option) or JSON so I used the following annotation:
@Produces({MEDIA_TYPE_JSON_LD + "; qs=1", MediaType.APPLICATION_JSON + ";...
-1
votes
1
answer
3k
views
jakarta.servlet.ServletException: Handler dispatch failed: java.lang.NoClassDefFoundError: com/sun/xml/bind/api/JAXBRIContext"
I'm working on spring parent-2.7.18 to 3.1.10 version migration and I'm using Java 17 version.
I'm getting below error after the migration of Spring-parent 2.x.x to 3.x.x version.
jakarta.servlet....
1
vote
0
answers
115
views
JAX-RS Resource Not Found (404) When Running on Open Liberty
I'm working on a Maven project that uses JAX-RS to create RESTful web services and deploys them on Open Liberty. Despite configuring my application, I keep encountering a 404: SRVE0190E: File not ...
1
vote
0
answers
127
views
Exception jax-rs rest endpoint RESTEASY003020: Bad arguments passed
I try to write a REST endpoint on javax.ws.rs
My controller, service:
@Path("/v1")
@Stateless(mappedName = "ejb/MyController")
@LocalBean
public class MyController {
@EJB
...
-2
votes
1
answer
209
views
JAX-RS resource returns HTTP/1.1 404 Not Found after Jakarta migration
I've upgraded an 'old' (was working) EE Application with JSON which did work with 'javax'. Now on EE 10.x & Jakarta.
implementation("com.google.code.gson:gson:2.11.0")
Using:
import com....
1
vote
1
answer
47
views
How to use Odoo REST Services with JAX-RS?
I am trying to write a Java web application that runs on A Tomee application server. The application uses a number of Jakarta EE technologies such as JAX-RS, Jakarta Faces, and CDI. The basic ...
0
votes
1
answer
50
views
How can I set the port of an OSGi JAX-RS Whiteboard Service?
I am doing this tutorial to learn OSGi. It creates a single JAX-RS Whiteboard service that serves a simple web page on port 8080. On my machine, it can't start because port 8080 is already in use. How ...
0
votes
1
answer
209
views
WildFly always returns the 404 Not Found
Whatever I do, WildFly returns the 404 code to me
I'm using Java 22.0.1, Intellij Idea and WildFly 32.0.1.Final.
I also tried to run similar and working projects with GitHub on this configuration, but ...
1
vote
1
answer
68
views
Access HTTP Trailer in Quarkus
I'm implementing a REST-API in Quarkus and want to stream the content.
I want the know when the tranpsort of the stream is finished. As the http-standard describes, http-trailer fields will be sent, ...
-1
votes
1
answer
46
views
Is there anyway to configure request level timout for JAX-RS WebClient?
I'm trying to configure request level timeout using JAX-RS WebClient, I don't want create different WebClient instance for every different path. Is there anyway to do that without changing WebClient ...