3
votes

I create new war-app in Netbeans with the name TestA. Then, I create new Glassfish deployment descriptor glassfish-web.xml with the following content:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
  <context-root>/new_context_root</context-root>
</glassfish-web-app>

And then I deploy my app to GF. Context Root still /TestA, instead of /new_context_root. Why?

Glassfish version is 3.1.2.2

UPD

If I deploy through autodeploy folder, then context root changes normally, but not from web-admin

1
Did you deploy from Netbeans/Eclipse or from admin console? - Padmarag
if I deploy from Netbeans, then context-root changes normally - shurik2533
something strange happens. If I deploy through autodeploy folder, then context root changes normally - shurik2533

1 Answers

7
votes

From glassfish web admin, when deploying a new WAR, you have to blank the field Context Root: to use the one in the glassfish-web.xml file.