无法在Karaf 2.2.0 OSGi容器中从根上下文运行WAR

| 我一直在努力让Web应用程序在Karaf 2.2.0的根应用程序上下文中运行(在Karaf 2.1.4中运行良好)。我已经能够使用Tomcat示例WAR将问题隔离为易于复制的问题。 从Karaf运行以下命令: osgi:install -s webbundle:http://tomcat.apache.org/tomcat-5.5-doc/appdev/sample/sample.war?Bundle-SymbolicName = tomcat-sample&Webapp-Context = / anything 从网络浏览器访问应用程序(http:// localhost:8181 / anything / index.html) 卸载样本包 通过以下命令使用根上下文路径重新安装捆绑软件: osgi:install -s webbundle:http://tomcat.apache.org/tomcat-5.5-doc/appdev/sample/sample.war?Bundle-SymbolicName = tomcat-sample&Webapp-Context = / 尝试从您的网络浏览器(http:// localhost:8181 / index.html)访问该应用程序 请注意404错误。 查看日志,似乎当Web应用程序位于根应用程序上下文中时,它将对任何请求加上\ // default / \。例如,当尝试访问/index.html时,它将查找/default/index.html,无法找到该页面,并返回未找到的错误(有关更多详细信息,请参见下面的日志输出)。 有谁知道如何解决这个问题? 日志输出
15:14:46,270 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | REQUEST /index.html on org.eclipse.jetty.server.nio.SelectChannelConnector$3@693a1324
15:14:46,270 | DEBUG | 30 - /index.html | ServerModel                      | eb.service.spi.model.ServerModel  268 | 52 - org.ops4j.pax.web.pax-web-spi - 1.0.1 | Matching [/index.html]...
15:14:46,270 | DEBUG | 30 - /index.html | ServerModel                      | eb.service.spi.model.ServerModel  292 | 52 - org.ops4j.pax.web.pax-web-spi - 1.0.1 | Path [/index.html] matched to {pattern=/.*,model=ResourceModel{id=org.ops4j.pax.web.service.spi.model.ResourceModel-22,name=default,urlPatterns=[/],alias=/,servlet=ResourceServlet{context=/,alias=/,name=default},initParams={},context=ContextModel{id=org.ops4j.pax.web.service.spi.model.ContextModel-21,name=,httpContext=org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@3942ef25,contextParams={webapp.context=}}}}
15:14:46,270 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | Got Session ID 17kb0ch4hv02w1ennfxju5owpw from cookie
15:14:46,270 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | sessionManager=org.eclipse.jetty.server.session.HashSessionManager@7d8aecf1
15:14:46,271 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | session=null
15:14:46,271 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | servlet=default
15:14:46,271 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | servlet holder=
15:14:46,271 | DEBUG | 30 - /index.html | HttpServiceContext               | etty.internal.HttpServiceContext  115 | 54 - org.ops4j.pax.web.pax-web-jetty - 1.0.1 | Handling request for [/index.html] using http context [org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext@3942ef25]
15:14:46,271 | DEBUG | 30 - /index.html | log                              | .eclipse.jetty.util.log.Slf4jLog   70 | 43 - org.eclipse.jetty.util - 7.2.2.v20101205 | chain=
15:14:46,272 | DEBUG | 30 - /index.html | WebAppWebContainerContext        | r.war.internal.WebAppHttpContext  113 | 64 - org.ops4j.pax.web.pax-web-extender-war - 1.0.1 | Searching bundle [tomcat-sample [97]] for resource [default/index.html], normalized to [default/index.html]
15:14:46,272 | DEBUG | 30 - /index.html | WebAppWebContainerContext        | r.war.internal.WebAppHttpContext  140 | 64 - org.ops4j.pax.web.pax-web-extender-war - 1.0.1 | Resource not found
15:14:46,273 | DEBUG | 30 - /index.html | log     
已邀请:
现在,此问题已作为Karaf错误提交。参见https://issues.apache.org/jira/browse/KARAF-577

要回复问题请先登录注册