lili
lili

Reputation: 1906

how to deploy wab files in glassfish

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?

Upvotes: 3

Views: 1512

Answers (2)

Sahoo
Sahoo

Reputation: 94

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.

Upvotes: 0

lili
lili

Reputation: 1906

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/

Upvotes: 4

Related Questions