使用pax web在OSGI容器中部署Web应用程序时出错

时间:2010-06-12 11:02:01

标签: jetty osgi apache-felix pax

您好我正在尝试在Felix容器中部署Web应用程序。 我使用我的网络应用程序完成了所有必需的配置,例如设置清单标头: Web应用程序上下文: 捆绑-类路径。 捆绑激活因子: 进口包装: 捆绑-SymbolicName: 等等 我放在同一个容器中的Pax包是: PAX-Web的服务0.6.0.jar PAX-Web的JSP-0.7.1.jar PAX-Web的扩展,战争0.7.1.jar PAX-测井服务1.5.0.jar PAX-测井API-1.5.0.jar

虽然在pax网站上写过pax-web-service包含在pax-war-extender中,但似乎没有pax-web-service捆绑包,所有其他捆绑包都会成为残障人士。

我删除了其他pax捆绑包 PAX-Web的扩展,白板0.7.1.jar pax-web-jetty-0.7.1.jar,因为我没有看到任何有用的东西。

pax-web-jetty-0.7.1.jar甚至无法启动。它具有依赖性,它无法从PAX提供的任何一个包中解析。

我的浏览器显示: HTTP ERROR 403

访问/ adminmodule /时出现问题。原因是:

FORBIDDEN

由Jetty提供://


,而控制台日志显示:

[5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.mortbay.jetty - REQUEST / adminmodule / on org.mortbay.jetty.HttpConnection@1e94001 [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.service.internal.model.ServerModel - 匹配[/ adminmodule /] ... [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.service.internal.model.ServerModel - Path [/ adminmodule /]匹配{pattern = / adminmodule /.*,mode = ResourceModel {ID = org.ops4j.pax.web.service.internal.model.ResourceModel-2,名字=,URL模式= [/],别名= /,小服务程序= ResourceServlet {上下文= / adminmodule,别名= /,名称=} ,initParams在= {},上下文= ContextModel {ID = org.ops4j.pax.web.service.internal.model.ContextModel-1,名字= adminmodule,HttpContext的= org.ops4j.pax.web.extender.war.internal。 WebAppWebContainerContext @ 11710be,contextParams = {webapp.context = adminmodule}}}} [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.service.internal.HttpServiceContext - 使用http context [org.ops4j.pax.web.extender]处理[/ adminmodule /]的请求。 war.internal.WebAppWebContainerContext@11710be] [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.mortbay.jetty - sessionManager =org.mortbay.jetty.servlet.HashSessionManager@19c6163 [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.mortbay.jetty - session = null [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.mortbay.jetty - servlet = [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.mortbay.jetty - chain = org.ops4j.pax.web.service.internal.model.FilterModel-3-> [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.mortbay.jetty - servlet holder = [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.mortbay.jetty - 调用过滤器org.ops4j.pax.web.service.internal.model.FilterModel-3 [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.service.internal.WelcomeFilesFilter - 应用欢迎文件过滤器... [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.service.internal.WelcomeFilesFilter - Servlet路径:/ [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.service.internal.WelcomeFilesFilter - 路径信息:null [5884890 @ qtp-16567002-0 - / adminmodule /] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - 获取资源:[/ adminmodule.jsp] [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext - 搜索资源包[com.cisco.zaloni.gwt.admin [1]] [/ adminmodule.jsp],规范化为[adminmodule.jsp] [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext - 找不到资源 [5884890 @ qtp-16567002-0 - / adminmodule /] INFO org.ops4j.pax.web.service.internal.HttpServiceContext - 找到的资源:null [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.mortbay.jetty - 调用servlet [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext - 搜索资源包[com.cisco.zaloni.gwt.admin [1]] [/ ],归一化为[/] [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.ops4j.pax.web.extender.war.internal.WebAppWebContainerContext - 找到的资源为url [bundle://1.0:1 /] [5884890 @ qtp-16567002-0 - / adminmodule /] DEBUG org.mortbay.jetty - RESPONSE / adminmodule / 403

真的很令人沮丧。

请帮忙。因为我是OSGI的新手。

劳尔

1 个答案:

答案 0 :(得分:1)

pax-web的1.0之前版本中存在各种错误,这些错误总是让我失望。我建议通过更新使用最新版本开始,pax-web 1.0.2似乎是今天的最新版本。如果你不想那么高,我发现0.8.1是它真正开始正常工作的第一个版本。

用于部署Web应用程序包的OSGi标准还需要使用您未列出的Web-ContextPath标头。这将设置为您要从中提供内容的上下文根。

Apache Aries项目有几个样本可能值得一看,看看你的软件包与那些软件包有什么不同。 Apache Aries Blog示例已记录here,可以从here下载。