HTTP Status 500 - Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
Please don't flag this post as a duplicate one because I didn't find any good resource in the relevant question.
Technologies used :-
Spring MVC 4.3.3.RELEASE
Gradle 3.1
Tomcat 9.0
I created a dynamic web project and when I run it, I get the following error
HTTP Status 500 - Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
type Exception report
message Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1102)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:788)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1485)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
root cause
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1299)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1133)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1102)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:788)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1485)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
It is saying that it could not find the dispatcher servlet class but when I ctrl + click the dispatcher servlet path in the spring-dispatcher-servlet , It lands to the spring Dispatcher Servlet class. I could not get the root cause of this problem.
Here are my web.xml and spring-dispatcher-servlet.xml files
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>MenuOrder</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring-dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spring-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web>
spring-dispatcher-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id = "HandlerMapping" class = "org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean id = "viewResolver"
class = "org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name = "prefix">
<value>/WEB-INF/</value>
</property>
<property name = "sufix">
<value>.jsp</value>
</property>
</bean>
</beans>
Project directory

My gradle.build file
allprojects{
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
group = 'com'
version = '0.0.1-SNAPSHOT'
}
subprojects{
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
}
allprojects {
task hello { task -> println "I'm $task.project.name" }
}
allprojects{
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
// The production code uses the SLF4J logging API at compile time
// compile 'org.slf4j:slf4j-api:1.7.21'
//spring web
compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.3.RELEASE'
// spring core
compile group: 'org.springframework', name: 'spring-core', version: '4.3.3.RELEASE'
// spring context support
compile group: 'org.springframework', name: 'spring-context-support', version: '4.3.3.RELEASE'
// ORM dependencies
// spring jpa
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.10.4.RELEASE'
// hibernate-entity manager
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '5.2.2.Final'
// End of ORM dependencies
// postgres connector
compile group: 'org.postgresql', name: 'postgresql', version: '9.4-1200-jdbc41'
// Junit
compile group: 'junit', name: 'junit', version: '4.12'
// servlet
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.0-b01'
compile group: 'javax.el', name: 'javax.el-api', version: '2.2.1'
compile group: 'org.springframework', name: 'spring', version: '3.2.0.RC1'
}
}
The whole project code can be found in
https://github.com/viper-pranish/menu-order
Dependencies inside the project structure

java spring jsp spring-mvc servlets
|
show 2 more comments
Please don't flag this post as a duplicate one because I didn't find any good resource in the relevant question.
Technologies used :-
Spring MVC 4.3.3.RELEASE
Gradle 3.1
Tomcat 9.0
I created a dynamic web project and when I run it, I get the following error
HTTP Status 500 - Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
type Exception report
message Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1102)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:788)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1485)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
root cause
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1299)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1133)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1102)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:788)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1485)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
It is saying that it could not find the dispatcher servlet class but when I ctrl + click the dispatcher servlet path in the spring-dispatcher-servlet , It lands to the spring Dispatcher Servlet class. I could not get the root cause of this problem.
Here are my web.xml and spring-dispatcher-servlet.xml files
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>MenuOrder</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring-dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spring-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web>
spring-dispatcher-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id = "HandlerMapping" class = "org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean id = "viewResolver"
class = "org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name = "prefix">
<value>/WEB-INF/</value>
</property>
<property name = "sufix">
<value>.jsp</value>
</property>
</bean>
</beans>
Project directory

My gradle.build file
allprojects{
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
group = 'com'
version = '0.0.1-SNAPSHOT'
}
subprojects{
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
}
allprojects {
task hello { task -> println "I'm $task.project.name" }
}
allprojects{
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
// The production code uses the SLF4J logging API at compile time
// compile 'org.slf4j:slf4j-api:1.7.21'
//spring web
compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.3.RELEASE'
// spring core
compile group: 'org.springframework', name: 'spring-core', version: '4.3.3.RELEASE'
// spring context support
compile group: 'org.springframework', name: 'spring-context-support', version: '4.3.3.RELEASE'
// ORM dependencies
// spring jpa
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.10.4.RELEASE'
// hibernate-entity manager
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '5.2.2.Final'
// End of ORM dependencies
// postgres connector
compile group: 'org.postgresql', name: 'postgresql', version: '9.4-1200-jdbc41'
// Junit
compile group: 'junit', name: 'junit', version: '4.12'
// servlet
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.0-b01'
compile group: 'javax.el', name: 'javax.el-api', version: '2.2.1'
compile group: 'org.springframework', name: 'spring', version: '3.2.0.RC1'
}
}
The whole project code can be found in
https://github.com/viper-pranish/menu-order
Dependencies inside the project structure

java spring jsp spring-mvc servlets
can you add your pom
– kuhajeyan
Oct 26 '16 at 7:50
I was going to say either you havent added the required libraries to your war (show us the contents of WEB-INF/lib)
– Narrim
Oct 26 '16 at 7:59
@Narrim there is nothing insidelibfolder
– viper
Oct 26 '16 at 8:00
For starter remove theorg.springframework:springdependency... You are mixing Spring Versions doing this, never mix versions of a framework. Next to that there is no such thing aspring-versionso not sure whichspring-coreversion you expect but that one simply doesn't exists. Your final error is the fact you are only applying thejavaplugin whereas you want a web application you need to add thewarplugin as well.
– M. Deinum
Oct 26 '16 at 8:11
@M.Deinum I have addedwarandjettyplugin in my sub project's gradle file. Andspring-versionis a variable that I had set ingradle.propertiesfile.
– viper
Oct 26 '16 at 8:19
|
show 2 more comments
Please don't flag this post as a duplicate one because I didn't find any good resource in the relevant question.
Technologies used :-
Spring MVC 4.3.3.RELEASE
Gradle 3.1
Tomcat 9.0
I created a dynamic web project and when I run it, I get the following error
HTTP Status 500 - Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
type Exception report
message Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1102)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:788)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1485)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
root cause
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1299)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1133)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1102)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:788)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1485)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
It is saying that it could not find the dispatcher servlet class but when I ctrl + click the dispatcher servlet path in the spring-dispatcher-servlet , It lands to the spring Dispatcher Servlet class. I could not get the root cause of this problem.
Here are my web.xml and spring-dispatcher-servlet.xml files
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>MenuOrder</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring-dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spring-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web>
spring-dispatcher-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id = "HandlerMapping" class = "org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean id = "viewResolver"
class = "org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name = "prefix">
<value>/WEB-INF/</value>
</property>
<property name = "sufix">
<value>.jsp</value>
</property>
</bean>
</beans>
Project directory

My gradle.build file
allprojects{
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
group = 'com'
version = '0.0.1-SNAPSHOT'
}
subprojects{
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
}
allprojects {
task hello { task -> println "I'm $task.project.name" }
}
allprojects{
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
// The production code uses the SLF4J logging API at compile time
// compile 'org.slf4j:slf4j-api:1.7.21'
//spring web
compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.3.RELEASE'
// spring core
compile group: 'org.springframework', name: 'spring-core', version: '4.3.3.RELEASE'
// spring context support
compile group: 'org.springframework', name: 'spring-context-support', version: '4.3.3.RELEASE'
// ORM dependencies
// spring jpa
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.10.4.RELEASE'
// hibernate-entity manager
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '5.2.2.Final'
// End of ORM dependencies
// postgres connector
compile group: 'org.postgresql', name: 'postgresql', version: '9.4-1200-jdbc41'
// Junit
compile group: 'junit', name: 'junit', version: '4.12'
// servlet
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.0-b01'
compile group: 'javax.el', name: 'javax.el-api', version: '2.2.1'
compile group: 'org.springframework', name: 'spring', version: '3.2.0.RC1'
}
}
The whole project code can be found in
https://github.com/viper-pranish/menu-order
Dependencies inside the project structure

java spring jsp spring-mvc servlets
Please don't flag this post as a duplicate one because I didn't find any good resource in the relevant question.
Technologies used :-
Spring MVC 4.3.3.RELEASE
Gradle 3.1
Tomcat 9.0
I created a dynamic web project and when I run it, I get the following error
HTTP Status 500 - Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
type Exception report
message Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Error instantiating servlet class org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1102)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:788)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1485)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
root cause
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1299)
org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1133)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:522)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:349)
org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1102)
org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:788)
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1485)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
java.lang.Thread.run(Thread.java:745)
It is saying that it could not find the dispatcher servlet class but when I ctrl + click the dispatcher servlet path in the spring-dispatcher-servlet , It lands to the spring Dispatcher Servlet class. I could not get the root cause of this problem.
Here are my web.xml and spring-dispatcher-servlet.xml files
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>MenuOrder</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring-dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>spring-dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web>
spring-dispatcher-servlet.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id = "HandlerMapping" class = "org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
<bean id = "viewResolver"
class = "org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name = "prefix">
<value>/WEB-INF/</value>
</property>
<property name = "sufix">
<value>.jsp</value>
</property>
</bean>
</beans>
Project directory

My gradle.build file
allprojects{
apply plugin: 'java'
apply plugin: 'eclipse-wtp'
group = 'com'
version = '0.0.1-SNAPSHOT'
}
subprojects{
tasks.withType(JavaCompile){
options.encoding = 'UTF-8'
}
}
allprojects {
task hello { task -> println "I'm $task.project.name" }
}
allprojects{
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
// The production code uses the SLF4J logging API at compile time
// compile 'org.slf4j:slf4j-api:1.7.21'
//spring web
compile group: 'org.springframework', name: 'spring-webmvc', version: '4.3.3.RELEASE'
// spring core
compile group: 'org.springframework', name: 'spring-core', version: '4.3.3.RELEASE'
// spring context support
compile group: 'org.springframework', name: 'spring-context-support', version: '4.3.3.RELEASE'
// ORM dependencies
// spring jpa
compile group: 'org.springframework.data', name: 'spring-data-jpa', version: '1.10.4.RELEASE'
// hibernate-entity manager
compile group: 'org.hibernate', name: 'hibernate-entitymanager', version: '5.2.2.Final'
// End of ORM dependencies
// postgres connector
compile group: 'org.postgresql', name: 'postgresql', version: '9.4-1200-jdbc41'
// Junit
compile group: 'junit', name: 'junit', version: '4.12'
// servlet
compile group: 'javax.servlet', name: 'javax.servlet-api', version: '4.0.0-b01'
compile group: 'javax.el', name: 'javax.el-api', version: '2.2.1'
compile group: 'org.springframework', name: 'spring', version: '3.2.0.RC1'
}
}
The whole project code can be found in
https://github.com/viper-pranish/menu-order
Dependencies inside the project structure

java spring jsp spring-mvc servlets
java spring jsp spring-mvc servlets
edited Oct 26 '16 at 8:26
viper
asked Oct 26 '16 at 7:42
viperviper
81821123
81821123
can you add your pom
– kuhajeyan
Oct 26 '16 at 7:50
I was going to say either you havent added the required libraries to your war (show us the contents of WEB-INF/lib)
– Narrim
Oct 26 '16 at 7:59
@Narrim there is nothing insidelibfolder
– viper
Oct 26 '16 at 8:00
For starter remove theorg.springframework:springdependency... You are mixing Spring Versions doing this, never mix versions of a framework. Next to that there is no such thing aspring-versionso not sure whichspring-coreversion you expect but that one simply doesn't exists. Your final error is the fact you are only applying thejavaplugin whereas you want a web application you need to add thewarplugin as well.
– M. Deinum
Oct 26 '16 at 8:11
@M.Deinum I have addedwarandjettyplugin in my sub project's gradle file. Andspring-versionis a variable that I had set ingradle.propertiesfile.
– viper
Oct 26 '16 at 8:19
|
show 2 more comments
can you add your pom
– kuhajeyan
Oct 26 '16 at 7:50
I was going to say either you havent added the required libraries to your war (show us the contents of WEB-INF/lib)
– Narrim
Oct 26 '16 at 7:59
@Narrim there is nothing insidelibfolder
– viper
Oct 26 '16 at 8:00
For starter remove theorg.springframework:springdependency... You are mixing Spring Versions doing this, never mix versions of a framework. Next to that there is no such thing aspring-versionso not sure whichspring-coreversion you expect but that one simply doesn't exists. Your final error is the fact you are only applying thejavaplugin whereas you want a web application you need to add thewarplugin as well.
– M. Deinum
Oct 26 '16 at 8:11
@M.Deinum I have addedwarandjettyplugin in my sub project's gradle file. Andspring-versionis a variable that I had set ingradle.propertiesfile.
– viper
Oct 26 '16 at 8:19
can you add your pom
– kuhajeyan
Oct 26 '16 at 7:50
can you add your pom
– kuhajeyan
Oct 26 '16 at 7:50
I was going to say either you havent added the required libraries to your war (show us the contents of WEB-INF/lib)
– Narrim
Oct 26 '16 at 7:59
I was going to say either you havent added the required libraries to your war (show us the contents of WEB-INF/lib)
– Narrim
Oct 26 '16 at 7:59
@Narrim there is nothing inside
lib folder– viper
Oct 26 '16 at 8:00
@Narrim there is nothing inside
lib folder– viper
Oct 26 '16 at 8:00
For starter remove the
org.springframework:spring dependency... You are mixing Spring Versions doing this, never mix versions of a framework. Next to that there is no such thing a spring-version so not sure which spring-core version you expect but that one simply doesn't exists. Your final error is the fact you are only applying the java plugin whereas you want a web application you need to add the war plugin as well.– M. Deinum
Oct 26 '16 at 8:11
For starter remove the
org.springframework:spring dependency... You are mixing Spring Versions doing this, never mix versions of a framework. Next to that there is no such thing a spring-version so not sure which spring-core version you expect but that one simply doesn't exists. Your final error is the fact you are only applying the java plugin whereas you want a web application you need to add the war plugin as well.– M. Deinum
Oct 26 '16 at 8:11
@M.Deinum I have added
war and jetty plugin in my sub project's gradle file. And spring-version is a variable that I had set in gradle.properties file.– viper
Oct 26 '16 at 8:19
@M.Deinum I have added
war and jetty plugin in my sub project's gradle file. And spring-version is a variable that I had set in gradle.properties file.– viper
Oct 26 '16 at 8:19
|
show 2 more comments
4 Answers
4
active
oldest
votes
you can simply add tag under tag of web.xml, It will work.

