users@glassfish.java.net

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

From: Antonio Goncalves <antonio.mailing_at_gmail.com>
Date: Fri, 28 Sep 2007 18:26:25 +0200

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