Solution in idea java.lang.ClassNotFoundException : org.springframework.web . context.ContextLoaderListener

Reference blog: IDEA development in Java. Lang. ClassNotFoundException: org. Springframework. Web. Context. The ContextLoaderListener error solution


Have a problem
In the process of writing a simple SpringMVC project, I tried to start the project with Tomcat, but found the following errors:

java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener

Simply put, the ContextLoaderListener class cannot be found. The strange thing about
is that the SpringMVC project that I wrote before doesn’t have similar problems. ┍ ┑ ( ̄ Д  ̄)


The solution
After asking baidu, I was told to add Available Elements to the Artifact.
click File - & gt; Project Structure-> Artifacts, right-click the project name in Available Elements, and select Put into Output Root.

Then restart Tomcat, you will be able to access the page correctly! O (≧ ヾ del ≦ *)

Read More: