SoFunction
Updated on 2025-03-02

How to solve the problem of error::Cannot specify the requested address

Error::Unable to specify the requested address

Today I installed tomcat on the linux virtual machine, but it cannot be started. Check the log

Main error

As shown below:

Serious: : create[localhost:8005]:
: Unable to specify the requested address
    at (Native Method)
    at (:382)
    at (:375)
    at .<init>(:237)
    at (:444)
    at (:781)
    at (:727)
    at .invoke0(Native Method)
    at (:62)
    at (:4
    at (:497)
    at (:294)
    at (:428)

There is no result when using netstat -antp|grep 8005, which means that the port 8005 is not occupied, and it is useless to modify the port in this file. This can rule out the problem of port.

The information online says it is an IP binding problem

The IP address and its corresponding host name are recorded in the /etc/hosts file. The keyword localhost does not appear in this file. The following content is added and to restart tomcat is successful.

192.168.1.2(This machineIP) localhost

When tomcat is started, it will automatically obtain all localhost mapped IPs. This error will be reported when localhost has no mapped IPs or mapped IPs.

Summarize

The above is personal experience. I hope you can give you a reference and I hope you can support me more.