3
Welcome to Stack Overflow! If you have code to share with us, please don't post it as image. You can add it to your post and format it as code.
– FelixSFD
Jan 10 '17 at 12:03
add a comment |
as @Denium pointed out you should not mix the spring versions
remove compile group: 'org.springframework', name: 'spring', version: '3.2.0.RC1' from gradle.build
and add
apply plugin: 'war'
and you may to provide your controller url mapping as well
<bean name="/index"
class="com.mkyong.common.controller.IndexController" />
Did as you told but still I am having the same issue. Its not just this gradle project that is facing error. I created a maven project too and it also gave me the same error.
– viper
Oct 26 '16 at 9:17
@viper what do you see in the console stack trace
– kuhajeyan
Oct 26 '16 at 9:18
add a comment |
Make sure that you have added all the required Spring jars at both places:
in build path as well as WEB-INF/lib folder
add a comment |
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.7.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.7.RELEASE</version>
</dependency>
</dependencies>
Add slf4j dependencies. The problem will resolve. My pom.xml dependencies it resolved the problem.
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
Welcome to SO, Tapan! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your solution with an explanation of how your code solves the problem at hand.
– Joel
Nov 11 '18 at 18:05
DispatcherServlet has import { import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory}; When DispactehrServlet class load its need log jar.if we check the statck trace of error AuthenticatorBase.class at line number 522 its start logging ,so its need a logging isnstance same for other one.
– Tapan
Nov 12 '18 at 19:17
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
– Tapan
Nov 12 '18 at 21:44
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f40256447%2fhttp-status-500-error-instantiating-servlet-class-org-springframework-web-serv%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
you can simply add tag under tag of web.xml, It will work.

3
Welcome to Stack Overflow! If you have code to share with us, please don't post it as image. You can add it to your post and format it as code.
– FelixSFD
Jan 10 '17 at 12:03
add a comment |
you can simply add tag under tag of web.xml, It will work.

3
Welcome to Stack Overflow! If you have code to share with us, please don't post it as image. You can add it to your post and format it as code.
– FelixSFD
Jan 10 '17 at 12:03
add a comment |
you can simply add tag under tag of web.xml, It will work.

you can simply add tag under tag of web.xml, It will work.

