at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1064)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
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:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'fileUploadDao' is defined
at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:510)
DAO
@Repository
public class FileUploadDAO extends BaseDAO<FileUpload> {
}
model
@Entity@Table(name="uploadfile")
public class FileUpload implements Serializable{
/**
* 文件上传
*/
private static final long serialVersionUID = 7194554589429406803L;
@Id @GeneratedValue
private Integer id;
@Column(nullable=false,length=80)
private String filepath;
@Temporal(TemporalType.TIMESTAMP)
private Date uploadtime;
public FileUpload()
{
}
public FileUpload(String filepath) {
this.filepath = filepath;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getFilepath() {
return filepath;
}
public void setFilepath(String filepath) {
this.filepath = filepath;
}
public Date getUploadtime() {
return uploadtime;
}
public void setUploadtime(Date uploadtime) {
this.uploadtime = uploadtime;
}
接口
*/public interface IFileUploadService extends ServiceInterface<FileUpload> {
public List<FileUpload> getFilePath(Integer[] ids);
public List<FileUpload> findAllUploadFile();
@SuppressWarnings("rawtypes")
public Page findAllUploadFile(Page page,List<PropertyFilter> pfList);
接口的实现类
@Component("fileUploadService")
public class FileUploadService extends BaseService<FileUpload>implements IFileUploadService {
@Resource(name="fileUploadDao")
//@Resource
//@Qualifier("uploadFileDao")
private DAOInterface<FileUpload> fileUploadDao;
public FileUploadService(){}
public List<FileUpload> getFilePath(Integer[] ids) {
// TODO Auto-generated method stub
if(ids!=null && ids.length>0){
StringBuffer jpql = new StringBuffer();
String hql;
for(int i=0; i<ids.length;i++){
jpql.append('?').append((i+1)).append(',');
}
jpql.deleteCharAt(jpql.length()-1);
hql=" select o.filepath from UploadFile o where o.id in("+ jpql.toString()+ ")";
return null;
}
return null;
}
@SuppressWarnings({ "unchecked", "rawtypes" })
public Page findAllUploadFile(Page page, List<PropertyFilter> pfList) {
//初始化hql
StringBuffer hql=new StringBuffer("from UploadFile");
//设置查询条件
String condition= QueryUtil.toSqlString(pfList, true);
hql.append(condition);
//查找所有用户的总条数
int totalCount=this.fileUploadDao.findCountBySql(hql.toString());
page.setTotalCount(totalCount);
//是否存在排序
if(page.isOrderBySetted()){
hql.append(page.getOrder());
}
List<FileUpload> list=this.fileUploadDao.findList(hql.toString(), page.getPageNo(), page.getPageSize());
//查出结果集
page.setResult(list);
return page;
}
public List<FileUpload> findAllUploadFile() {
String hql="from UploadFile";
return this.fileUploadDao.findList(hql);
}
public DAOInterface<FileUpload> getUploadFileDao() {
return fileUploadDao;
}
public void setUploadFileDao(DAOInterface<FileUpload> uploadFileDao) {
this.fileUploadDao = uploadFileDao;
}
@Override
protected DAOInterface<FileUpload> getDAO() {
// TODO Auto-generated method stub
return fileUploadDao;
}
}
12 个解决方案
#1
No bean named 'fileUploadDao' is defined
fileUploadDao这个BEAN名字对吗。。
fileUploadDao这个BEAN名字对吗。。
#2
纳闷。。。。应该对了。。。我有宣告啊!
#3
你spring配置文件有配置fileUploadDao这个bean么?或是配置错误,写错?
#4
有配置啊!<!--主键Bean类 -->
<property name="annotatedClasses">
<list>
<value>com.studysystem.model.user.UserInfor</value>
<value>com.studysystem.model.action.Action</value>
<value>com.studysystem.model.menu.Menu</value>
<value>com.studysystem.model.module.Module</value>
<value>com.studysystem.model.role.Role</value>
<value>com.studysystem.model.article.ArticleInfor</value>
<value>com.studysystem.model.article.ArticleStyle</value>
<value>com.studysystem.model.article.ArticleType</value>
<value>com.studysystem.model.article.Brand</value>
<value>com.studysystem.model.uploadfile.FileUpload</value>
</list>
</property>
<property name="annotatedClasses">
<list>
<value>com.studysystem.model.user.UserInfor</value>
<value>com.studysystem.model.action.Action</value>
<value>com.studysystem.model.menu.Menu</value>
<value>com.studysystem.model.module.Module</value>
<value>com.studysystem.model.role.Role</value>
<value>com.studysystem.model.article.ArticleInfor</value>
<value>com.studysystem.model.article.ArticleStyle</value>
<value>com.studysystem.model.article.ArticleType</value>
<value>com.studysystem.model.article.Brand</value>
<value>com.studysystem.model.uploadfile.FileUpload</value>
</list>
</property>
#5
No bean named 'fileUploadDao' is defined
注意大小写,最好复制。。。
注意大小写,最好复制。。。
#6
第一、有没有包冲突,一般将系统的删去,用spring security不会有问题。
第二、确保在spring的xml里面有<http>声明默认初始化。
第三、确保能够找到spring 的xml文件。
第四、注意大小写区分。
第二、确保在spring的xml里面有<http>声明默认初始化。
第三、确保能够找到spring 的xml文件。
第四、注意大小写区分。
#7
你这个不是配置fileUploadDao的吧?
#8
对于你所说jar冲突的可能性不大因为我之前实现用户模块的是正常的但是这个就莫名其妙。。。。包这种错误!
#9
这个问题解决了。。。既然用这个resource(bytype=xx.class)找到了!
#10
JUnit能够测试成功了以后!tomcat却报这个错!
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileUploadService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.studysystem.dao.FileUploadDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class com.studysystem.dao.FileUploadDAO, authenticationType=CONTAINER)}
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1064)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
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:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.studysystem.dao.FileUploadDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class com.studysystem.dao.FileUploadDAO, authenticationType=CONTAINER)}
相当的郁闷啊!
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileUploadService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.studysystem.dao.FileUploadDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class com.studysystem.dao.FileUploadDAO, authenticationType=CONTAINER)}
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1064)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
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:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.studysystem.dao.FileUploadDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class com.studysystem.dao.FileUploadDAO, authenticationType=CONTAINER)}
相当的郁闷啊!
#11
名字大小写写错了吧
#12
终于解决哥们!是这个问题。。。@repository("xxx")就可以搞定了
#1
No bean named 'fileUploadDao' is defined
fileUploadDao这个BEAN名字对吗。。
fileUploadDao这个BEAN名字对吗。。
#2
纳闷。。。。应该对了。。。我有宣告啊!
#3
你spring配置文件有配置fileUploadDao这个bean么?或是配置错误,写错?
#4
有配置啊!<!--主键Bean类 -->
<property name="annotatedClasses">
<list>
<value>com.studysystem.model.user.UserInfor</value>
<value>com.studysystem.model.action.Action</value>
<value>com.studysystem.model.menu.Menu</value>
<value>com.studysystem.model.module.Module</value>
<value>com.studysystem.model.role.Role</value>
<value>com.studysystem.model.article.ArticleInfor</value>
<value>com.studysystem.model.article.ArticleStyle</value>
<value>com.studysystem.model.article.ArticleType</value>
<value>com.studysystem.model.article.Brand</value>
<value>com.studysystem.model.uploadfile.FileUpload</value>
</list>
</property>
<property name="annotatedClasses">
<list>
<value>com.studysystem.model.user.UserInfor</value>
<value>com.studysystem.model.action.Action</value>
<value>com.studysystem.model.menu.Menu</value>
<value>com.studysystem.model.module.Module</value>
<value>com.studysystem.model.role.Role</value>
<value>com.studysystem.model.article.ArticleInfor</value>
<value>com.studysystem.model.article.ArticleStyle</value>
<value>com.studysystem.model.article.ArticleType</value>
<value>com.studysystem.model.article.Brand</value>
<value>com.studysystem.model.uploadfile.FileUpload</value>
</list>
</property>
#5
No bean named 'fileUploadDao' is defined
注意大小写,最好复制。。。
注意大小写,最好复制。。。
#6
第一、有没有包冲突,一般将系统的删去,用spring security不会有问题。
第二、确保在spring的xml里面有<http>声明默认初始化。
第三、确保能够找到spring 的xml文件。
第四、注意大小写区分。
第二、确保在spring的xml里面有<http>声明默认初始化。
第三、确保能够找到spring 的xml文件。
第四、注意大小写区分。
#7
你这个不是配置fileUploadDao的吧?
#8
对于你所说jar冲突的可能性不大因为我之前实现用户模块的是正常的但是这个就莫名其妙。。。。包这种错误!
#9
这个问题解决了。。。既然用这个resource(bytype=xx.class)找到了!
#10
JUnit能够测试成功了以后!tomcat却报这个错!
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileUploadService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.studysystem.dao.FileUploadDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class com.studysystem.dao.FileUploadDAO, authenticationType=CONTAINER)}
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1064)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
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:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.studysystem.dao.FileUploadDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class com.studysystem.dao.FileUploadDAO, authenticationType=CONTAINER)}
相当的郁闷啊!
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'fileUploadService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.studysystem.dao.FileUploadDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class com.studysystem.dao.FileUploadDAO, authenticationType=CONTAINER)}
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1064)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:563)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:872)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:423)
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:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4334)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.studysystem.dao.FileUploadDAO] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class com.studysystem.dao.FileUploadDAO, authenticationType=CONTAINER)}
相当的郁闷啊!
#11
名字大小写写错了吧
#12
终于解决哥们!是这个问题。。。@repository("xxx")就可以搞定了