Change Application Deployment Location
Hi,
Is it possible to change the default deployment location of a WAR file?
When we deploy a WAR file, the server creates the deployment structure in the order of:
installation_path/server_name/application/j2ee-modules/ApplicationName_deployme ntNumber
For example while deploying a war file with Context Root ABCS for the first time on a Windows installation I would get:
C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\ABCS_1
as my first time deployed folder structure.
In case I redeploy the application, the structure would change to:
C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\ABCS_2
and so on. My question is can we stop the server from creating the trailing _deploymentNumber i.e. fix the deployment such that each time the deployed folder structure remains to be
C:\Sun\AppServer7\domains\domain1\server1\applications\j2ee-modules\ABCS
Thanks !!
Mrinal
# 2
> If you undeploy the application before redeploying,
> then it will always deploy under
> C:\Sun\AppServer7\domains\domain1\server1\applications
> \j2ee-modules\ABCS_1
>
> Cheers
Hi,
I tried that didnt work exactly the way I expected, the only way I am getting it to the same, is too undeploy, restart the server and then deploy...doesnt work any other way.
I was hoping that there was a configuration or something that could be used to turn on and off this feature.
Mrinal
# 4
Unlike *NIX OS's -- Windows will not allow deleting of a file that is "in use". That is probably why you have to restart the server. You can find out if anything is using the file with the handy utility -- handle.exe
http://www.sysinternals.com/utilities/handle.html
In this case you could run this command:
handle ABC
and it would reveal which processes have locked any file with "ABC" in the path.
Note that if you have a command window open with the current directory set to anything at or under your deployed directory -- that counts as a lock.
Also if WIndows Explorer has a directory open -- that can lock files.