简体   繁体   中英

Cannot run Sonatype Nexus in local

Steps to reproduce

  1. Downloaded the nexus-3.3.0-01-win64.zip
  2. Extract the zip file in D drive
  3. cd D:/nexus-3.3.0-01-win64/nexus-3.3.0-01/bin
  4. nexus.exe /run

    Expected result:

Started Nexus Repository Manager 3.3.0-01

Actual result:

2017-06-15 10:41:53,104+0800 ERROR [jetty-main-1] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - Failed to start    
java.net.BindException: Address already in use: bind
        at sun.nio.ch.Net.bind0(Native Method) [na:1.8.0_102]
        at sun.nio.ch.Net.bind(Unknown Source) [na:1.8.0_102]
        at sun.nio.ch.Net.bind(Unknown Source) [na:1.8.0_102]
        at sun.nio.ch.ServerSocketChannelImpl.bind(Unknown Source) [na:1.8.0_102]
        at sun.nio.ch.ServerSocketAdaptor.bind(Unknown Source) [na:1.8.0_102]
        at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:326) [org.eclipse.jetty.server:9.3.7.v20160115]
        at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80) [org.eclipse.jetty.server:9.3.7.v20160115]
        at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:244) [org.eclipse.jetty.server:9.3.7.v20160115]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [org.eclipse.jetty.util:9.3.7.v20160115]
        at org.eclipse.jetty.server.Server.doStart(Server.java:384) [org.eclipse.jetty.server:9.3.7.v20160115]
        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68) [org.eclipse.jetty.util:9.3.7.v20160115]
        at org.sonatype.nexus.bootstrap.jetty.JettyServer$JettyMainThread.run(JettyServer.java:274) [org.sonatype.nexus.bootstrap:3.3.0.01]

Answer already given in comments by @rseddon . Adding it here so that the answer can be accepted.

java.net.BindException means that the process cannot listen on the given port as the port is already occupied (usually by an existing process). In the case of nexus start up, it indicates that some other process is listening on this port.

You can either find that process and kill it. On MS Windows, this could be found out by running netstat and tasklist as follows (assuming port 8081 is where its trying to bind and the first command gives pid 2216):

netstat -ano | findStr "8081"
tasklist /fi "pid eq 2216"

Or you could change the port nexus is trying to listen on , which is specified in the file <installDir>\\sonatype-work\\nexus3\\nexus.properties .

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