在安装或更新Jenkins时遇到的坑

1、AJP support is removed in Winstone 3.0 due to Jetty 9 not supporting AJP.

java.io.IOException: Failed to start a listener: winstone.Ajp13ConnectorFactory
        at winstone.Launcher.spawnListener(Launcher.java:207)
        at winstone.Launcher.(Launcher.java:148)
        at winstone.Launcher.main(Launcher.java:352)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at Main._main(Main.java:264)
        at Main.main(Main.java:112)
Caused by: java.lang.UnsupportedOperationException: AJP support is removed in Winstone 3.0 due to Jetty 9 not supporting AJP. For reverse proxying, please use HTTP instead of AJP.
        at winstone.Ajp13ConnectorFactory.start(Ajp13ConnectorFactory.java:31)
        at winstone.Launcher.spawnListener(Launcher.java:205)
        ... 8 more

解决办法:

JENKINS_AJP_PORT="-1" in /etc/sysconfig/jenkins solved problem

参考地址:http://stackoverflow.com/a/38157687/6952713

2、bash: /usr/java/jdk1.7.0_51/bin: is a directory

在配置Jenkins的jdk时没有配置正确
vim /etc/init.d/jenkins



# Search usable Java. We do this because various reports indicated
# that /usr/bin/java may not always point to Java 1.5
# see http://www.nabble.com/guinea-pigs-wanted-----Hudson-RPM-for-RedHat-Linux-td25673707.html
for candidate in /usr/java/jdk1.7.0_51/bin/java /etc/alternatives/java /usr/lib/jvm/java-1.6.0/bin/java /usr/lib/jvm/jre-1.6.0/bin/java /usr/lib/jvm/java-1.5.0/bin/java /usr/lib/jvm/jre-1.5.0/bin/java /usr/bin/java
do
  [ -x "$JENKINS_JAVA_CMD" ] && break
  JENKINS_JAVA_CMD="$candidate"
done

其中在for candidate in后面加上/usr/java/jdk1.7.0_51/bin/java

参考地址:http://stackoverflow.com/a/25341901/6952713
http://www.jianshu.com/p/c3d0cf63fb8e

你可能感兴趣的:(Jenkins)