users@glassfish.java.net

Re: How to deploy a war file inside a ear file as a root project of glassfish?

From: Ryan de Laplante <ryan_at_ijws.com>
Date: Fri, 28 Sep 2007 12:54:29 -0400

I don't have my development environment in front of me so I don't have
exact details... but your EAR should have an application.xml file which
tells the app server which war files, ejb jar files, etc. to use. Here
you can also specify a / context root for a war file.


Ryan

Antonio Goncalves wrote:
> Hi,
>
> I have a /project.ear/ file which contains a /mywebapp.war/ file and I
> would like to set it up as a root project. I've read the How to deploy
> a war file as a root project of glassfish?
> <http://forums.java.net/jive/thread.jspa?messageID=233259> thread
> which explains two ways of doing it :
>
> 1) Through the Admin console => *works fine* when I select
> project#mywebapp.war
>
> - go to Configuration -> HTTP Listeners -> http-listener-1
> look at the Default Virtual Server, by default it is set to 'server'.
> - go to Configuration -> Virtual Servers -> <server>
> There is a dropdown box with the label :Default Web Module. Select
> *project#mywebapp.war* as the default one.
>
> 2) Through the asadmin deploy command => *doesn't work*
>
> I've used asadmin deploy --contextroot "/" <your-webapp> (with
> project.ear, project#mywebapp.war, mywebapp.war) but it doesn't work.
> In the deploy command help it says "--contextroot Valid only if
> the archive is a web module. It is ignored for other archive types;
> defaults to filename without". So it looks like it doesn't work for
> .ear file.
>
> Is there a way to do it with a asadmin command ?
>
> Thanks,
> Antonio
>
>