1

I am trying to figure out how write a simple java program in intellij that uses Apache Tomcat (I'm using Tomcat version 9 in this case). I have been trying to follow this tutorial: https://www.youtube.com/watch?v=ThBw3WBTw9Q&t=249s

I have followed the steps and my program looks like this: enter image description here enter image description here

However when I try to run the program and I try to access http://localhost:8080/HelloWebApp_war_exploded/api/hello-world I get a 404 error. I can't figure out the source of this error, what could possibly be causing this problem?

Doldrums
  • 133
  • 5
  • Do you know how to check if the war is deployed to the server? Do you know how look at the server logs? You'll want to know how to do these two things. If you have any errors in the server logs, you should post them. There are many reasons that could be the cause. You need to narrow it down for us. – Paul Samsotha Sep 07 '22 at 17:02
  • It looks like you need Tomcat 10 for jakarta servlets. Tomcat 9 will work with javax servlets. – CrazyCoder Sep 07 '22 at 17:04
  • So is there any way to make it work with Tomcat 9? – Doldrums Sep 07 '22 at 17:45
  • Please [don't upload text as image](https://meta.stackoverflow.com/a/285557/13447). Edit your question to contain all the information in text form - consider to use the editor's formatting options. Also see [ask]. – Olaf Kock Sep 07 '22 at 18:28
  • Tomcat 10 is mandatory for Jakarta servlets, see https://stackoverflow.com/a/71599797/104891. – CrazyCoder Sep 07 '22 at 18:45

0 Answers0