如何在Glassfish中部署WAB文件 [英] how to deploy wab files in glassfish
问题描述
将WAR OSGI文件(WAB)部署到glassfish 3.1服务器的正确过程是什么?
What is the correct process of deploying a WAR OSGI file (WAB) to glassfish 3.1 server?
我正在将war文件复制到"glassfish3 \ glassfish \ domains \ domain1 \ autodeploy \ bundles \"-> OSGI将文件识别为捆绑文件并将其添加到其容器中. 但是,它没有将战争部署为Web应用程序(我无法访问其JSP). 为了使其成为Web应用程序,我从glassfish管理控制台部署了war.
I am copying the war file to "glassfish3\glassfish\domains\domain1\autodeploy\bundles\" -> OSGI recognizes the file as bundle and add it to its container. However, it doesn't deploy the war as web application (I cannot access its JSPs). To make it a web application, I deploy the war from glassfish admin console.
两次部署同一场战争是否正确? OSGI不应该将其部署为WEB和OSGI吗?
Is it correct to deploy the same war twice? Shouldn't OSGI deploy it as WEB and OSGI?
推荐答案
要使OSGI发现wab,我需要在创建WAB时将以下属性添加到"maven-bundle-plugin"中:
To make OSGI discover the wab, I needed to add the following attributes to "maven-bundle-plugin" when creating the WAB:
<configuration>
<instructions>
<Web-ContextPath>/blabla</Web-ContextPath>
<Webapp-Context>/blabla</Webapp-Context>
</instructions>
</configuration>
使用此配置,战争只能复制到自动部署/捆绑中.
With this configuration, war should be copied to autodeploy/bundles only.
More details (and other attributes) can be found here: http://leshazlewood.com/2010/09/08/osgi-maven-pax-and-web-applications/
这篇关于如何在Glassfish中部署WAB文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!