jersey

URL of a Jersey Application using ResourceConfig without web.xml

纵然是瞬间 提交于 2019-12-22 06:24:08
问题 I migrated from web.xml to totally Java configuration using ResourceConfig with Jersey 2.7 and deploying on Tomcat 7. After that I am not able to reach the services anymore by using the same urls that I was using with the web.xml approach. I don't understand how the ResourceConfig is affecting the paths. My previous web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun

URL of a Jersey Application using ResourceConfig without web.xml

狂风中的少年 提交于 2019-12-22 06:23:53
问题 I migrated from web.xml to totally Java configuration using ResourceConfig with Jersey 2.7 and deploying on Tomcat 7. After that I am not able to reach the services anymore by using the same urls that I was using with the web.xml approach. I don't understand how the ResourceConfig is affecting the paths. My previous web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun

@Context returns Proxy instead of HttpServletRequest (No thread local value in scope for proxy)

℡╲_俬逩灬. 提交于 2019-12-22 05:08:17
问题 I have a bit of a problem with understanding why @Context dependency injection returns collection of $Proxy(random number) instances instead of HttpServletRequest or HttpServletResponse. I am using Glassfish 3.1.2.2 with it's version of Jersey(Jersey: 1.11.1) and my app is built as EAR application. I have simple @Remote interface where I annotate my methods and REST services work without any problems, but the moment I try to access HttpServletRequest information it just causes problems. I

Grizzly and ServletContainerContext

大城市里の小女人 提交于 2019-12-22 04:38:42
问题 I'm trying to get hold of some injected context (for example Session or HttpServletRequest) in a Servlet I've written, running on Grizzly, but nothing I do seems to work. The whole process seems to stall rather prematurely with the following error: SEVERE: Missing dependency for field: javax.servlet.http.HttpServletRequest com.test.server.LolCat.hsr The server is dead simple, it consists of two files, the static entry point (Main.java): package com.test.server; import java.io.IOException;

@Context HttpServletRequest scope in Jersey ContainerResponseFilter

喜你入骨 提交于 2019-12-22 04:33:15
问题 I am writing an Jersey Response filter. I am using Jersey 1.17. I want to get access to some attributes of the httpServletRequest in the filter API. The way what i am doing right now is as below. Is it safe to inject the servletRequest like in the snippet below or will this cause some kind of concurrency issues? If there are multiple requests coming in conncurrently, will the servletRequest in different requests overwrite each other? Thanks for your hlep. public class LoggingFilter implements

Using Jackson in Jersey with multiple configured ObjectMappers

☆樱花仙子☆ 提交于 2019-12-22 04:04:11
问题 Is it possible to setup Jersey using Jackson for serialization/deserialization using multiple configured ObjectMappers ? What I would like to be able to do is register a "default" Jackson ObjectMapper and then have the ability to register another feature which provides an ObjectMapper with some specialized configuration which under certain circumstance will "override" the "default" ObjectMapper . For example, this ContextResolver would be for the "default" mapper: @Provider @Consumes

using JarJar repackaging tool

元气小坏坏 提交于 2019-12-22 04:03:21
问题 I have deployed a web application to the Google app engine and my web service uses the jersey 1.14 framework. When I try to consume or invoke the web services on the GAE I get a java.lang.IncompatibleClassChangeError: Implementing class. I searched around and got to realize that jersey 1.14 depends on asm 3.1 and google app engine uses asm 4.0 and realize that I had to use JarJar to package the dependencies to fix this problem but I don't have a clue about how to do this with JarJar. The

Jersey: ContainerRequestFilter does not get Context ServletRequest

只谈情不闲聊 提交于 2019-12-22 03:59:28
问题 To see the full code for this issue, please see this github https://github.com/mobiusinversion/web-application I also created this Jersey Jira https://java.net/jira/browse/JERSEY-2851 I am working on a ContainerRequestFilter using Jersey 2.15. This is an embedded Jetty app which is shaded into a single jar. In the Jetty starter (main class): public static void main(String[] args) throws Exception { ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);

Custom Jackson ObjectMapper in Jersey 2 with Spring

强颜欢笑 提交于 2019-12-22 03:44:14
问题 I'm having some issues migrating Jersey from 1.x to 2.x. My application uses Jersey to provide REST web services, with data served in JSON via Jackson and Spring 4 to handle the dependency injection. In Jersey 1.x i used to write JsonDeserializer as components managed by Spring, so i could access my services to load from the persistance layer my domain object during the deserialization, but in 2.x i'm having issues getting the injection of services in the deserializers to work. The approach i

Custom Jackson ObjectMapper in Jersey 2 with Spring

痴心易碎 提交于 2019-12-22 03:44:10
问题 I'm having some issues migrating Jersey from 1.x to 2.x. My application uses Jersey to provide REST web services, with data served in JSON via Jackson and Spring 4 to handle the dependency injection. In Jersey 1.x i used to write JsonDeserializer as components managed by Spring, so i could access my services to load from the persistance layer my domain object during the deserialization, but in 2.x i'm having issues getting the injection of services in the deserializers to work. The approach i