Jenkins 无法在 Fedora 27 上运行

Jenkins 无法在 Fedora 27 上运行

在经过相当标准的安装过程之后,我无法让 Jenkins 在 Fedora 27 上运行。

dnf install jenkins
systemctl start jenkins

wget localhost:8080
 --2018-09-27 21:27:51--  http://localhost:8080/
 Resolving localhost (localhost)... ::1, 127.0.0.1
 Connecting to localhost (localhost)|::1|:8080... connected.
 HTTP request sent, awaiting response... 500 Server Error
 2018-09-27 21:27:51 ERROR 500: Server Error.



rpm -qa | grep java
java-1.8.0-openjdk-1.8.0.181.b15-0.fc27.x86_64
javapackages-tools-5.0.0-8.fc27.noarch
java-1.8.0-openjdk-devel-1.8.0.181.b15-0.fc27.x86_64
owasp-java-html-sanitizer-20160422.1-1.fc25.noarch
abrt-java-connector-1.1.0-14.fc27.x86_64
javamail-1.5.2-5.fc27.noarch
tzdata-java-2018e-1.fc27.noarch
java-1.8.0-openjdk-headless-1.8.0.181.b15-0.fc27.x86_64
jenkins-javadoc-plugin-1.3-4.fc24.noarch

rpm -q jenkins
jenkins-1.651.3-6.fc27.noarch

Jenkins 日志抱怨缺少某些方法java.lang.NoSuchMethodError: org.dom4j.io.HTMLWriter.setEnabled

WARNING: EXCEPTION
javax.servlet.ServletException: org.apache.commons.jelly.JellyTagException: jar:file:/usr/share/jenkins/webroot/WEB-INF/lib/jenkins-core-1.651.3.jar!/lib/layout/layout.jelly:59:51: <st:contentType> org.dom4j.io.HTMLWriter.setEnabled(Z)V
        at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:103)
        at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
        at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
        at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:575)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.Dispatcher.forward(Dispatcher.java:276)
        at org.eclipse.jetty.server.Dispatcher.error(Dispatcher.java:112)
        at org.eclipse.jetty.server.handler.ErrorHandler.handle(ErrorHandler.java:86)
        at org.eclipse.jetty.server.Response.sendError(Response.java:351)
        at org.eclipse.jetty.server.Response.sendError(Response.java:419)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:579)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:533)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
        at org.eclipse.jetty.server.Server.handle(Server.java:370)
        at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
        at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
        at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
        at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644)
        at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)
        at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
        at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
        at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.commons.jelly.JellyTagException: jar:file:/usr/share/jenkins/webroot/WEB-INF/lib/jenkins-core-1.651.3.jar!/lib/layout/layout.jelly:59:51: <st:contentType> org.dom4j.io.HTMLWriter.setEnabled(Z)V
        at org.apache.commons.jelly.impl.TagScript.handleException(TagScript.java:745)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:289)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)
        at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)
        at org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
        at org.kohsuke.stapler.jelly.JellyViewScript.run(JellyViewScript.java:95)
        at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:63)
        at org.kohsuke.stapler.jelly.DefaultScriptInvoker.invokeScript(DefaultScriptInvoker.java:53)
        at org.kohsuke.stapler.jelly.JellyFacet$1.dispatch(JellyFacet.java:95)
        ... 43 more
Caused by: java.lang.NoSuchMethodError: org.dom4j.io.HTMLWriter.setEnabled(Z)V
        at org.kohsuke.stapler.jelly.HTMLWriterOutput.useHTML(HTMLWriterOutput.java:78)
        at org.kohsuke.stapler.jelly.ContentTypeTag.doTag(ContentTypeTag.java:52)
        at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)
        ... 52 more

我在 2 个 Fedora 安装中都遇到了这个问题。我更新了所有软件包。我不知道如何修复这个问题。消息日志中没有提示。有人能帮忙吗?

答案1

看起来这是一个Fedora 27 版 Jenkins 软件包依赖项存在错误

错误报告中建议的一个解决方法是使用 RHEL 的一个 rpm 包pkg.jenkins.io而不是官方的 Fedora 软件包。

答案2

尽管正如评论中指出的那样,我找到了一种可行的解决方法,但我不确定这是否是一种安全的解决方法。

这是dnf upgrade --best --allowerasing jenkins

jenkins-webtool 软件包的依赖关系已损坏,无法正常升级到 2.x 版本。这个问题确实应该在 fedora 软件包中修复。

相关内容