WildFly started with errors: java.net.BindException: Address already in use

后端 未结 5 690
独厮守ぢ
独厮守ぢ 2020-12-15 08:21

When I start WildFly in Eclipse, I get this error:

22:03:42,430 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start servic         


        
5条回答
  •  情话喂你
    2020-12-15 08:48

    WildFly is trying to use a port in your PC is already in use. Check in your logs for: “Caused by: java.net.BindException: Address already in use: bind

    Check the port WildFly is using and then you can check if this port is being use for any other application, it could be another instance of WildFly but can be any other application too. For example the port 80 could be apache/IIS or any other web server running in your PC.

    Normally WildFly (and JBOSS) use 8080 by default and looks like you have an application listen in this port, also WildFly use few more ports for other protocols and management that the app server needs. Using the command netstat you can check what other app is using those ports, for example (for 8080 port) you can use the command:

    netstat -aon | findstr :8080

    If you want to do a quick test you can pass this parameter to WildFly “-Djboss.socket.binding.port-offset=2000” this will increase all the ports JBOSS/WildFly use by 2000 (or any other value), then for example if your WildFly was running in "localhost:8080/your-context" now will be "localhost:10080/your-context".

    If your JBOSS/WildFly is running in port 80 you can play with this parameter to test with another port too, for example “-Djboss.socket.binding.port-offset=10000” will bring you also with the port 10080.

    Good luck ;)

提交回复
热议问题