Preface
Today we are going to solve a common small problem on Tomcat server: the requested resource [/XXX/] is not available. Don't worry, even if you are a programming novice, I will use the simplest language to help you solve problems step by step. Let's get started! 😸
1. Understand the problem
First, when you see the Tomcat report "Requested Resource[/XXX/] is not available", it is usually because the server cannot find the part of the content you requested. It's like you can't find the book you want in a library. Our goal is to find out why the server cannot find this resource.
2. Check whether the URL is correct
- Open the browser and carefully check if the URL you entered is correct.
- Make sure that every part of the URL is free of spelling errors.
3. Check your Tomcat settings
a. Check your
Open your web project folder and find
WEB-INF
There is a folder insidedocument.
-
have a look
<servlet-mapping>
In section, confirm that the URL pattern matches your request.<servlet-mapping> <servlet-name>myServlet</servlet-name> <url-pattern>/XXX</url-pattern> </servlet-mapping>
b. Confirm whether the project is deployed
- Make sure your web application or project has been deployed to Tomcat
webapps
Under the folder. - If you are using development tools like IDEA, check whether the project is built and deployed correctly.
4. Use IDEA to configure the project (for IDEA users)
If you are using IntelliJ IDEA, follow these steps to configure:
a. Open Project Settings
- In IDEA, click
File
>Project Structure
。
b. Configure Artifacts
- choose
Artifacts
, click+
, add WAR package. - Make sure to include all necessary files and resources.
c. Set the output directory
- Set Artifact's output directory to Tomcat
webapps
Folder.
d. Save and build
- Click
OK
Save settings. - Build the project and make sure there are no errors.
5. View server log
- Under the Tomcat installation folder, find
logs
Folder, opendocument.
- Look for error messages that match the time you requested, and it will give you some clues.
6. Final check and restart
- After all settings are completed, restart the Tomcat server.
- Try to access your URL again.
7. Summary
Don't worry, making mistakes is part of the learning process. Follow these steps and you should be able to find out where the problem lies and solve it. If you still have difficulties, don't be afraid to turn to others or look for resources online.
This is the article about the solution to the unavailable problem of Tomcat requested resources[/XXX/]. This is the end of this article. For more relevant Tomcat requested resources[/XXX/]. Please search for my previous articles or continue browsing the related articles below. I hope everyone will support me in the future!