Jenkins 在端口 8080 处无法访问

Jenkins 在端口 8080 处无法访问

这是我第一次设置 Jenkins。

HTTP 错误:503 访问 / 时出现问题。原因:服务不可用

我关闭了firewalld。jenkins来自官方jenkins yum repo。

java 版本“1.7.0_79”OpenJDK 运行环境(rhel-2.5.5.1.el7_1-x86_64 u79-b14)OpenJDK 64 位服务器 VM(构建 24.79-b02,混合模式)

May 05, 2015 9:59:54 PM org.eclipse.jetty.util.log.JavaUtilLog warn
WARNING: Failed startup of context w.{,file:/var/cache/jenkins/war/},/var/cache/jenkins/war
java.lang.NullPointerException
        at jenkins.util.groovy.GroovyHookScript.run(GroovyHookScript.java:63)
        at hudson.util.BootFailure.publish(BootFailure.java:43)
        at hudson.WebAppMain.contextInitialized(WebAppMain.java:247)
        at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
        at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)   
        at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
        at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
        at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
        at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
        at org.eclipse.jetty.server.Server.doStart(Server.java:282)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
        at winstone.Launcher.<init>(Launcher.java:154)
        at winstone.Launcher.main(Launcher.java:354)
        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:293)
        at Main.main(Main.java:98)

May 05, 2015 9:59:54 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started [email protected]:8080
May 05, 2015 9:59:54 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: Started [email protected]:8009
May 05, 2015 9:59:54 PM org.eclipse.jetty.util.log.JavaUtilLog info
INFO: AJP13 is not a secure protocol. Please protect port 8009
May 05, 2015 9:59:54 PM winstone.Logger logInternal
INFO: Winstone Servlet Engine v2.0 running: controlPort=disabled

答案1

有很多类似问题的错误报告,但它们似乎都是配置错误或安装错误的问题。一些解决方法是找到配置错误的插件并将其移出或安装字体包,但这些仍然只是解决方法。

您能否检查 /var/cache/jenkins 是否存在并且该目录的所有者是否为 jenkins 用户?

最近有一个类似的问题更新到这里

如果这不能解决你的问题你可以报告错误这里,很抱歉,但是能做的不多了。

答案2

java.lang.NullPointerException我使用新版本的 CentOS 6.3 和 Jenkins 1.617遇到了类似的问题,使用的是 Java 1.7.0.5。跟踪时/var/log/jenkins/jenkins.log,我注意到以下错误:

Caused by: java.lang.NullPointerException
    at sun.awt.X11FontManager.getDefaultPlatformFont(X11FontManager.java:779)
    at sun.font.SunFontManager$2.run(SunFontManager.java:432)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.SunFontManager.<init>(SunFontManager.java:375)
    at sun.awt.X11FontManager.<init>(X11FontManager.java:32)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
    at java.lang.Class.newInstance0(Class.java:372)
    at java.lang.Class.newInstance(Class.java:325)
    at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
    at java.awt.Font.getFont2D(Font.java:490)
    at java.awt.Font.getFamily(Font.java:1187)
    at java.awt.Font.getFamily_NoClientCode(Font.java:1161)
    at java.awt.Font.getFamily(Font.java:1153)
    at java.awt.Font.toString(Font.java:1650)
    at hudson.util.ChartUtil.<clinit>(ChartUtil.java:255)
    at hudson.WebAppMain.contextInitialized(WebAppMain.java:184)
    ... 19 more

我可以通过在系统上安装字体来解决这个问题,方法是运行以下命令:

sudo yum install dejavu-sans-fonts

一旦我安装了字体,我就能导航到前端并正确加载 Jenkins。

相关内容