jersey

Java 8 support with Jersey framework [closed]

浪子不回头ぞ 提交于 2020-01-17 05:20:09
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I have a Rest Application using Jersey framework and maven. My application works well. Now I have decided to re-factor my code and use Java 8 features wherever possible. I started with Optional class. But when I use Optional.ifPresent method in my code, tomcat fails to start with Exception. Note: There are no

java.lang.NoSuchMethodError: org.eclipse.persistence.oxm.XMLUnmarshaller.setNamespaceResolver(Lorg/eclipse/persistence/oxm/NamespaceResolver;)

放肆的年华 提交于 2020-01-17 04:16:06
问题 I am writing jax-rs restful application using jersey(, GET request was fine but POST, PUT & DELETE request give the error below SEVERE: Servlet.service() for servlet [Jersey Web Application] in context with path [/RESTful_JaxRS] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.NoSuchMethodError: org.eclipse.persistence.oxm.XMLUnmarshaller.setNamespaceResolver(Lorg/eclipse/persistence/oxm/NamespaceResolver;)V] with root cause java.lang.NoSuchMethodError: org.eclipse

JAX-RS Rest Filter does not invoke

社会主义新天地 提交于 2020-01-16 19:59:53
问题 I have an api that needs to implement security. But the filter is not invoked. my call pass directly to the endpoint... My Secure interface @NameBinding @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.TYPE,ElementType.METHOD}) public @interface Seguro {} My Filter @Seguro @Provider @Priority(Priorities.AUTHENTICATION) public class FiltroAutenticacao implements ContainerRequestFilter { @Override public void filter(ContainerRequestContext requestContext) throws IOException { String

jvm 奔溃 A fatal error has been detected by the Java Runtime Environment

杀马特。学长 韩版系。学妹 提交于 2020-01-16 13:34:07
# # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006852ad23, pid=1992, tid=0x0000000000001d34 # # JRE version: Java(TM) SE Runtime Environment (8.0_131-b11) (build 1.8.0_131-b11) # Java VM: Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode windows-amd64 compressed oops) # Problematic frame: # V [jvm.dll+0x5ad23] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows # # If you would like to submit a bug report, please visit: # http://bugreport.java.com/bugreport/crash

Null pointer exception only on application startup org.eclipse.persistence.jaxb.JAXBMarshaller.marshal

荒凉一梦 提交于 2020-01-16 01:10:35
问题 I have a very strange problem. I am creating a JPA (Eclipselink) application, with a Jersey rest service, and an angularJS front end. When the application starts up, when I go to my angular page, I get a marshalling exception which seems to be caused by a null pointer somewhere. Press refresh in my browser, and the data comes back - no exceptions, and I am good to go from there on in. I am using @XMLInverseReference on a one to many join, and the way I have set the annotations is the only way

How an I get MOXy to just output on one line to save space

自闭症网瘾萝莉.ら 提交于 2020-01-15 19:16:31
问题 To solve another problem I have moved from using Jersey to EclipseLink MOXy to generate JSON from a JAXB created object model ( created by Sun JAXB 2.1.12). One difference I've noticed is the formatting of the output that Jersey outputs {"artist-list":{"offset":0,"count":1,"artist":[{"score":"100","type":"Group","id":"4302e264-1cf0-4d1f-aca7-2a6f89e34b36","name":"Farming Incident","sort-name":"Incident, Farming","gender":"male","country":"AF","disambiguation":"the real one","ipi-list":{"ipi":

two way SSL/TLS authentication in a Rest Web Service

强颜欢笑 提交于 2020-01-15 12:35:07
问题 I am going to expose my situation. I have a REST application running on Apache Tomcat 7.0. The question is that I want to authenticate and create client roles on the rest API server in order to allow users make some actions or not. The authentication and roles of clients will be determined by the SSL/TLS client certificate that clients have to send to the server. Strategy is: a Rest Client application sends a request to the server. Client apart from sends actions on the post request, sends

two way SSL/TLS authentication in a Rest Web Service

不羁岁月 提交于 2020-01-15 12:34:09
问题 I am going to expose my situation. I have a REST application running on Apache Tomcat 7.0. The question is that I want to authenticate and create client roles on the rest API server in order to allow users make some actions or not. The authentication and roles of clients will be determined by the SSL/TLS client certificate that clients have to send to the server. Strategy is: a Rest Client application sends a request to the server. Client apart from sends actions on the post request, sends

Jersey - MessageBodyWriter not found application/xml ArrayList (with jersey-jaxb in war)

本秂侑毒 提交于 2020-01-15 10:56:07
问题 I have a Jersey controller that is returning a List<MyPojo> (it is actually returning an ArrayList . My pom includes jersey-server and so I am automatically getting jersey-media-jaxb and I have verified that my war does contain that dependency. The endpoint is marked with: @Produces(value={MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) When I hit it with no accept specified (or with application/json ) I get back JSON with no issues. But when I specify 'accept=application/xml` I get:

Jersey - MessageBodyWriter not found application/xml ArrayList (with jersey-jaxb in war)

一曲冷凌霜 提交于 2020-01-15 10:56:05
问题 I have a Jersey controller that is returning a List<MyPojo> (it is actually returning an ArrayList . My pom includes jersey-server and so I am automatically getting jersey-media-jaxb and I have verified that my war does contain that dependency. The endpoint is marked with: @Produces(value={MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) When I hit it with no accept specified (or with application/json ) I get back JSON with no issues. But when I specify 'accept=application/xml` I get: