当前位置: 首页 > 面试题库 >

执行war文件时安装Jenkins的问题

戚建华
2023-03-14
问题内容

我在Windows中使用Jenkins 2.73.1。当执行以下命令安装Jenkins时,

java -jar jenkins.war

我收到以下错误:

C:\Program Files (x86)\Jenkins>java -jar jenkins.war
Running from: C:\Program Files (x86)\Jenkins\jenkins.war
webroot: $user.home/.jenkins
[33mOct 28, 2017 12:01:28 AM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file C:\Users\user\AppData\Local\Temp\winstone\jenkins.war
[0mOct 28, 2017 12:01:28 AM org.eclipse.jetty.util.log.Log initialized
INFO: Logging initialized @1490ms to org.eclipse.jetty.util.log.JavaUtilLog
Oct 28, 2017 12:01:28 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
[33mOct 28, 2017 12:01:28 AM org.eclipse.jetty.server.handler.ContextHandler setContextPath
WARNING: Empty contextPath
[0mOct 28, 2017 12:01:28 AM org.eclipse.jetty.server.Server doStart
INFO: jetty-9.4.z-SNAPSHOT
Oct 28, 2017 12:01:31 AM org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServlet
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Oct 28, 2017 12:01:31 AM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: DefaultSessionIdManager workerName=node0
Oct 28, 2017 12:01:31 AM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: No SessionScavenger set, using defaults
Oct 28, 2017 12:01:31 AM org.eclipse.jetty.server.session.HouseKeeper startScavenging
INFO: Scavenging every 660000ms
Jenkins home directory: C:\Users\user\.jenkins found at: $user.home/.jenkins
Oct 28, 2017 12:01:33 AM org.eclipse.jetty.server.handler.ContextHandler doStart
INFO: Started w.@4bdeaabb{/,file:///C:/Users/user/.jenkins/war/,AVAILABLE}{C:\Users\user\.jenkins\war}
Oct 28, 2017 12:01:33 AM org.eclipse.jetty.server.AbstractConnector doStop
INFO: Stopped ServerConnector@7a5ceedd{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
Oct 28, 2017 12:01:33 AM org.eclipse.jetty.server.session.HouseKeeper stopScavenging
INFO: Stopped scavenging
Oct 28, 2017 12:01:33 AM hudson.WebAppMain contextDestroyed
INFO: Shutting down a Jenkins instance that was still starting up
java.lang.Throwable: reason
        at hudson.WebAppMain.contextDestroyed(WebAppMain.java:390)
        at org.eclipse.jetty.server.handler.ContextHandler.callContextDestroyed(ContextHandler.java:898)
        at org.eclipse.jetty.servlet.ServletContextHandler.callContextDestroyed(ServletContextHandler.java:545)
        at org.eclipse.jetty.server.handler.ContextHandler.stopContext(ContextHandler.java:873)
        at org.eclipse.jetty.servlet.ServletContextHandler.stopContext(ServletContextHandler.java:355)
        at org.eclipse.jetty.webapp.WebAppContext.stopWebapp(WebAppContext.java:1507)
        at org.eclipse.jetty.webapp.WebAppContext.stopContext(WebAppContext.java:1471)
        at org.eclipse.jetty.server.handler.ContextHandler.doStop(ContextHandler.java:927)
        at org.eclipse.jetty.servlet.ServletContextHandler.doStop(ServletContextHandler.java:271)
        at org.eclipse.jetty.webapp.WebAppContext.doStop(WebAppContext.java:569)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.stop(ContainerLifeCycle.java:142)
        at org.eclipse.jetty.util.component.ContainerLifeCycle.doStop(ContainerLifeCycle.java:160)
        at org.eclipse.jetty.server.handler.AbstractHandler.doStop(AbstractHandler.java:124)
        at org.eclipse.jetty.server.Server.doStop(Server.java:523)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.stop(AbstractLifeCycle.java:89)
        at winstone.Launcher.shutdown(Launcher.java:307)
        at winstone.Launcher.<init>(Launcher.java:167)
        at winstone.Launcher.main(Launcher.java:354)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at Main._main(Main.java:294)
        at Main.main(Main.java:132)

Oct 28, 2017 12:01:33 AM org.eclipse.jetty.server.handler.ContextHandler doStop
INFO: Stopped w.@4bdeaabb{/,null,UNAVAILABLE}{C:\Users\user\.jenkins\war}
Exception in thread "Jenkins initialization thread" java.lang.NoClassDefFoundError: hudson/util/HudsonFailedToLoad
        at hudson.WebAppMain$3.run(WebAppMain.java:249)
Caused by: java.lang.ClassNotFoundException: hudson.util.HudsonFailedToLoad
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:560)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 1 more
Oct 28, 2017 12:01:33 AM winstone.Logger logInternal
INFO: Winstone shutdown successfully
java.io.IOException: Failed to start Jetty
        at winstone.Launcher.<init>(Launcher.java:156)
        at winstone.Launcher.main(Launcher.java:354)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at Main._main(Main.java:294)
        at Main.main(Main.java:132)
Caused by: java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
        at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:298)
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
        at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.server.Server.doStart(Server.java:431)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at winstone.Launcher.<init>(Launcher.java:154)
        ... 7 more
[31mOct 28, 2017 12:01:33 AM winstone.Logger logInternal
SEVERE: Container startup failed
java.io.IOException: Failed to start Jetty
        at winstone.Launcher.<init>(Launcher.java:156)
        at winstone.Launcher.main(Launcher.java:354)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at Main._main(Main.java:294)
        at Main.main(Main.java:132)
Caused by: java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.Net.bind(Unknown Source)
        at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source)
        at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source)
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:298)
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
        at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:236)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at org.eclipse.jetty.server.Server.doStart(Server.java:431)
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
        at winstone.Launcher.<init>(Launcher.java:154)
        ... 7 more

[0m

有人可以帮忙吗?


问题答案:

好吧,我在您的堆栈跟踪中看到了一些似乎很可能引起问题的东西。值得注意的是这两个:

Exception in thread "Jenkins initialization thread" java.lang.NoClassDefFoundError: hudson/util/HudsonFailedToLoad
Caused by: java.lang.ClassNotFoundException: hudson.util.HudsonFailedToLoad

java.io.IOException: Failed to start Jetty
Caused by: java.net.BindException: Address already in use: bind

基本上,这里有两个问题,第一个是您的Jenkins试图绑定的端口已经在使用中,尝试弄清楚端口码头想要绑定的端口(通常是80或8080,如果我的记忆)。

第二个问题是,我认为它找不到试图抛出的异常的类。

我不确定怎么回事,我释放了端口,看问题是否消失了,如果找不到,为什么您的类路径中缺少该类



 类似资料:
  • 问题内容: 我正在尝试将C#硒自动化与Jenkins集成在一起。我安装了jenkins,并且可以在Chrome上以管理员身份启动jenkins。但是我在命令提示符下运行此命令时看到以下问题 我当前正在使用:Windows 10,jdk1.8.0_151,Jenkins 2.94我正在这里复制完整错误。 我不确定为什么“ java -jar jenkins.war”命令抛出错误。 我遵循了这一点:执

  • 升级jenkins版本后,我无法安装任何插件<我能理解这是一个证书错误。你能告诉我决议吗? 太阳安全供应商。certpath。SunCertPathBuilderException:找不到请求目标的有效证书路径

  • 平均堆栈应用程序模板创建 我需要通过npm安装应用程序的依赖项: npm install 或 npm install--dev 或 npm install--only=dev package.json 提前致谢

  • 在Worklight Server上安装WAR文件后,我尝试转到控制台并收到以下消息: 由应用程序类抛出的异常'com.worklight.core.auth.impl.身份验证Filter.verifyServlet初始化:300'javax.servlet.ServletException:Worklight Console初始化失败。记录异常:java.lang.不支持ClassVersio

  • 问题内容: 我公司已经开发了一个Web应用程序(J2EE环境/ Tomcat服务器),并希望将其作为产品出售。客户可以将此产品用作基本版或高级版。在高级版中,客户具有一些额外的功能(可能是一些额外的链接)。这种区别是基于串行密钥进行的。 讨论上述问题时,我只是一个听众。 是否可以解决上述问题?我们如何将War文件转换为exe文件并嵌入逻辑以区分高级版本或基本版本。 问题答案: 我们如何将War文件

  • 问题内容: 我已经编写了一个Jenkins Groovy脚本,用于在启动时安装Jenkins插件。Groovy脚本以用于调用我的脚本的Hook命名。例如,init- Hook内部触发了init.groovy。该挂钩在初始化后触发。 在初始化期间,我无权访问UpdateCenter,也无法安装插件。我还能使用其他哪些詹金斯挂钩?我认为我需要一个启动后的挂钩。 该脚本可在脚本控制台中使用,但不能在后初