spring3 与hibernate配置问题

问题描述

org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'loginController':Injectionofautowireddependenciesfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Couldnotautowirefield:privatenet.viralpatel.spring3.service.AdminServicenet.viralpatel.spring3.controller.LoginController.adminService;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'adminServiceImpl':Injectionofautowireddependenciesfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Couldnotautowirefield:privatecom.hibernate.AdminDAOnet.viralpatel.spring3.service.AdminServiceImpl.adminDAO;nestedexceptionisorg.springframework.beans.factory.NoSuchBeanDefinitionException:Nomatchingbeanoftype[com.hibernate.AdminDAO]foundfordependency:expectedatleast1beanwhichqualifiesasautowirecandidateforthisdependency.Dependencyannotations:{@org.springframework.beans.factory.annotation.Autowired(required=true),@org.springframework.beans.factory.annotation.Qualifier(value=adminDAO)}org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)javax.servlet.GenericServlet.init(GenericServlet.java:160)org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:310)java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)java.lang.Thread.run(Thread.java:619)

解决方案

解决方案二:
异常信息不全吧,主要看下面的Causeby...
解决方案三:
exceptionisorg.springframework.beans.factory.NoSuchBeanDefinitionException:Nomatchingbeanoftype[com.hibernate.AdminDAO]foundfordependency:expectedatleast1beanwhichqualifiesasautowirecandidateforthisdependency很明显了
解决方案四:
你这个dao是哪里实例化的@org.springframework.beans.factory.annotation.Qualifier(value=adminDAO)看看它的的id是不是adminDAO
解决方案五:
现在变成这样子了rg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'loginController':Injectionofautowireddependenciesfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Couldnotautowirefield:privatenet.viralpatel.spring3.service.AdminServicenet.viralpatel.spring3.controller.LoginController.adminService;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'adminServiceImpl':Injectionofautowireddependenciesfailed;nestedexceptionisorg.springframework.beans.factory.BeanCreationException:Couldnotautowirefield:privatenet.viralpatel.spring3.dao.AdminDAOnet.viralpatel.spring3.service.AdminServiceImpl.adminDAO;nestedexceptionisorg.springframework.beans.factory.NoSuchBeanDefinitionException:Nomatchingbeanoftype[net.viralpatel.spring3.dao.AdminDAO]foundfordependency:expectedatleast1beanwhichqualifiesasautowirecandidateforthisdependency.Dependencyannotations:{@org.springframework.beans.factory.annotation.Autowired(required=true),@org.springframework.beans.factory.annotation.Qualifier(value=adminDAO)}org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:291)org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:288)org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:190)org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:580)org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:442)org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)javax.servlet.GenericServlet.init(GenericServlet.java:160)org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)java.lang.Thread.run(Thread.java:619)
解决方案六:
不能根据这个名字创建bean,你看你的loginController是否存在,其实你看看你是否有cglib包?

时间: 2024-10-27 01:27:54

spring3 与hibernate配置问题的相关文章

hibernate-SSH框架,Hibernate配置问题

问题描述 SSH框架,Hibernate配置问题 类:class A{},class B extends class A{} , class C extends class A{}, class D{ private Setas; ... getter setter.... } 这种情况D.hbm.xml怎么配置,里面有一多态,但是配置文件中class属性对应的是具体的表啊

Hibernate配置问题

问题描述 请问各位为什么Hibernate中的属性<propertyname="hbm2ddl.auto">update</property>没有用啊,不是说hbm2ddl.auto的值改为update就可以改变表的结构吗?我的hibernate配置为<session-factory><!--Databaseconnectionsettings--><propertyname="connection.driver_clas

spring3.1+ehcache配置问题

问题描述 ehcache主配置如下:<!-- 配置ehcache缓存管理器 --><bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"><property name="configLocation" value="classpath:ehcache/ehcache.xml&quo

WebSphere 8.5中CXF2.5.2+Spring3.0的配置问题

问题描述 [8/22/1513:09:24:399CST]00000045WASSessionCorISessionContextRegistrygetSessionContextSESN0176I:Willcreateanewsessioncontextforapplicationkeydefault_hostUWC[8/22/1513:09:24:431CST]00000045jspWcom.ibm.ws.jsp.webcontainerext.WASJSPExtensionProcesso

spring-hibernate cache配置问题

问题描述 hibernate cache配置问题 求各位大神帮忙.. WARN: HHH020003: Could not find a specific ehcache configuration for cache named [org.hibernate.cache.internal.StandardQueryCache]; using defaults. <property name="hibernateProperties"> <props> <

hibernate+sqlite链接问题

问题描述 hibernate+sqlite链接问题 hibernate链接sqlite 项目启动时database is locked 是什么原因导致的呢?驱动包版本还是方言 或者是hibernate配置问题呢?有遇到这问题的吗?(能帮忙解答者 解决后高分酬谢) 解决方案 Hibernate 链接sqlite 链接hibernate与数据库的链接 解决方案二: Sqlite不支持并发执行写入操作

java web项目部署之后,运行几天会不正常,登录页面可以打开,但是进行任何数据库操作都会特别卡

问题描述 java web项目部署之后,运行几天会不正常,登录页面可以打开,但是进行任何数据库操作都会特别卡 java web项目部署之后,运行几天会不正常,登录页面可以打开,但是进行任何数据库操作都会特别卡,比如登录. 查了tomcat日志,宕机前只有一个MySQLSyntaxErrorException错误 大神分析一下 还有没有需要提供的东西?? 用的是java,tomcat7,springmvc,spring3.0,hibernate,mysql 解决方案 数据库连接使用完成后有没有关闭

Red5+Flex开发流媒体播放器,前(“钱”)途无量

Red5是一个采用Java开发开源的Flash流媒体服务器.它支持:把音频(MP3)和视频(FLV)转换成播放流: 录制客户端播放流(只支持FLV):共享对象:现场直播流发布:远程调用.Red5使用RSTP作为流媒体传输协议,在其自带的一些示例中演示了在线录制,flash流媒体播放,在线聊天,视频会议等一些基本功能. Flex 是一个高效.免费的开源框架,可用于构建具有表现力的 Web应用程序,这些应用程序利用Adobe Flash Player和Adobe AIR, 运行时跨浏览器.桌面和操作

[学习资料]Flex 4.6+ActionScript 3.0实战

问题描述 Flex是一个高效.免费的开源框架,可用于构建具有表现力的Web应用程序,这些应用程序利用AdobeFlashPlayer和AdobeAIR,运行时跨浏览器.桌面和操作系统实现一致的部署.虽然只能使用Flex框架构建Flex应用程序,但AdobeFlashBuilder(之前称为AdobeFlexBuilder)软件可以通过智能编码.交互式遍历调试以及可视设计用户界面布局等功能加快开发.想学习这方面的朋友也可以看看这份不错的资料<基于Flex4.X+BlazeDS+Spring3+JP