问题描述
我正在尝试创建将使用运动衫和春季运动的静态服务项目设置.我最初下载了依赖jersey1.8的jar,也得到了jersey-spring-1.8,我将com.sun.jersey.spi.spring.container.servlet.SpringServlet用作jersey servlet,并且此设置运行良好,没有任何问题.
现在,我被要求使用最新的球衣版本jersey2.3.1,因此我下载了依赖球衣2.3.1的jar,例如(jersey-container-servlet-core-2.3.1,jersey-container-servlet-2.3.1等).现在问题出在jersey-spring上,它将带有com.sun.jersey.spi.spring.container.servlet.SpringServlet,我从maven存储库(即jersey-spring3-2.3.1.jar)下载了jar,但上面没有SpringServlet.因此,任何人都可以告诉我什么是对应的平针织物-春季罐子吗?
请注意,我尝试在jersey-spring-1.8上使用与jersey2.3.1相关的jar,但是现在我遇到了例外情况,说com.sun.jersey.spi.container.servlet.ServletContainer丢失了.因此存在一些jar兼容问题.
有人可以告诉我如何进行jersey2.3.1和spring集成吗?
在jersey 2.x和spring集成中,我们无法像在jersey 1.x和spring集成中那样在spring bean中定义资源和提供程序.请看下面的链接.
https://java.net/jira/browse/JERSEY-1957 https://jersey.java.net/documentation/latest/spring.html
因此,球衣2.x中没有com.sun.jersey.spi.spring.container.servlet.SpringServlet
I am trying to create restful service project setup which will use jersey and spring. i downloaded initially jersey1.8 dependent jars also i got jersey-spring-1.8 and i used com.sun.jersey.spi.spring.container.servlet.SpringServlet as jersey servlet and this setup worked well without any issues.
Now i was asked to use latest jersey version that is jersey2.3.1, so i downloaded jersey2.3.1 dependent jars like (jersey-container-servlet-core-2.3.1,jersey-container-servlet-2.3.1 etc). Now the problem is with jersey-spring which will have com.sun.jersey.spi.spring.container.servlet.SpringServlet, i downloaded jar from maven repository ie jersey-spring3-2.3.1.jar but it does not contain that above SpringServlet.So can any one please tell me what is the corresponding jersey-spring jar or am i missing anything here.
Note i tried to use jersey2.3.1 related jars with jersey-spring-1.8, but now i got exception saying com.sun.jersey.spi.container.servlet.ServletContainer is missing. so there is some jar compatible issue.
Can anyone tell me how to proceed with jersey2.3.1 and spring integration?
in jersey 2.x and spring integration we can not define resources and providers in spring beans as we used to do in jersey 1.x and spring integration.look at the below links.
https://java.net/jira/browse/JERSEY-1957 https://jersey.java.net/documentation/latest/spring.html
so there is no com.sun.jersey.spi.spring.container.servlet.SpringServlet in jersey 2.x
这篇关于jersey 2.3.1和spring集成的兼容性问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!