HTTP 404 error Java Enterprise Project

Answered

Hello !
So I'm a beginner to Java EE, I'm following a guide that uses the Eclipse IDE, I wanted to follow exactly the same guide with IntelliJ, so basically I tried to copy/paste files from my Eclipse project to the IntelliJ one. I can run my Tomcat server and everything but I always get to a HTTP 404 page. I also tried mapping to /toto, it doesn't work.

Here are my 2 projects :

https://www.dropbox.com/t/gYTo9Sx4tAZTYdqk

The OpenClassroom one is the intellij one, "test" is from the Eclipse IDE.

Thank you for helping me !

1
5 comments

Hello,

> I always get to a HTTP 404 page

I don't see Tomcat Run/Debug configuration in the attached project but most probably the issue is that you specified the wrong URL in Run/Debug configuration or in the browser. 

In my demo project, the configuration looks like this:

See also https://www.jetbrains.com/help/idea/creating-and-running-your-first-java-ee-application.html .

1

Here is my configuration : (I removed the extra "s" in the URL, it didn't fix it)

I also have this error in my web.xml file in the target folder (target/OpenClassroom-1.0-Snapshort/WEB-INF/web.xml), I don't know if it's relevant or not, and it's an error that I don't have the in web.xml file in my oother web-inf folder (src/webapp/web-inf/web.xml) :

0

The problem with Tomcat run configuration is that the application context in the URL is specified incorrectly.

You need to specify `http://localhost:8080/OpenClassroom_war_exploded` instead of `http://localhost:8080/OpenClassroom`.

> I don't have the in web.xml file in my oother web-inf folder (src/webapp/web-inf/web.xml)

Please read some documentation on how to create a servlet-based application. Currently, the project configuration does not look correct. I'd recommend you creating a sample project through IntelliJ wizard to get started:

- File | New | Project | Java Enterprise.

- Select Web Profile:

0

I'm a beginner to Java EE, I always get to a HTTP 404 page , I don't know why it alway get this error when I try go to localhost:8088/hello(I change port 8080 to 8088). And I also watch the video on Intellij website to create and still got 404.

I also go in Edit Configurations and fix the URL

Here is my project: javaServlet/LoginServlet at main · minhquandl13/javaServlet (github.com)

Thank you for helping me !

0

Hello, Minhquandl13

In the project you shared, I don't see, for example, the Web facet configured. Could you please recreate the project and follow this guide to deploy the project's artifact correctly? 

0

Please sign in to leave a comment.