我正在使用Ant将战争部署到Tomcat服务器,但这给了我以下错误:
BUILD FAILED
/home/deploy/Documents/Work/Deploy_Wars/xrepo/deployment/build.xml:37: The following error occurred while executing this line:
/home/deploy/Documents/Work/Deploy_Wars/xrepo/deployment/ant_scripts/deploy_wars.xml:36: The following error occurred while executing this line:
/home/deploy/Documents/Work/Deploy_Wars/xrepo/deployment/ant_scripts/deploy_wars.xml:42: java.io.IOException: Error writing to server
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:699)
at sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:711)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1585)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:223)
at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:201)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:448)
at org.apache.tools.ant.Target.performTasks(Target.java:469)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:446)
at org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
这是我用于此部署的Ant目标(这是引发异常的行):
<target name="deploy-debug" description="Install DEBUG">
<deploy url="http://debug.webiste.ro:8180/manager" username="admin" password="password"
path="/debug-war" war="wars/debug-war.war"/>
</target>
我正在使用Tomcat 9.0.10和Ant 1.10.3。
我看到有人建议在tomcat_users.xml中没有正确定义tomcat用户。我已经对其进行了修改,但是当我尝试进行部署时,它仍然给我一个例外。我可以在浏览器中成功登录Tomcat管理器应用程序。这是我的tomcat_users.xml:
<tomcat-users xmlns="http://tomcat.apache.org/xml"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
version="1.0">
<role rolename="tomcat"/>
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<role rolename="admin-script"/>
<user username="admin" password="password" roles="manager-gui,manager-script,admin-gui,admin-script"/>
</tomcat-users>
我要部署的war文件具有80 Mb,大于Tomcat的默认最大上载值(50 Mb)。我尝试将最大上传值增加到100 Mb,但仍然给我例外。
关于这个问题有什么想法吗?