码迷,mamicode.com
首页 > 编程语言 > 详细

spring mvc 配置运行报错误

时间:2015-04-06 11:21:47      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:

  1 四月 06, 2015 10:51:18 上午 org.apache.catalina.startup.VersionLoggerListener log
  2 信息: Server version: Apache Tomcat/8.0.14
  3 四月 06, 2015 10:51:18 上午 org.apache.catalina.startup.VersionLoggerListener log
  4 信息: Server built:   Sep 24 2014 09:01:51
  5 四月 06, 2015 10:51:18 上午 org.apache.catalina.startup.VersionLoggerListener log
  6 信息: Server number:  8.0.14.0
  7 四月 06, 2015 10:51:18 上午 org.apache.catalina.startup.VersionLoggerListener log
  8 信息: OS Name:        Windows 7
  9 四月 06, 2015 10:51:18 上午 org.apache.catalina.startup.VersionLoggerListener log
 10 信息: OS Version:     6.1
 11 四月 06, 2015 10:51:18 上午 org.apache.catalina.startup.VersionLoggerListener log
 12 信息: Architecture:   amd64
 13 四月 06, 2015 10:51:18 上午 org.apache.catalina.startup.VersionLoggerListener log
 14 信息: JVM Version:    1.7.0_67-b01
 15 四月 06, 2015 10:51:18 上午 org.apache.catalina.startup.VersionLoggerListener log
 16 信息: JVM Vendor:     Oracle Corporation
 17 四月 06, 2015 10:51:18 上午 org.apache.catalina.core.AprLifecycleListener init
 18 信息: Loaded APR based Apache Tomcat Native library 1.1.31 using APR version 1.4.8.
 19 四月 06, 2015 10:51:18 上午 org.apache.catalina.core.AprLifecycleListener init
 20 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
 21 四月 06, 2015 10:51:19 上午 org.apache.catalina.core.AprLifecycleListener initializeSSL
 22 信息: OpenSSL successfully initialized (OpenSSL 1.0.1h 5 Jun 2014)
 23 四月 06, 2015 10:51:19 上午 org.apache.coyote.AbstractProtocol init
 24 信息: Initializing ProtocolHandler ["http-apr-8080"]
 25 四月 06, 2015 10:51:19 上午 org.apache.coyote.AbstractProtocol init
 26 信息: Initializing ProtocolHandler ["ajp-apr-8009"]
 27 四月 06, 2015 10:51:19 上午 org.apache.catalina.startup.Catalina load
 28 信息: Initialization processed in 1773 ms
 29 四月 06, 2015 10:51:19 上午 org.apache.catalina.core.StandardService startInternal
 30 信息: Starting service Catalina
 31 四月 06, 2015 10:51:19 上午 org.apache.catalina.core.StandardEngine startInternal
 32 信息: Starting Servlet Engine: Apache Tomcat/8.0.14
 33 四月 06, 2015 10:51:19 上午 org.apache.catalina.startup.HostConfig deployDirectory
 34 信息: Deploying web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\blog1
 35 四月 06, 2015 10:51:24 上午 org.apache.catalina.core.ApplicationContext log
 36 信息: No Spring WebApplicationInitializer types detected on classpath
 37 四月 06, 2015 10:51:24 上午 org.apache.catalina.core.ApplicationContext log
 38 信息: Initializing Spring root WebApplicationContext
 39 log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
 40 log4j:WARN Please initialize the log4j system properly.
 41 log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
 42 四月 06, 2015 10:51:38 上午 org.apache.catalina.core.StandardContext listenerStart
 43 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
 44 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
 45     at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:602)
 46     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1111)
 47     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1006)
 48     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
 49     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
 50     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302)
 51     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
 52     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298)
 53     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
 54     at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:220)
 55     at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:615)
 56     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:465)
 57     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403)
 58     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
 59     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
 60     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797)
 61     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221)
 62     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 63     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
 64     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
 65     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:714)
 66     at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1071)
 67     at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1721)
 68     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
 69     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
 70     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 71     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 72     at java.lang.Thread.run(Thread.java:745)
 73 Caused by: 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
 74     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189)
 75     at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:591)
 76     ... 27 more
 77 Caused by: java.lang.IllegalArgumentException: @EnableAsync annotation metadata was not injected
 78     at org.springframework.util.Assert.notNull(Assert.java:112)
 79     at org.springframework.scheduling.annotation.ProxyAsyncConfiguration.asyncAdvisor(ProxyAsyncConfiguration.java:45)
 80     at org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerBySpringCGLIB$$f9c2cb54.CGLIB$asyncAdvisor$0(<generated>)
 81     at org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerBySpringCGLIB$$f9c2cb54$$FastClassBySpringCGLIB$$dac3d87d.invoke(<generated>)
 82     at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
 83     at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:309)
 84     at org.springframework.scheduling.annotation.ProxyAsyncConfiguration$$EnhancerBySpringCGLIB$$f9c2cb54.asyncAdvisor(<generated>)
 85     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 86     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
 87     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 88     at java.lang.reflect.Method.invoke(Method.java:606)
 89     at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
 90     ... 28 more
 91 四月 06, 2015 10:51:38 上午 org.apache.catalina.core.StandardContext startInternal
 92 严重: Error listenerStart
 93 四月 06, 2015 10:51:38 上午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
 94 信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [183] milliseconds.
 95 四月 06, 2015 10:51:39 上午 org.apache.catalina.core.StandardContext startInternal
 96 严重: Context [/blog1] startup failed due to previous errors
 97 四月 06, 2015 10:51:39 上午 org.apache.catalina.core.ApplicationContext log
 98 信息: Closing Spring root WebApplicationContext
 99 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
