window下Jenkins使用问题记录(二)之部署Tomcat问题

1.Jenkins部署TomcatManagerExcepion问题

1.1异常提示:

Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The username you provided is not allowed to use the text-based Tomcat Manager (error 403)

解决方法是到tomcat的 /webapps/manager/META_INF/context.xml文件,将文件中对访问的来源受限设置注释

<Context antiResourceLocking="false" privileged="true" >
<!--
  <Valve className="org.apache.catalina.valves.RemoteAddrValve"
         allow="127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1" />
--> //注释掉即可
  <Manager sessionAttributeValueClassNameFilter="java\.lang\.(?:Boolean|Integer|Long|Number|String)|org\.apache\.catalina\.filters\.CsrfPreventionFilter\$LruCache(?:\$1)?|java\.util\.(?:Linked)?HashMap"/>
</Context>

1.2异常提示

org.codehaus.cargo.container.ContainerException: Failed to undeploy [C:\Users\F3234199\.jenkins\workspace\******web.war]
**************************
      省略中间异常信息
************************
Caused by: org.codehaus.cargo.container.tomcat.internal.TomcatManagerException: The Tomcat Manager responded "FAIL - Unable to delete [D:\Project\apache-tomcat-8.5.24\webapps\**-web]. The continued presence of this file may cause problems.
" instead of the expected "OK" message

解决办法:

   1. 打开tomcat安装目录下的/conf/context.xml

    2.修改<Context>元素中增加一个属性antiResourceLocking="true" antiJARLocking="true",默认是"false"

<Context antiResourceLocking="true" antiJARLocking="true">

    <!-- Default set of monitored resources. If one of these changes, the    -->
    <!-- web application will be reloaded.                                   -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <WatchedResource>${catalina.base}/conf/web.xml</WatchedResource>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->
</Context>

 

2.Jenkins部署SocketException异常提示

ERROR: Build step failed with exception
org.codehaus.cargo.container.ContainerException: Failed to redeploy

-----------------省略其他提示信息---------------

Caused by: java.net.SocketException: Software caused connection abort: recv failed
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)

-----------------省略其他提示信息---------------
java.net.SocketException: Software caused connection abort: recv failed

可能出现的问题点,构建后操作的  Context Path 配置有问题,配置的是发布tomcat后的访问地址路径

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值