1

Any suggestions how to resolve this Spring MVC error?

Error configuring application listener of classError configuring application listener of class org.springframework.web.context.ContextLoaderListener java.lang.NoClassDefFoundError: org/springframework/core/env/EnvironmentCapable at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) at java.lang.ClassLoader.defineClass(ClassLoader.java:615) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2733)

//[redacted trace]

Caused by: java.lang.ClassNotFoundException: org.springframework.core.env.EnvironmentCapable at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1645) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1491)

4
  • have you downloaded and added the org.springframework.core jar to the application's classpath? Commented Jun 19, 2015 at 20:04
  • Yes, I did. Actually, it worked yesterday, but when I run today, it throws all error Commented Jun 19, 2015 at 20:14
  • ok let me ask you this, are all your org.springframework..... jars the same version number as this can cause compatibility issues? so as well as org.springframework.core you should also have org.springframework.context amongst other jars for a spring-based project Commented Jun 19, 2015 at 20:18
  • I had a similar issue, I deleted the build folder in intellij project and re run the project, problem solved. Commented Mar 10, 2016 at 4:52

2 Answers 2

1

Put the spring core framework (usually downloadable and has jar files) in your libs folder

Sign up to request clarification or add additional context in comments.

Comments

0

you have add into context loader classpath into web.xml.

for example

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>WordOfTheDay</display-name>
  <welcome-file-list>
    <welcome-file>home.do</welcome-file>
  </welcome-file-list>
  <servlet>
    <servlet-name>spring</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>spring</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>
  <listener>
    <listener-class>
                  org.springframework.web.context.ContextLoaderListener
    </listener-class>
  </listener>
  <listener>

1 Comment

I added it. Now it runs, but my jsp page turns out the blank. I am calling string message from JSP, but it cannot to even print, so I put debug statements on JSP page before and after it. It print those statements,but it did not print the message. Can you help me out? If you need more information, please let me know, Thanks

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.