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. …
Tag: jersey
JAX-RS (jersey implementation) ExceptionMapper aren’t catching ConstraintViolationException
I have an ExceptionMapper as a @Provider for handling all of my exceptions. So it is obvious that my class implements ExceptionMapper<Throwable> and we as know, all exceptions are extended Throwable somehow. Now I used jax-rs @NotNull to checking my resources input values to be not null and by some sear…
java.lang.NoClassDefFoundError: io/jsonwebtoken/SignatureAlgorithm
i have the following code that tries to create a jwt token. there will always be an error as shown below whenever it tries to execute SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.HS256; I have manually deleted the jwt jar file and update maven again to reinstall the jar but the issue still persi…
Jackson adds backslash in json
I’m building REST service on Jersey and using Jackson to produce JSON from java classes of my model. Model with absolutely simple values, I think this is the most typical case. But I get strange result: My expecting result: My source values of fields does NOT contains any special characters. These are s…
jersey/Mockito: NullInsteadOfMockException on client.post call verification
I’ve run into a strange issue with unit testing the following jersey client call: PostBody is a MultivaluedMap. The unit test verifies fine the accept and type calls but fails on the post one with this exception: Here’s the test code: Can you see anything wrong with this code? Answer Yes. You̵…
How to send enclose data in DELETE request in Jersey client?
I have the following server-side code in Jersey 2.x: On client side, I want to use Jersey 2.x client to send a delete request to the above web service. However, from the documentation of Jersey client API, I didn’t find how to enclose the following data in DELETE request: From the Jersey client API, the…
org.glassfish.jersey.internal.RuntimeDelegateImpl NOT FOUND
I am using jersey for my project and tring to parse a URI from a string. The code is simple, but I get a error below It seems the program can not find the delegate. I already imported javax.ws.rs.core.UriBuilder and have jersey-common 2.0 that should contain the delegate in my build path. But I still get this…
Maven jersey-multipart missing dependency for javax.ws.rs.core.Response
I seem to have a missing dependency but can’t find the solution… I’ve made sure all jersey versions are identical as answered here. Error: Dependencies used: Code where the error happens: Any ideas? Thanks a lot in advance, Frank Answer Yeah found it! Apparently the dependencies were OK. Add…
Is there a global Jackson setting for @JsonIgnoreProperties(unknown=true)?
Is there a global Jackson setting/configuration so that I do not have to annotate every class with @JsonIgnoreProperties(unknown=true)? Answer This should do the job: See the APIs for ObjectMapper and DeserializationFeature for more information.
ServletContextListener SEVERE: Error configuring application listener of class marktest.Config
My Java servlet appears to be complaining that it can’t find a file which is included in the package (marktest). Im using Eclipse (Indigo) to develop and Tomcat7. Here is the error: Here is Config.java which contains the class implementing ServletContextListener which it says it can’t find in the …