配置数据源采用的是下面文章中的方法,用jdk1.6可以正常运行,换成jdk1.7就无法运行
http://blog.csdn.net/alaahong/article/details/8707915找了下原因是写一个DynamicDataSource类继承AbstractRoutingDataSource,
AbstractRoutingDataSource基类继承的是CommonDataSource,
CommonDataSource接口中增加了getParentLogger方法。
但不知道怎么实现这个方法
http://blog.csdn.net/alaahong/article/details/8707915找了下原因是写一个DynamicDataSource类继承AbstractRoutingDataSource,
AbstractRoutingDataSource基类继承的是CommonDataSource,
CommonDataSource接口中增加了getParentLogger方法。
但不知道怎么实现这个方法
解决方案 »
- 求解这个Caused By
- WEB系统获取客户机MAC地址
- ie6 xml 高分求解!
- Spring注入
- 请问初学hibernate,哪个教材比较好?
- 为什么xfire生成webservice客户端时有的属性是String,Double的,有的属性是JAXBElement<String>,JAXBElement<Double>的?
- struts跳转时如何实现地址栏也变化
- 有关velocity的问题
- 分数太多,大家共享
- 在j2ee1.3.1(RI)的环境中运行servlet,使用io读写文件,总提示没有权限,tomcat中可以通过,怎样解决?
- 如果在struts处理方法中获得当前项目路径?求解,试了好多都不行呢
- struts2 tomcat6 运行一段时间后 action会报404 not found,其它action确可以正常访问。
报什么错,这个总要贴下吧。
Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.ews.xianguoxiu.shop.dao.IPropertyParantDao com.ews.xianguoxiu.shop.service.PropertyParantService.propertyParantDao; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'propertyParantDao' defined in file [E:\xianguoxiu\WebRoot\WEB-INF\classes\com\ews\xianguoxiu\shop\daoImpl\PropertyParantDaoImpl.class]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file
[E:\xianguoxiu\WebRoot\WEB-INF\applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in file [E:\xianguoxiu\WebRoot\WEB-INF\applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'txAdviceXGX': Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'transactionManager' defined in file [E:\xianguoxiu\WebRoot\WEB-INF\applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'sessionFactory': FactoryBean which is currently in creation returned null from getObject
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:285)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1074)
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.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1075)
at com.ews.xianguoxiu.shop.test.service.PropertyParantTest.testGet(PropertyParantTest.java:14)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at junit.framework.TestCase.runTest(TestCase.java:168)