DispatcherServlet Class Not Found Exception Again and Again
I have created a Spring MVC project where I used:
jakarta 6.0 and spring-webmvc 6.2 in pom.xml
Dynamic Web Module 5
JDK 23
I configured the Dispatcher Servlet in web.xml, then set up the View Resolver in spring-servlet.xml. After that, I created a Controller and placed index.jsp inside the WEB-INF/views/ folder.
The server starts successfully, but I always get a 404 error:
"The origin server did not find a current representation for the target resource or is not willing to disclose that one exists."
Here is my console Output Attached too
15 Replies
⌛ This post has been reserved for your question.
Hey @Mohd Waqar! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
@dan1st | Daniel Look at this bro
Can you show your pom.xml?
Ok
So you are using Servlet 6 - then you'd probably want to use Dynamic Web Module 6
that should normally correspond to your servlet version
check your web.xml for that - is there a verssion=5 maybe?
that wouldn't solve your problem but it would be something off
this is my web xml where the version is 6
then you should use version 6 for Dynamic Web Module
Anyway for your specific problem: https://stackoverflow.com/q/11227395/10871900
Note: The non Maven answers are probably not relevant
Stack Overflow
java.lang.ClassNotFoundException: org.springframework.web.servlet.D...
i am using spring 3.1.0.RELEASE, and my servlet container is tomcat 7 and my IDE is eclipse indigo
and the jar spring-webmvc-3.1.0.RELEASE.jar which contains the DispatcherServlet
exists in the lib
For example one answer suggests adding Spring Context:
okay i am adding it
and make sure your dependencies are actually invluded with tomcat
Stack Overflow
java.lang.ClassNotFoundException: org.springframework.web.servlet.D...
i am using spring 3.1.0.RELEASE, and my servlet container is tomcat 7 and my IDE is eclipse indigo
and the jar spring-webmvc-3.1.0.RELEASE.jar which contains the DispatcherServlet
exists in the lib
and there's also this self-answer from the OP: https://stackoverflow.com/a/11241159/10871900
Stack Overflow
java.lang.ClassNotFoundException: org.springframework.web.servlet.D...
i am using spring 3.1.0.RELEASE, and my servlet container is tomcat 7 and my IDE is eclipse indigo
and the jar spring-webmvc-3.1.0.RELEASE.jar which contains the DispatcherServlet
exists in the lib
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.Post Closed
This post has been closed by <@1077604975741505716>.