Skip to content
Advertisement

Tag: jax-rs

JAX-RS LoggingFilter – Log request entities

I’m using a class implementing ClientRequestFilter It is working fine except that after being logged the bodypart stream seems to be consumed and is not sent with the request. How can I do to display the bodypart stream and make it again available for the request itself ? For the response it was the same problem and I managed to

JAX-RS and RegEx @Paths with spaces

Spaces in URIs are allowed if they’re encoded, as discussed here. JAX-RS (Jersey on Payara) doesn’t seem to allow spaces defined in the path regex pattern. The above regex should match the encoded ABC%20XYZ, but it doesn’t. Request: Internally, Payara throws a 404: Removing %20 (space) succeeds. In JAX-RS Spec 2.1 Final, section 3.3.2 Parameters, it states you have to

Java JSON String problem encoding Multipart

I’m developing a REST API that receives a MultipartFormDataInput object (org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataInput), this comes from a form-data Vue.js app. On the data field comes a json string that contains latin accent characters (á, é, í, ó, ú, ñ). When print the json data in Java I get this: Original Json string Json string received in Java What can i do to

Jersey test framework: Test Container is null

I have the following test class that tests a simple “/helloWorld” endpoint that is implemented in jax-rs. I am running this as an EAR file in a JBOSS EAP Server locally. When I run the test I get the following: Answer JerseyTest is not compatible with JUnit 5 at the moment. https://github.com/jersey/jersey/issues/3662 From their workaround, add to your class, and

AbstractMethodError when creating JdkHttpServer for JAX-RS

I’m trying to create a Java server for a REST API and following this question I used jersey’s JdkHttpServer. I imported the necessary jars (from here), but when I start the server the following error appears: My code is the following: And in PokerResource I’ve got all the paths for the API. Am I missing some import or do I

JAX RS MessageBodyWriter not found for media type=application/json

I am creating Rest client using JAX RS Jersey 2. The client works but only in my IDE (IntellIJ IDEA), when I build it with Maven, using maven-assembly-plugin and run the jar it doesn’t work anymore. I get MessageBodyWriter not found for media type=application/json error. I have tried adding more dependencies that people suggested in other posts but I don’t

Advertisement