我正在尝试将C#硒自动化与Jenkins集成在一起。我安装了jenkins,并且可以在Chrome上以管理员身份启动jenkins。但是我在命令提示符下运行此命令时看到以下问题 $ java -jar jenkins.war
$ 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”命令抛出错误。
我遵循了这一点:执行war文件时安装Jenkins时出现问题, 但没有帮助我。
发生了完全相同的问题打开Jenkins.xml搜索–httpPort = 8080,并用您希望的新端口号NOT IN USE(例如9090)替换8080,以管理员模式X:\ Jenkins_generic> java -jar jenkins打开cmd .war –httpPort = 9090
詹金斯开始没有问题