Tag Archives: Springmvc Error

[Solved] SpringMVC Error: war exploded: Error during artifact deployment. See server log for details.

When starting tomcat, the following error is reported:

war exploded: Error during artifact deployment. See server log for details.

Solution:

Step 1: See someone online said that generally under WEB-INF, there should be applicationContext.xml file, even if not, the context should be specified in web.xml, so add the following code in web.xml:

Step 2: Be sure to write the bean in applicationContext.xml. (This is my own careless mistake, only used to remind everyone)

In short

This error has plagued me for a long time, I checked a lot of methods on the Internet but they do not apply, so this article is only used to help you troubleshoot, but also according to their own actual procedures to determine.

How to Solve Springmvc Error: org.springframework.web.servlet.DispatcherServlet

When writing springMVC, after importing all required packages, run the program, the console reports the following error:

Critical: Servlet [springDispatcherServlet] in web application [/SpringMVC-1 ] threw load() exception
java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java: 1333 )
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java: 1167 )
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java: 518 )
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java: 499 )
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java: 118 )
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java: 1091 )
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java: 1027 )
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java: 5038 )
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java: 5348 )
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java: 145 )
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java: 725 )
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java: 701 )
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java: 717 )
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java: 587 )
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java: 1798 )
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

You can’t import org.springframework.web.servlet.DispatcherServlet in a java file. This class is mainly under the spring-webmvc jar package. All imported jar packages are as follows:

All have been imported, there is no problem. But in fact, all dependencies must be added to the classpath. step:

Right-click the project–>properties–>Deployment Assembly–>add–>Java Build Path Entries–>import all dependent Jar packages and restart tomcat.