I have to deploy my application in weblogic through ant. what i am doing is:
<target name="deployOnServer1" >
<echo>*********** Start deploying war file on SERVER1 *********** </echo>
<wldeploy action="redeploy"
source="${dist.dir}/${ant.project.name}.war"
name="${wls.appname}"
user="${wls1.user}"
password="${wls1.password}"
adminurl="${wls1.adminurl}"
targets="${wls1.targets}"
verbose="true"
debug="true"
upload="true"
remote="true"
/>
</target>
This deploys my application on weblogic, only if there is not any other application with same application context. So what i did is:
<target name="undeployOnServer1">
<echo>*********** Start unDeploying war file on SERVER1 *********** </echo>
<wldeploy
action="undeploy" verbose="true" debug="true"
name="${wls.appname}"
user="${wls1.user}" password="${wls1.password}"
adminurl="${wls1.adminurl}"
failonerror="false"
/>
</target>
and changed the deployOnServer1 target as
<target name="deployOnServer1" depends="undeployOnServer1">
but Now on undeploy it says, no application named 'myapp' to undeploy and on deploy it says, unable to deploy as there is other application with same context path '/myapp'.
How to solve this problem?