100 信息: Deployment of web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\blog1 has finished in 19,206 ms
101 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
102 信息: Deploying web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\docs
103 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
104 信息: Deployment of web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\docs has finished in 51 ms
105 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
106 信息: Deploying web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\examples
107 四月 06, 2015 10:51:39 上午 org.apache.catalina.core.ApplicationContext log
108 信息: ContextListener: contextInitialized()
109 四月 06, 2015 10:51:39 上午 org.apache.catalina.core.ApplicationContext log
110 信息: SessionListener: contextInitialized()
111 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
112 信息: Deployment of web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\examples has finished in 491 ms
113 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
114 信息: Deploying web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\host-manager
115 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
116 信息: Deployment of web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\host-manager has finished in 34 ms
117 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
118 信息: Deploying web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\manager
119 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
120 信息: Deployment of web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\manager has finished in 33 ms
121 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
122 信息: Deploying web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\ROOT
123 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.HostConfig deployDirectory
124 信息: Deployment of web application directory C:\Program Files\CUSTOM\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14-windows-x64\apache-tomcat-8.0.14\webapps\ROOT has finished in 30 ms
125 四月 06, 2015 10:51:39 上午 org.apache.coyote.AbstractProtocol start
126 信息: Starting ProtocolHandler ["http-apr-8080"]
127 四月 06, 2015 10:51:39 上午 org.apache.coyote.AbstractProtocol start
128 信息: Starting ProtocolHandler ["ajp-apr-8009"]
129 四月 06, 2015 10:51:39 上午 org.apache.catalina.startup.Catalina start
130 信息: Server startup in 19920 ms

第一个错误在44行,看了半天,发现

 1 <?xml version="1.0" encoding="UTF-8"?>
 2 <beans xmlns="http://www.springframework.org/schema/beans"
 3     xmlns:context="http://www.springframework.org/schema/context" xmlns:p="http://www.springframework.org/schema/p"
 4     xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 5     xsi:schemaLocation="http://www.springframework.org/schema/beans
 6 http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
 7 http://www.springframework.org/schema/context
 8 http://www.springframework.org/schema/context/spring-context-4.1.xsd
 9 http://www.springframework.org/schema/mvc
10 http://www.springframework.org/schema/mvc/spring-mvc-4.1.xsd
11 ">
12     <!-- 启动注解驱动的Spring MVC功能,注册请求url和注解POJO类方法的映射 -->
13     <mvc:annotation-driven /> 
14     <!-- 启动包扫描功能,以便注册带有@Controller、@Service、@repository、@Component等注解的类成为spring的bean,只有这样,程序中的注解才能发挥作用-->
15      <context:component-scan base-package="*" /> 
16     <!-- 对模型视图名称的解析,在请求时模型视图名称添加前后缀, -->
17     <bean
18         class="org.springframework.web.servlet.view.InternalResourceViewResolver"
19         p:prefix="/view/" p:suffix=".jsp" p:viewClass="org.springframework.web.servlet.view.JstlView"/>
20         
21     <!-- HandlerMapping:表示将请求的URL和Bean名字映射,如URL为 “上下文/hello”,则Spring配置文件必须有一个名字为“/hello”的Bean,上下文默认忽略。 -->
22     <bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"></bean>
23     
24     <!-- HandlerAdapter部分,表示所有实现了org.springframework.web.servlet.mvc.Controller接口的Bean可以作为Spring Web MVC中的处理器。
25     如果需要其他类型的处理器可以通过实现HadlerAdapter来解决  -->
26     <bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"></bean>
27     
28     <bean name="/hello" class="springMVC.HelloWorldControl"></bean>
29 </beans>

这个spring-servlet.xml文件中13 and 15 行有问题,注释调就没事了

spring mvc 配置运行报错误

标签:

原文地址:http://www.cnblogs.com/wangzhihua/p/4395594.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!