Description
Hello, I created a new web app(jakarta ee) using intellij idea.
I have not changed any file. All the files that exist in my project are the default files.
I tried to view the project by using the default configuration as described by many sites(that is using the war:exloded artifact) and I could only see the home page. When I tried to click on the link that it has on the homepage I got a 404 error.
The strange thing is that when I tried viewing the exact same application with the war:exploded artifact but the glassfish server, it all worked as expected.
How to reproduce:
- Create a new project using the Intellij idea.
- Create a new configuration using tomcat and in the deployment tab apply the war:exploded artifact
- try to run the deployment and enter the url in your browser.
- click on the default link on the webpage available
- See the 404 error
- Create the same configuration with glassfish and run it
- Watch the webpage work as expected
What did I try
I didn't think of many things to try. I tried changing the artifact that was being deployed but none of the available artifacts seemed to be working. So I have no idea what to do. But there could be an artifact that I missed to test.
CodePudding user response:
This will occur if you are trying to use incompatible version of Tomcat with Jakarta EE.
For example, if you are using Servlet 5.0.0
, like in the photo, then you have to have at least Tomcat 10.0.x
. Installing earlier version will simply not do.