错误现象:运行 slave-agent.jnlp 时弹出MessageBox(会间隔若干秒的连续弹出5次), 错误提示 "java.lang.exception: the server rejected the connect"


当时环境: 
slave 机器为 windows平台
启动方式为 Luanch agent via Java Web Start
slave 机器上已经预先部署了一套jenkins环境,通过tomcat启动.
jnlp的内容大致如下:
<jnlp codebase="http://localhost:8080/jenkins/computer/android_2_p15000000_5/" spec="1.0+"><information><title>Agent for android_2_p15000000_5</title><vendor>Jenkins project</vendor><homepage href="https://jenkins-ci.org/"/></information><security><all-permissions/></security><resources><j2se version="1.7+"/><jar href="http://localhost:8080/jenkins/jnlpJars/remoting.jar"/><property name="hudson.showWindowsServiceInstallLink" value="true"/></resources><application-desc main-class="hudson.remoting.jnlp.Main"><argument>1ac27fe7c1b8659f3f99c23a596e1cbe8ae888c7d967b5f8d069546b62c023bb</argument><argument>android_2_p15000000_5</argument><argument>-url</argument><argument>http://localhost:8080/jenkins/</argument><argument>-url</argument><argument>http://10.5.58.186:8080/jenkins/</argument></application-desc></jnlp>


错误原因:
1、jnlp的内容中,有2处错误的引用了 localhost:8080 地址
a、 codebase="http://localhost:8080/jenkins/computer/android_2_p15000000_5/" 
b、 jar href="http://localhost:8080/jenkins/jnlpJars/remoting.jar"
2、不正确的生成了一个多余的 -url 参数描述
<argument>-url</argument><argument>http://localhost:8080/jenkins/</argument>


修改方法:
对于1、直接修改为master所在机器的地址,比如这里为 10.5.58.186:8080
对于2、删除这个多余的 -url 参数定义.




ps:各种查,因为还有一个slave是对的,差点就要从那个对的机器上做磁盘克隆了:DDDD, 真坑爹.


Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