简体   繁体   中英

container start up failed in jenkins

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

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

The cause of your error:

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

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.

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

java -jar jenkins.war --httpPort=8081

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

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.

Load jenkins from your browser:

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.

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM