Reputation: 1226
In an acquired RESTful Spring Boot Web application with some restrictions that runs properly with IntelliJ IDEA v2022.02.05, I am asked to start the project without it. So, I started it in the command prompt under Windows 11 Pro.
Apache Tomcat 6.0.53 (with a CATALINA_BASE
directory of Apache Tomcat 6.0.37!) works flowlessly. This is at least what I see in the logs. But it seems to be impossible to make the standard test of opening http://localhost:8080/
(→ HTTP ERROR 404).
Checked who is blocking the port 8080.
D:\tools\apache-tomcat-6.0.53>netstat -abno | find "8080"
TCP 0.0.0.0:8080 0.0.0.0:0 ABHÖREN 22512
It seems that currently, only Apache Tomcat is "listening" to the port (ABHÖREN = LISTEN).
Checked, if an index.html
file exists in %CATALINA_HOME%\webapps\ROOT
.
Checked the contents of index.html
.
Added a new simple HTML file into %CATALINA_HOME%\webapps\ROOT
called test.html
and tried to open http://localhost:8080/test.html
, but got again the HTTP ERROR 404.
In the %CATALINA_HOME%\conf\server.xml
file, I added for test purposes the code <Context path="" docBase="ROOT" />
:
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context path="" docBase="ROOT" /> <!-- 2025-01-28 SAE: Test! -->
…
</Host>
Added in %CATALINA_HOME%\webapps\ROOT\WEB-INF
to web.xml
the following lines:
<welcome-file-list> <!-- 2025-01-28 SAE: Test! -->
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list> <!-- 2025-01-28 SAE: Test! -->
As the predecessor has left the project, I do not know why Catalina uses the %CATALINA_BASE%
directory. (Once, I changed it to 6.0.53 in the IDE, and the project was unable to start.) To be sure that Tomcat is not using the webapps
directory of the little older version, I added a ROOT
directory there under webapps
with the same index.html
from 6.0.53.
Checked the log file altered today, but there is no error or warning. Only what you see in the Tomcat window in the first image above.
Cleaned the Microsoft Edge browser cache (v132.0.2957.127 (official build, 64 bit)) and tried again.
Tried to reach the IP address over Google Chrome (version 131.0.6778.267 (official build, 64 bit)). Cleaned the browser cache and tried again.
When Apache Tomcat 6.0.53 opens from the command prompt, the following is displayed in the Tomcat window:
31.01.2025 08:14:01 org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.2.12 using APR version 1.5.2.
31.01.2025 08:14:01 org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
31.01.2025 08:14:01 org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized with version OpenSSL 1.0.2k 26 Jan 2017
31.01.2025 08:14:02 org.apache.coyote.http11.Http11AprProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
31.01.2025 08:14:02 org.apache.coyote.ajp.AjpAprProtocol init
INFO: Initializing Coyote AJP/1.3 on ajp-8009
31.01.2025 08:14:02 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1030 ms
31.01.2025 08:14:02 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
31.01.2025 08:14:02 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.53
31.01.2025 08:14:02 org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
31.01.2025 08:14:02 org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-8009
31.01.2025 08:14:02 org.apache.catalina.startup.Catalina start
INFO: Server startup in 53 ms
Do you have an idea what could be the cause of the problem when starting Apache Tomcat directly from the command prompt?
What site should I have checked to solve this problem?
JAVA_HOME
to this directory. With this change, Tomcat run and localhost:8080
showed the test page.With the same changes on my company notebook, I get the following warning:
The message reads "The Windows Firewall has blocked some functions of Java(TM) Platform SE binary in all public and private networks." And below, it read "(i) This setting is managed by your organization."
I think this may be a Firewall issue, but I am not sure. I will inform you whenever I know more about it.
I am working in home office an talked to our firewall expert. Although he set the JVM on the list, it is still not running here over the VPN connection. But on my notebook, it is running and localhost:8080
shows the index.html
in the ROOT
directory.
Upvotes: -4
Views: 144
Reputation: 11
You can try and define the localhost in host file (C:\Windows\System32\drivers\etc
):
xxx.x.x.x(ip address) localhost
Upvotes: 1