本文介绍了蚂蚁:" IOException异常:错误写入请求的身体服务器"在部署到Tomcat的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来StackExchange,请与我最终的失误承担...

我一直在寻找答案,但没有似乎适用于我的情况在于该构建和部署实际工作,但结果是虽然一个IOException在部署通话结束。

我想提出一个建立在蚂蚁的部署脚本。部署部分使用此的taskdef:

 <的taskdef NAME =tomcatdeploy类名=org.apache.catalina.ant.DeployTask/>
<目标名称= - tomcatdeploy描述=部署到Tomcat>
    <回声>从客户&LT部署; /回声>
    < tomcatdeploy
            URL =htt​​p://32.0.26.146:8080/manager/text
            用户名=下; veryHardToGuessUsername>中
            密码=< veryHardToGuessPassword>中
            PATH =/ avlsweb
            war=\"/mnt/s/Web/Avlsweb/BambooBuilds/TEST/${nt-server.dir.test}_Tc${version}/avlsweb##${version}.war\"
            版本=$ {}版
            />

我们使用竹子作为构建服务器。这为一些建立正常工作。不过最近我得到这个生成错误:

<$p$p><$c$c>/mnt/data/bamboo_home/xml-data/build-dir/AVTST-TEST15-JOB1/AvlswebScripts/Ant/build.xml:286: java.io.IOException异常:错误写入请求主体服务器
在sun.net.www.protocol.http.HttpURLConnection$StreamingOutputStream.checkError(HttpURLConnection.java:3192)
在sun.net.www.protocol.http.HttpURLConnection $ StreamingOutputStream.write(HttpURLConnection.java:3175)
在java.io.BufferedOutputStream.write(BufferedOutputStream.java:122)
在org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:242)
在org.apache.catalina.ant.DeployTask.execute(DeployTask.java:195)
在org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
在sun.reflect.GeneratedMethodAccessor4.invoke(来源不明)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:606)
在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
在org.apache.tools.ant.Task.perform(Task.java:348)
在org.apache.tools.ant.Target.execute(Target.java:435)
在org.apache.tools.ant.Target.performTasks(Target.java:456)
在org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
在org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
在org.apache.tools.ant.Project.executeTargets(Project.java:1248)
在org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:440)
在org.apache.tools.ant.taskdefs.CallTarget.execute(CallTarget.java:105)
在org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
在sun.reflect.GeneratedMethodAccessor4.invoke(来源不明)
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
在java.lang.reflect.Method.invoke(Method.java:606)
在org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
在org.apache.tools.ant.Task.perform(Task.java:348)
在org.apache.tools.ant.Target.execute(Target.java:435)
在org.apache.tools.ant.Target.performTasks(Target.java:456)
在org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
在org.apache.tools.ant.Project.executeTarget(Project.java:1364)
在org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
在org.apache.tools.ant.Project.executeTargets(Project.java:1248)
在org.apache.tools.ant.Main.runBuild(Main.java:851)
在org.apache.tools.ant.Main.startAnt(Main.java:235)
在org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
在org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

但奇怪的是,构建作品,同时也精细部署到Tomcat。但是,由于某种原因,一个IOException异常导致红色构建失败竹消息在部署后发生。一对夫妇的补充说明:


  • Tomcat管理脚本用户设置

  • 与蚂蚁
  • 竹构建服务器是同一服务器作为目标tomcat的ApplicationServer的竹但是和靶向的Tomcat上运行的运行作为单独的端口单独的服务器。

  • 构建服务器:Atlassian的竹5.9.0

  • 蚂蚁版本:1.9.2

  • 的Tomcat版本:8.0.15

  • Java版本:1.7.0_67

任何想法?


解决方案

您将收到此错误,如果你已经部署到Tomcat服务器实例。您可以设置更新=真正的 tomcatdeploy

 &LT; tomcatdeploy
        URL =htt​​p://32.0.26.146:8080/manager/text
        用户名=下; veryHardToGuessUsername&gt;中
        密码=&LT; veryHardToGuessPassword&gt;中
        PATH =/ avlsweb
        war=\"/mnt/s/Web/Avlsweb/BambooBuilds/TEST/${nt-server.dir.test}_Tc${version}/avlsweb##${version}.war\"
        版本=$ {}版
        更新=真
        /&GT;

另一个选择是明确取消部署,然后重新部署,或使用重新加载标签,而不是部署标记。

I am new to StackExchange so please bear with my eventual mistakes...

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.

I am making a build an deployment script in ant. The deployment part is using this 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. 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. However, for some reason an IOException occurs after the deployment resulting in a "red" failed build message in Bamboo. A couple of additional remarks:

  • Tomcat manager-script user is setup
  • 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.
  • Build server: Atlassian Bamboo 5.9.0
  • Ant version: 1.9.2
  • Tomcat version: 8.0.15
  • Java version: 1.7.0_67

Any ideas?

解决方案

You will get this error if you already have an instance deployed to the Tomcat server. You can set update="true" in the tomcatdeploy:

<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.

这篇关于蚂蚁:&QUOT; IOException异常:错误写入请求的身体服务器&QUOT;在部署到Tomcat的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 02:17