Start tomcat server error Context initialization failed

Severe: Context initialization failed
org. Springframework. Beans. Factory. BeanCreationException: Error creating bean with name ‘org.springframework.context.annotation.internalAsyncAnnotationProcessor’ defined in org.springframework.scheduling.annotation.ProxyAsyncConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.scheduling.annotation.AsyncAnnotationBeanPostProcessor]: Factory method ‘asyncAdvisor’ threw exception; nested exception is java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:599)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1123)
At…
Solution: In springMVC.xml configuration file will < context:component-scan base-package=”*”/>
Change the path of your own project class files to: < context:component-scan base-package=”com.srpingmvc.*”>
— — — — — — — — — — — — — — — — — — — — to interpret the following — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —
Now let’s take a look at the SpringMVC.xml file to see why this is happening
< ?The XML version = “1.0” encoding = “utf-8”?>
< beans xmlns=”http://www.springframework.org/schema/beans”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xmlns:context=”http://www.springframework.org/schema/context”
xsi:schemaLocation=”http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd “& gt;
 
< ! — Configure @Controller @service –>
< context:component-scan base-package=”com.springmvc.*”> < /context:component-scan>
< ! — View parser logical View, physical view –& GT;
< bean class= “org.springframework.web.servlet.view.InternalResourceViewResolver”>
< property name=”prefix” value=”/”> < /property>
< property name=”suffix” value= “.jsp”> < /property>
< /bean>
 
< /beans>
In the configuration file, base-package=”com.srpingmvc.*” means that all files under the com.springMVC folder will be scanned for the purpose of scanning
Register classes with specific annotations such as @Controller @Component # Repository and so on as beans in the Spring container.
The following is reproduced from: http://blog.csdn.net/zzjjiandan/article/details/22922847
The Spring configuration file is the “drawing” for directing the Spring factory to Bean production, dependency injection (assembly), and Bean instance distribution.
Java EE programmers must learn and flexibly apply this “drawing” to accurately express their “production intentions”.
The Spring configuration file is one or more standard XML documents. Applicationcontext.xml is the default configuration file for Spring.
When the container starts and cannot find the specified configuration document, an attempt is made to load the default configuration file.
The following is a relatively complete configuration file template. The basic purpose of each XML tag node in the document is also explained in detail.
These XML tag nodes will be used in the following knowledge points. After mastering the purpose of these XML nodes and attributes,
It provides a solid foundation for us to start writing configuration files.

 
 

Read More: