how to deploy wab files in glassfish

元气小坏坏 提交于 2019-12-12 14:24:53

问题


What is the correct process of deploying a WAR OSGI file (WAB) to glassfish 3.1 server?

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.

Is it correct to deploy the same war twice? Shouldn't OSGI deploy it as WEB and OSGI?


回答1:


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/




回答2:


You only Web-ContextPath as per the final OSGi EE spec. Webapp-Context was an intermediate name. No need to deploy the WAB again as a WAR as already answered in this thread.



来源:https://stackoverflow.com/questions/4813819/how-to-deploy-wab-files-in-glassfish

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