Register ServletContainer programmatically in Osgi

﹥>﹥吖頭↗ 提交于 2019-12-03 16:48:11

Do you have jersey-container-servlet module on your class-path (this is the module supposed to be used for Servlet 3.x support)?

The reason you're experiencing this issue is that Jersey couldn't find appropriate AsyncContextDelegateProvider (from jersey-container-servlet module) and it uses implementation from jersey-container-servlet-core module (Servlet 2.x support) which fails this way.

The error was that the jersey modules were initiated on the same level as the module of the application that registered the servletContainer.

[ 127] [  Resolved] [   30] jersey-container-servlet-core (2.4.0)
[ 161] [    Active] [   30] jersey-core-common (2.4.0)
[ 162] [    Active] [   30] jersey-core-client (2.4.0)
[ 163] [    Active] [   30] jersey-core-server (2.4.0)
[ 164] [    Active] [   30] jersey-container-servlet (2.4.0)
[ 165] [    Active] [   30] jersey-media-sse (2.4.0)

I start the stack of jersey in level 30, and the application at level 80 and everything works!!!! The important module is jersey-core-server, that adds support for servlet 3.x.

[ 168] [    Active] [   80] OsgiJersey OSGi Bundle (1.0.0.SNAPSHOT)

See example in my repository

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!