我正在尝试建立一个新的Jenkins奴隶。 slave是一台linux机器,有OpenJDK。 java -version
返回
java version "1.6.0_39"
OpenJDK Runtime Environment (IcedTea6 1.13.11) (rhel-1.13.11.0.el6_7-x86_64)
OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
当我运行java -jar slave.jar -jnlpUrl http://server:81/computer/buildmachine/slave-agent.jnlp
时,奴隶似乎最初连接,然后立即命中异常。
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main createEngine
INFO: Setting up slave: buildmachine
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [http://server:81/]
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Handshaking
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to server:8080
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP3-connect
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Server didn't accept the handshake: Unknown protocol:Protocol:JNLP3-connect
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to server:8080
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Trying protocol: JNLP2-connect
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connected
Sep 12, 2016 10:57:11 AM hudson.remoting.SynchronousCommandTransport$ReaderThread run
SEVERE: I/O error in channel channel
java.io.IOException: Unexpected termination of the channel
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:73)
Caused by: java.io.EOFException
at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2349)
at java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:2818)
at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:803)
at java.io.ObjectInputStream.<init>(ObjectInputStream.java:301)
at hudson.remoting.ObjectInputStreamEx.<init>(ObjectInputStreamEx.java:48)
at hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:34)
at hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:59)
Sep 12, 2016 10:57:11 AM hudson.remoting.jnlp.Main$CuiListener status
INFO: Terminated
出了什么问题?
答案 0 :(得分:2)
JRE版本不够新。升级到更高版本的OpenJDK for Java 1.7,现在slave正确连接。
答案 1 :(得分:1)
来自https://jenkins.io/blog/2015/04/06/good-bye-java6:
你的Jenkins主人和所有构建奴隶需要运行 Java7 +