edited Jan 10 '17 at 15:14
Joseph
5,052112642
5,052112642
answered Jan 10 '17 at 11:31
Abhishek AdityanAbhishek Adityan
212
212
3
Welcome to Stack Overflow! If you have code to share with us, please don't post it as image. You can add it to your post and format it as code.
– FelixSFD
Jan 10 '17 at 12:03
add a comment |
3
Welcome to Stack Overflow! If you have code to share with us, please don't post it as image. You can add it to your post and format it as code.
– FelixSFD
Jan 10 '17 at 12:03
3
3
Welcome to Stack Overflow! If you have code to share with us, please don't post it as image. You can add it to your post and format it as code.
– FelixSFD
Jan 10 '17 at 12:03
Welcome to Stack Overflow! If you have code to share with us, please don't post it as image. You can add it to your post and format it as code.
– FelixSFD
Jan 10 '17 at 12:03
add a comment |
as @Denium pointed out you should not mix the spring versions
remove compile group: 'org.springframework', name: 'spring', version: '3.2.0.RC1' from gradle.build
and add
apply plugin: 'war'
and you may to provide your controller url mapping as well
<bean name="/index"
class="com.mkyong.common.controller.IndexController" />
Did as you told but still I am having the same issue. Its not just this gradle project that is facing error. I created a maven project too and it also gave me the same error.
– viper
Oct 26 '16 at 9:17
@viper what do you see in the console stack trace
– kuhajeyan
Oct 26 '16 at 9:18
add a comment |
as @Denium pointed out you should not mix the spring versions
remove compile group: 'org.springframework', name: 'spring', version: '3.2.0.RC1' from gradle.build
and add
apply plugin: 'war'
and you may to provide your controller url mapping as well
<bean name="/index"
class="com.mkyong.common.controller.IndexController" />
Did as you told but still I am having the same issue. Its not just this gradle project that is facing error. I created a maven project too and it also gave me the same error.
– viper
Oct 26 '16 at 9:17
@viper what do you see in the console stack trace
– kuhajeyan
Oct 26 '16 at 9:18
add a comment |
as @Denium pointed out you should not mix the spring versions
remove compile group: 'org.springframework', name: 'spring', version: '3.2.0.RC1' from gradle.build
and add
apply plugin: 'war'
and you may to provide your controller url mapping as well
<bean name="/index"
class="com.mkyong.common.controller.IndexController" />
as @Denium pointed out you should not mix the spring versions
remove compile group: 'org.springframework', name: 'spring', version: '3.2.0.RC1' from gradle.build
and add
apply plugin: 'war'
and you may to provide your controller url mapping as well
<bean name="/index"
class="com.mkyong.common.controller.IndexController" />
answered Oct 26 '16 at 8:46
kuhajeyankuhajeyan
6,39082855
6,39082855
Did as you told but still I am having the same issue. Its not just this gradle project that is facing error. I created a maven project too and it also gave me the same error.
– viper
Oct 26 '16 at 9:17
@viper what do you see in the console stack trace
– kuhajeyan
Oct 26 '16 at 9:18
add a comment |
Did as you told but still I am having the same issue. Its not just this gradle project that is facing error. I created a maven project too and it also gave me the same error.
– viper
Oct 26 '16 at 9:17
@viper what do you see in the console stack trace
– kuhajeyan
Oct 26 '16 at 9:18
Did as you told but still I am having the same issue. Its not just this gradle project that is facing error. I created a maven project too and it also gave me the same error.
– viper
Oct 26 '16 at 9:17
Did as you told but still I am having the same issue. Its not just this gradle project that is facing error. I created a maven project too and it also gave me the same error.
– viper
Oct 26 '16 at 9:17
@viper what do you see in the console stack trace
– kuhajeyan
Oct 26 '16 at 9:18
@viper what do you see in the console stack trace
– kuhajeyan
Oct 26 '16 at 9:18
add a comment |
Make sure that you have added all the required Spring jars at both places:
in build path as well as WEB-INF/lib folder
add a comment |
Make sure that you have added all the required Spring jars at both places:
in build path as well as WEB-INF/lib folder
add a comment |
Make sure that you have added all the required Spring jars at both places:
in build path as well as WEB-INF/lib folder
Make sure that you have added all the required Spring jars at both places:
in build path as well as WEB-INF/lib folder
answered Aug 19 '17 at 17:39
Shobhit MittalShobhit Mittal
115
115
add a comment |
add a comment |
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.7.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.7.RELEASE</version>
</dependency>
</dependencies>
Add slf4j dependencies. The problem will resolve. My pom.xml dependencies it resolved the problem.
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
Welcome to SO, Tapan! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your solution with an explanation of how your code solves the problem at hand.
– Joel
Nov 11 '18 at 18:05
DispatcherServlet has import { import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory}; When DispactehrServlet class load its need log jar.if we check the statck trace of error AuthenticatorBase.class at line number 522 its start logging ,so its need a logging isnstance same for other one.
– Tapan
Nov 12 '18 at 19:17
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
– Tapan
Nov 12 '18 at 21:44
add a comment |
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.7.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.7.RELEASE</version>
</dependency>
</dependencies>
Add slf4j dependencies. The problem will resolve. My pom.xml dependencies it resolved the problem.
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
Welcome to SO, Tapan! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your solution with an explanation of how your code solves the problem at hand.
– Joel
Nov 11 '18 at 18:05
DispatcherServlet has import { import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory}; When DispactehrServlet class load its need log jar.if we check the statck trace of error AuthenticatorBase.class at line number 522 its start logging ,so its need a logging isnstance same for other one.
– Tapan
Nov 12 '18 at 19:17
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
– Tapan
Nov 12 '18 at 21:44
add a comment |
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.7.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.7.RELEASE</version>
</dependency>
</dependencies>
Add slf4j dependencies. The problem will resolve. My pom.xml dependencies it resolved the problem.
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>4.1.7.RELEASE</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.12</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>4.0.2.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>4.1.7.RELEASE</version>
</dependency>
</dependencies>
Add slf4j dependencies. The problem will resolve. My pom.xml dependencies it resolved the problem.
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
edited Nov 12 '18 at 21:45
answered Nov 11 '18 at 17:48
TapanTapan
12
12
Welcome to SO, Tapan! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your solution with an explanation of how your code solves the problem at hand.
– Joel
Nov 11 '18 at 18:05
DispatcherServlet has import { import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory}; When DispactehrServlet class load its need log jar.if we check the statck trace of error AuthenticatorBase.class at line number 522 its start logging ,so its need a logging isnstance same for other one.
– Tapan
Nov 12 '18 at 19:17
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
– Tapan
Nov 12 '18 at 21:44
add a comment |
Welcome to SO, Tapan! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your solution with an explanation of how your code solves the problem at hand.
– Joel
Nov 11 '18 at 18:05
DispatcherServlet has import { import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory}; When DispactehrServlet class load its need log jar.if we check the statck trace of error AuthenticatorBase.class at line number 522 its start logging ,so its need a logging isnstance same for other one.
– Tapan
Nov 12 '18 at 19:17
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
– Tapan
Nov 12 '18 at 21:44
Welcome to SO, Tapan! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your solution with an explanation of how your code solves the problem at hand.
– Joel
Nov 11 '18 at 18:05
Welcome to SO, Tapan! Code-only answers are discouraged here, as they provide no insight into how the problem is solved. Please update your solution with an explanation of how your code solves the problem at hand.
– Joel
Nov 11 '18 at 18:05
DispatcherServlet has import { import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory}; When DispactehrServlet class load its need log jar.if we check the statck trace of error AuthenticatorBase.class at line number 522 its start logging ,so its need a logging isnstance same for other one.
– Tapan
Nov 12 '18 at 19:17
DispatcherServlet has import { import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory}; When DispactehrServlet class load its need log jar.if we check the statck trace of error AuthenticatorBase.class at line number 522 its start logging ,so its need a logging isnstance same for other one.
– Tapan
Nov 12 '18 at 19:17
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
– Tapan
Nov 12 '18 at 21:44
After adding slf4j if the problem is not resolved, then add Maven Dependency in Deployment Assembly.
– Tapan
Nov 12 '18 at 21:44
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f40256447%2fhttp-status-500-error-instantiating-servlet-class-org-springframework-web-serv%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
can you add your pom
– kuhajeyan
Oct 26 '16 at 7:50
I was going to say either you havent added the required libraries to your war (show us the contents of WEB-INF/lib)
– Narrim
Oct 26 '16 at 7:59
@Narrim there is nothing inside
libfolder– viper
Oct 26 '16 at 8:00
For starter remove the
org.springframework:springdependency... You are mixing Spring Versions doing this, never mix versions of a framework. Next to that there is no such thing aspring-versionso not sure whichspring-coreversion you expect but that one simply doesn't exists. Your final error is the fact you are only applying thejavaplugin whereas you want a web application you need to add thewarplugin as well.– M. Deinum
Oct 26 '16 at 8:11
@M.Deinum I have added
warandjettyplugin in my sub project's gradle file. Andspring-versionis a variable that I had set ingradle.propertiesfile.– viper
Oct 26 '16 at 8:19