我有一个正在进行的webapp,我经常需要重新部署它
我注意到如果我只是部署旧文件,它有时不会更新
我继续寻找一个取消部署任务供我在部署脚本中使用
部署脚本工作正常,如果服务器刚刚启动,如果它没有刚刚启动,它有时不会覆盖旧文件。
取消部署任务根本不起作用 这是我的取消部署脚本
<target name="undeploy" depends="clean" description="Remove application in Tomcat">
<undeploy url="${tomcat.manager.url}"
username="${tomcat.username}"
password="${tomcat.password}"
path="/${webapp.name}"/>
</target>
和我得到的异常 - 由于某种原因它将上下文路径的“/”变为“%2F”,这就是为什么我得到文件未找到异常,我该如何解决?
C:\Dev\webworkspace\ElectronicArenaLenasProject\build.xml:76: java.io.FileNotFou
ndException: http://localhost:8080/manager/undeploy?path=%2FElectronicArenaLe
nasProject
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1613)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalina
Task.java:230)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalina
Task.java:150)
at org.apache.catalina.ant.UndeployTask.execute(UndeployTask.java:44)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.jav
a:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExe
cutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:811)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
答案 0 :(得分:1)
我猜tomcat没有运行。或者在build.xml中未正确配置管理器URL(即${tomcat.manager.url}
)
请参阅错误消息:
java.io.FileNotFoundException: http://localhost:8080/manager/undeploy?path=%2FElectronicArenaLenasProject