java jenkins 中的容器启动失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45008564/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-11-03 08:27:28  来源:igfitidea点击:

container start up failed in jenkins

javajenkinscmdwar

提问by Neeli sarath

When I use the command prompt in windows to run the command java -jar jenkins.warIt is giving me the following error:

当我在 Windows 中使用命令提示符运行命令时,java -jar jenkins.war它给了我以下错误:

SEVERE: Container startup failedjava.io.IOException: Failed to start Jetty
    at winstone.Launcher.<init>(Launcher.java:154)
    at winstone.Launcher.main(Launcher.java:352)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at Main._main(Main.java:293)
    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(Net.java:433)
    at sun.nio.ch.Net.bind(Net.java:425)
    at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    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:152)
    ... 7 more

回答by Seelenvirtuose

The cause of your error:

你的错误原因:

Caused by: java.net.BindException: Address already in use: bind

引起:java.net.BindException:地址已在使用:绑定

Explanation: As a default, Jenkins uses the port 8080 (like many other web applications do, too). Obviously, you already have another application listening on port 8080.

说明:默认情况下,Jenkins 使用端口 8080(与许多其他 Web 应用程序一样)。显然,您已经有另一个应用程序在侦听端口 8080。

So you should bind Jenkins to another port. See Starting and Accessing Jenkinsfor more information. For example, you can start with

所以你应该将 Jenkins 绑定到另一个端口。有关更多信息,请参阅启动和访问 Jenkins。例如,您可以从

java -jar jenkins.war --httpPort=8081

回答by RileyManda

cd into your jenkins folder from your terminal(Where you installed it)

cd 从终端(安装位置)进入 jenkins 文件夹

cd jenkins

then in your terminal change the port(Whatever port you want to use):

然后在您的终端中更改端口(您要使用的任何端口):

java -jar jenkins.war --httpPort=9090

Jenkins will change ports and restart.And run without any errors.

Jenkins 将更改端口并重新启动。并且运行没有任何错误。

Load jenkins from your browser:

从浏览器加载 jenkins:

http://localhost:9090

Also this error sometimes occurs when you have not completed the full installation of jenkins.At the point where jenkins chooses a random browser to continue with installation,just follow along and use the browser its chosen to open and complete the installation following the screen prompts.Once installation is completed,you have the freedom to use whatever browser you see fit.

当您尚未完成 jenkins 的完整安装时,有时也会出现此错误。当 jenkins 选择随机浏览器继续安装时,只需按照屏幕提示使用其选择的浏览器打开并完成安装。安装完成后,您可以自由使用任何您认为合适的浏览器。

Another thing to keep in mind is:If you had a previous installation of jenkins before the one you just installed,you need tocheck and ensure all the old jenkins files were deleted and cleaned out of your system before initializing the new installation.

要记住的另一件事是:如果您在刚刚安装之前安装了 jenkins,则需要在初始化新安装之前检查并确保所有旧的 jenkins 文件都已删除并从系统中清除。

回答by jayesh

this port is already used in some other services. you can start jenkins server any port using below command java -jar jenkins.war --httpPort=8081

此端口已在其他一些服务中使用。您可以使用以下命令启动 jenkins 服务器的任何端口 java -jar jenkins.war --httpPort=8081