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

执行War File命令时Jenkins中的问题

劳昊明
2023-03-14
问题内容

我正在尝试将C#硒自动化与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”命令抛出错误。

我遵循了这一点:执行war文件时安装Jenkins时出现问题, 但没有帮助我。


问题答案:

发生了完全相同的问题打开Jenkins.xml搜索–httpPort = 8080,并用您希望的新端口号NOT IN
USE(例如9090)替换8080,以管理员模式X:\ Jenkins_generic> java -jar jenkins打开cmd .war
–httpPort = 9090

詹金斯开始没有问题



 类似资料:
  • 问题内容: 尝试构建时出现以下错误: Jenkins 2.7.1在Windows Server 2012 R2上运行(在Jenkins 2.7.4上发生了相同的错误)。我可以通过git命令行克隆仓库,没有任何问题。发生这种情况时,我可以在任务管理器屏幕快照中看到多个git进程树,如果我稍等片刻,我会在Jenkins中看到它。 问题答案: 罪魁祸首是Git插件。更新后开始工作。我正在使用2.5.3版

  • 我正在我的电脑上运行Jenkins作为Windows服务。我正在努力学习使用它。对于虚拟作业,构建步骤之一是使用以下命令执行Windows批处理命令 当我在Jenkins上构建作业时,我得到一个构建错误,即JLink不被识别为内部或外部命令、可操作程序或批处理文件。当我从命令提示符下运行命令时,它运行起来没有任何问题。Windows路径已设置为安装JLink的路径。我应该在Jenkins中另外配置

  • 我正在尝试执行来自Jenkins窗口批处理命令的以下命令 但每次失败并给出错误:“csslint不被识别为内部或外部命令、可操作程序或批处理文件。” 我已经正确设置了Nodejs路径,并且成功地从命令提示符执行了上述命令。 有人能帮我吗?

  • 但当我从詹金斯的工作中运行它时,它不在那里 path=/usr/local/sbin://usr/local/bin://usr/sbin://usr/bin://sbin://usr/games://usr/local/games_=/usr/bin/

  • null dotnet sonarscanner begin/d:sonar.host.url=http://abcd.com:9000/d:sonar.login=xyz/d:sonar.password=xyz/k:“sampleProject”/d:sonar.cs.opencover.reportspaths=“d:\JenkinsWorkspace\workspace\samplePro

  • 我在Docker中执行触摸命令时遇到问题。 'touch'不被识别为内部或外部命令、可操作程序或批处理文件。