问题描述
- 急求,大神!!!这是什么问题,错误代码如下:
-
log4j:WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j:WARN Please initialize the log4j system properly.
2016-1-5 12:27:30 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.BeanDefinitionStoreException: Invalid bean definition with name 'userDAO' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Could not resolve parent bean definition 'BaseDAO'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'BaseDAO' is defined
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:1152)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:1097)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:560)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:276)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:197)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:47)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5077)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5591)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1263)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1975)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'BaseDAO' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:527)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1083)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:864)
at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:1138)
... 22 more
2016-1-5 12:27:30 com.sun.faces.config.ConfigureListener contextInitialized
解决方案
Could not resolve parent bean definition 'BaseDAO'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'BaseDAO' is defined
解决方案二:
BaseDAO没有发现?,配置出错了!
解决方案三:
应该是BaseDAO这个实体类未找到,一般console的错误看最后一条Caused by就行了
解决方案五:
BaseDAO配置问题
解决方案六:
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'userDAO' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Could not resolve parent bean definition 'BaseDAO'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'BaseDAO' is defined
解决方案七:
,BaseDao这个类注入有问题,把这个类截个图看下。
解决方案八:
UserDAo未找到,检查一下你的配置文件
时间: 2025-01-07 04:25:50