执行war file命令时Jenkins中的问题

时间:2017-12-14 01:03:20

标签: java jenkins

我正在尝试将c#selenium自动化与Jenkins集成。我安装了jenkins,我可以在Chrome上以管理员身份启动jenkins。但是当我在命令提示符下运行此命令时,我看到下面的问题      $ java -jar jenkins.war

我目前正在使用:windows 10,jdk1.8.0_151,Jenkins 2.94 我在这里复制完整的错误。

         C:\Program Files (x86)\Jenkins>java -jar jenkins.war
Running from: C:\Program Files (x86)\Jenkins\jenkins.war
webroot: $user.home/.jenkins
[33mDec 14, 2017 8:39:13 AM Main deleteWinstoneTempContents
WARNING: Failed to delete the temporary Winstone file C:\Users\Mike\AppData\Local\Temp\winstone\jenkins.war
[0mDec 14, 2017 8:39:13 AM org.eclipse.jetty.util.log.Log initialized
INFO: Logging initialized @708ms to org.eclipse.jetty.util.log.JavaUtilLog
Dec 14, 2017 8:39:13 AM winstone.Logger logInternal
INFO: Beginning extraction from war file
[33mDec 14, 2017 8:39:13 AM org.eclipse.jetty.server.handler.ContextHandler setContextPath
WARNING: Empty contextPath
[0mDec 14, 2017 8:39:13 AM org.eclipse.jetty.server.Server doStart
INFO: jetty-9.4.z-SNAPSHOT
Dec 14, 2017 8:39:19 AM org.eclipse.jetty.webapp.StandardDescriptorProcessor visitServlet
INFO: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
Dec 14, 2017 8:39:19 AM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: DefaultSessionIdManager workerName=node0
Dec 14, 2017 8:39:19 AM org.eclipse.jetty.server.session.DefaultSessionIdManager doStart
INFO: No SessionScavenger set, using defaults
Dec 14, 2017 8:39:19 AM org.eclipse.jetty.server.session.HouseKeeper startScavenging
INFO: Scavenging every 660000ms
Jenkins home directory: C:\Users\Mike\.jenkins found at: $user.home/.jenkins
Dec 14, 2017 8:39:20 AM org.eclipse.jetty.server.handler.ContextHandler doStart
INFO: Started w.@6f53b8a{/,file:///C:/Users/Mike/.jenkins/war/,AVAILABLE}{C:\Users\Mike\.jenkins\war}
Dec 14, 2017 8:39:20 AM org.eclipse.jetty.server.AbstractConnector doStop
INFO: Stopped ServerConnector@4e5ed836{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
Dec 14, 2017 8:39:20 AM org.eclipse.jetty.server.session.HouseKeeper stopScavenging
INFO: Stopped scavenging
Dec 14, 2017 8:39:20 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:388)
        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)

Exception in thread "Jenkins initialization thread" Dec 14, 2017 8:39:20 AM org.eclipse.jetty.server.handler.ContextHandler doStop
INFO: Stopped w.@6f53b8a{/,null,UNAVAILABLE}{C:\Users\Mike\.jenkins\war}
java.lang.NoClassDefFoundError: hudson/util/HudsonFailedToLoad
        at hudson.WebAppMain$3.run(WebAppMain.java:247)
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
Dec 14, 2017 8:39:20 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
        [31mDec 14, 2017 8:39:21 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

我不确定为什么“java -jar jenkins.war”命令抛出错误。

我遵循了这个:Issue in installing Jenkins when executing war file但没有帮助我。

2 个答案:

答案 0 :(得分:1)

我解决了这个问题:错误地我也下载了&#34; windows&#34;安装程序(从这里https://jenkins.io/download/)并尝试运行Jenkins。

但是我只能安装#34; Generic java包.war&#34;文件然后给java -jar jenkins.war,现在问题似乎解决了我的结局。

其他帖子也说要下载Tomcat Apache端口问题,我不太确定。

答案 1 :(得分:1)

有完全相同的问题 打开Jenkins.xml 搜索--httpPort = 8080并将8080替换为您希望的新端口号(例如9090) 在管理员模式下打开cmd X:\ Jenkins_generic&gt; java -jar jenkins.war --httpPort = 9090

詹金斯开始没有问题