I have an EAR with a WAR that I’m deploying on GlassFish 3.1
Currently, the application runs at localhost:8080/myapp/index.jsf
I want it to run on localhost:8080/index.jsf
To accomplish this, I changed the application.xml in the EAR from contextRoot “myapp” to contextRoot=”/”
When I deploy my EAR using the GlassFish admin UI, it gives me a deployment error, then when I try to browse to the admin UI, it shows me the default GlassFish home page. To recover I have to undeploy my EAR using asadmin from the command line and then do a restart-domain to restart the server.
My theory is that my application and the GlassFish admin UI are both running on root “/”.
QUESTION: What is the correct way to deploy my web app in root of GlassFish 3.1? Or is this bad practice?
Thanks!
Rob
Rob,
If your deploying from the command line you can use an argument to asadmin to choose the context root. This has never given me the issue you describe.
$ASADMIN deploy –contextroot “/” your.war
Your other option is to under the Virtual Server settings to choose a default web module, but personally I prefer just setting one application to /.
Kevin