场景:SpringMVC运行环境测试,启动TOMCAT服务器时报错
八月 23, 2019 11:42:04 上午 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testServiceimpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.atguigu.atcrowdfunding.manager.dao.TestDao com.atguigu.atcrowdfunding.manager.service.impl.TestServiceimpl.testDao; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.atguigu.atcrowdfunding.manager.dao.TestDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)}
google翻译:
八月23,20199 11:42:04上午org.apache.catalina.core.StandardContext listenerStart
严重:将上下文初始化事件发送到类org.springframework.web.context.ContextLoaderListener的侦听器实例的异常
org.springframework.beans.factory.BeanCreationException:创建名为'testServiceimpl'的bean时出错:注入自动连接的依赖项失败; 嵌套异常是org.springframework.beans.factory.BeanCreationException:无法自动装配字段:private com.atguigu.atcrowdfunding.manager.dao.TestDao com.atguigu.atcrowdfunding.manager.service.impl.TestServiceimpl.testDao; 嵌套异常是org.springframework.beans.factory.NoSuchBeanDefinitionException:找不到类型为[com.atguigu.atcrowdfunding.manager.dao.TestDao]的限定bean依赖:预期至少有1个bean符合此依赖关系的autowire候选者。 依赖注释:{@ org.springframework.beans.factory.annotation.Autowired(required = true)}
问题原因:
testServiceimpl这个名字应该写成testServiceImpl
这个问题太蠢了
=====================================================================
上面的问题解决后出现以下问题:
严重: Error configuring application listener of class com.atguigu.atcrowdfunding.listener.StartSystemListener
java.lang.ClassNotFoundException: com.atguigu.atcrowdfunding.listener.StartSystemListener
八月 23, 2019 12:27:47 下午 org.apache.catalina.core.StandardContext listenerStart
严重: Skipped installing application listeners due to previous error(s)
八月 23, 2019 12:27:47 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
八月 23, 2019 12:27:47 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/Atcrowdfunding-main] startup failed due to previous errors
google翻译:
严重:配置com.atguigu.atcrowdfunding.listener.StartSystemListener类的应用程序监听器时出错
java.lang.ClassNotFoundException:com.atguigu.atcrowdfunding.listener.StartSystemListener
下月org.apache.catalina.core.StandardContext listenerStart下午8月23日,2019 12:27:47
严重:由于之前的错误而跳过安装的应用程序监听器
八月23,2019 9:12:47下午org.apache.catalina.core.StandardContext startInternal
严重:一个或多个听众未能开始。 完整的详细信息将在相应的容器日志文件中找到
八月23,2019 9:12:47下午org.apache.catalina.core.StandardContext startInternal
严重:上下文[/ Atcrowdfunding-main]启动由于先前的错误而失败