将 WAR OSGI 文件 (WAB) 部署到 glassfish 3.1 服务器的正确过程是什么?
我正在将 war 文件复制到“glassfish3\glassfish\domains\domain1\autodeploy\bundles\” -> OSGI 将该文件识别为包并将其添加到其容器中。 但是,它不会将 war 部署为 Web 应用程序(我无法访问它的 JSP)。 为了使其成为 Web 应用程序,我从 glassfish 管理控制台部署了 war。
将同一场 war 部署两次是否正确? OSGI不应该部署为WEB和OSGI吗?
最佳答案
为了使 OSGI 发现 wab,我需要在创建 WAB 时将以下属性添加到“maven-bundle-plugin”:
<configuration>
<instructions>
<Web-ContextPath>/blabla</Web-ContextPath>
<Webapp-Context>/blabla</Webapp-Context>
</instructions>
</configuration>
使用此配置,war 应该仅复制到 autodeploy/bundles。
可以在此处找到更多详细信息(和其他属性):http://leshazlewood.com/2010/09/08/osgi-maven-pax-and-web-applications/
关于osgi - 如何在glassfish中部署wab文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4813819/