![安装 github oauth 插件后,jenkins 在 ubuntu 中重启失败](https://linux22.com/image/689141/%E5%AE%89%E8%A3%85%20github%20oauth%20%E6%8F%92%E4%BB%B6%E5%90%8E%EF%BC%8Cjenkins%20%E5%9C%A8%20ubuntu%20%E4%B8%AD%E9%87%8D%E5%90%AF%E5%A4%B1%E8%B4%A5.png)
嗨,我在 jenkins 中安装了 github oauth 插件,但由于设置不正确,我需要重新启动 jenkins。我将其替换<useSecurity>true</useSecurity>
为<useSecurity>false</useSecurity>
并尝试重新启动。但 jenkins 服务器重新启动失败并出现以下错误。请帮助解决。提前致谢。
SEVERE: Container startup failed
java.io.IOException: Failed to start a listener: winstone.Ajp13ConnectorFactory
at winstone.Launcher.spawnListener(Launcher.java:207)
at winstone.Launcher.<init>(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:246)
at Main.main(Main.java:91)
Caused by: java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:504)
at java.lang.Integer.parseInt(Integer.java:527)
at winstone.cmdline.Option.intArg(Option.java:291)
at winstone.cmdline.Option$OInt.get(Option.java:203)
at winstone.Ajp13ConnectorFactory.start(Ajp13ConnectorFactory.java:24)
at winstone.Launcher.spawnListener(Launcher.java:205)
答案1
问题解决了。
转到 /etc/init.d/jenkins 中的第 122 行
代替
$SU -l $JENKINS_USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- $JAVA $JAVA_ARGS -jar $JENKINS_WAR $JENKINS_ARGS" || return 2
到
$SU -l $JENKINS_USER --shell=/bin/bash -c "$DAEMON $DAEMON_ARGS -- $JAVA $JAVA_ARGS -jar $JENKINS_WAR $JENKINS_ARGS --ajp13Port=-1" || return 2