简体   繁体   English

Ant:部署到tomcat时“IOException:将请求主体写入服务器时出错”

[英]Ant: “IOException: Error writing request body to server” on deployment to tomcat

I am new to StackExchange so please bear with my eventual mistakes... 我是StackExchange的新手,所以请忍受我最终的错误......

I have been searching for answers but none seem to apply to my situation being that that build and deployment actually works, but the result is though an IOException at the end of the deployment call. 我一直在寻找答案,但似乎没有一个适用于我的情况是构建和部署实际上工作,但结果是在部署调用结束时的IOException。

I am making a build an deployment script in ant. 我正在使用ant构建一个部署脚本。 The deployment part is using this taskdef: 部署部分正在使用此taskdef:

<taskdef name="tomcatdeploy" classname="org.apache.catalina.ant.DeployTask" />
<target name="-tomcatdeploy" description="deploy to tomcat">
    <echo>deploying from client</echo>
    <tomcatdeploy
            url="http://32.0.26.146:8080/manager/text"
            username="<veryHardToGuessUsername>"
            password="<veryHardToGuessPassword>"
            path="/avlsweb"
            war="/mnt/s/Web/Avlsweb/BambooBuilds/TEST/${nt-server.dir.test}_Tc${version}/avlsweb##${version}.war"
            version="${version}"
            />   

We use Bamboo as build server. 我们使用Bamboo作为构建服务器。 This worked fine for a number of builds. 这适用于许多构建。 However recently I got this build error: 但是最近我遇到了这个构建错误:

/mnt/data/bamboo_home/xml-data/build-dir/AVTST-TEST15-JOB1/AvlswebScripts/Ant/build.xml:286: java.io.IOException: Error writing request body to server
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3192)
at sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.write(HttpURLConnection.java:3175)
at java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:242)
at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:195)
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:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
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)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

The strange thing is that the build works and it also deploys fine to tomcat. 奇怪的是,构建工作,它也可以很好地部署到tomcat。 However, for some reason an IOException occurs after the deployment resulting in a "red" failed build message in Bamboo. 但是,由于某种原因,部署后发生IOException,导致Bamboo中出现“红色”失败的构建消息。 A couple of additional remarks: 另外几条评论:

  • Tomcat manager-script user is setup Tomcat经理脚本用户已设置完成
  • Bamboo build server with ant is running on the same server as the targeting tomcat applicationserver however bamboo and the targeting tomcat are running as separate servers on separate ports. 使用ant的Bamboo构建服务器与目标tomcat应用程序服务器在同一服务器上运行,但是竹子和目标tomcat在不同的端口上作为单独的服务器运行。
  • Build server: Atlassian Bamboo 5.9.0 构建服务器:Atlassian Bamboo 5.9.0
  • Ant version: 1.9.2 Ant版本:1.9.2
  • Tomcat version: 8.0.15 Tomcat版本:8.0.15
  • Java version: 1.7.0_67 Java版本:1.7.0_67

Any ideas? 有任何想法吗?

i think i am slow, i have faced same problem 我想我很慢,我遇到了同样的问题

in tomcatdeploy task instead of war make it localWar tomcatdeploy任务而不是war使它成为localWar

You will get this error if you already have an instance deployed to the Tomcat server. 如果已将实例部署到Tomcat服务器,则会出现此错误。 You can set update="true" in the tomcatdeploy : 您可以在tomcatdeploy设置update="true"

<tomcatdeploy
        url="http://32.0.26.146:8080/manager/text"
        username="<veryHardToGuessUsername>"
        password="<veryHardToGuessPassword>"
        path="/avlsweb"
        war="/mnt/s/Web/Avlsweb/BambooBuilds/TEST/${nt-server.dir.test}_Tc${version}/avlsweb##${version}.war"
        version="${version}"
        update="true"
        />

Another option is to explicitly undeploy and then redeploy, or use the reload tag instead of the deploy tag. 另一种选择是显式取消部署然后重新部署,或使用reload标记而不是deploy标记。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用 Gmail API 将请求正文写入服务器时出错 - Error Writing Request Body to Server with Gmail API jclouds IOExpection:将请求主体写入服务器时出错 - jclouds IOExpection: Error writing request body to server javax.xml.ws.WebServiceException:java.io.IOException:写入服务器Tomcat 8时出错 - javax.xml.ws.WebServiceException: java.io.IOException: Error writing to server Tomcat 8 java.io.IOException:[DeploymentService:290066]从Administration Server下载文件以进行部署请求时出错 - java.io.IOException: [DeploymentService:290066]Error occurred while downloading files from Administration Server for deployment request java.io.IOException:写入服务器时出错 - java.io.IOException: Error writing to server HttpURLConnection代理奇怪的IOException(“写入服务器时出错”) - HttpURLConnection Proxy strange IOException (“Error writing to server”) 请求到达服务器了吗? 在输出流上写入请求时出现IOException - Is request reached to server ? IOException while writing request on outputstream 获取java.io.IOException:在getInputStream上写入服务器时出错 - Getting java.io.IOException: Error writing to server at getInputStream 远程Tomcat部署的ANT获得500 - ANT to Remote Tomcat Deployment gets 500 Tomcat网站部署错误 - Tomcat website deployment error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM