How Fix ClassNotFoundException and HTTP Status 404 in Eclipse
- Details
- Written by Nam Ha Minh
- Last Updated on 28 October 2023   |   Print Email
1. How to Fix ClassNotFoundException Error
This exception causes HTTP Status 500 Internal Error, saying that a required class is missing. For example, you may see this in Eclipse’s console:You try to add the library that contain the required class into the project’s classpath. It’s present but the error still persists. So what really gets wrong?I suggest you check the project properties dialog, and go to the Web Deployment Assembly configuration, as shown below:Click Add button, then choose Java Build Path Entries:
2. How to Fix HTTP Status 404 Not Found Error
In a similar fashion, you may get HTTP status 404 Not Found error due to misconfiguration in the Web Deployment Assembly of your project:To fix this error, go to project’s properties dialog. Go to Web Deployment Assembly. Click Add and choose Folder:Click Next, then choose WebContent or the directory contains web files, e.g. src/main/webapp:Then click Finish. You should see the /WebContent or /src/main/webapp entry is added to the deploy path / (context root) of the application, as shown below:Click Apply and Close. Tomcat will be restarted and you can test again. The HTTP status 400 Not Found error is resolved.That means somehow the Web Deployment Assembly configuration is flawed, causing web files (HTML, JS, CSS, images…) are not deployed - That’s why you got HTTP status 404 Not Found error.Watch the following video to see how I do the steps to solve HTTP status 404 Not Found error in action: Other Error Fixes you may find helpful:
- [Solved] Tomcat Error HTTP Status 404 Not Found
- [Eclipse] How to Fix Error: project description file (.project) for … is missing
- [Fixed] No Persistence provider for EntityManager named XXX
Other Eclipse Tutorials:
- How to import existing projects into Eclipse workspace
- How to create, deploy and run Java Servlet in Eclipse
- How to generate JAR file in Eclipse
- How to create WAR file for Java web application in Eclipse
- How to create Ant build file for existing Java project in Eclipse
- How to generate Javadoc in Eclipse
- How to create Java web project with Maven in Eclipse
- 25 Eclipse Shortcut Keys for Code Editing
- How to Add Copyright License Header for Java Source Files in Eclipse
- How to monitor HTTP requests and responses using TCP/IP Monitor in Eclipse
Comments