高手帮我看看 spring 问题,实在找不到问题的解决方法了。
错误:
try to login, userName:liwenjun password is:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xjtjLogic' d
efined in ServletContext resource [/WEB-INF/classes/applicationContext_logic_ywgl.xml]: Cannot creat
e inner bean 'com.thtf.bjstat.xjtj.domain.logic.SchoolbaseinfoLogic#97617' while setting bean proper
ty 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error crea
ting bean with name 'com.thtf.bjstat.xjtj.domain.logic.SchoolbaseinfoLogic#97617' defined in Servlet
Context resource [/WEB-INF/classes/applicationContext_logic_ywgl.xml]: Instantiation of bean failed;
nested exception is org.springframework.beans.FatalBeanException: Could not instantiate class [com.
thtf.bjstat.xjtj.domain.logic.SchoolbaseinfoLogic]; constructor threw exception; nested exception is
java.lang.ClassCastException: com.thtf.bjstat.xjtj.dao.hibernate.hql.SchoolBaseInfolDaoHibernateHQL
Impl
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.thtf.bjs
tat.xjtj.domain.logic.SchoolbaseinfoLogic#97617' defined in ServletContext resource [/WEB-INF/classe
s/applicationContext_logic_ywgl.xml]: Instantiation of bean failed; nested exception is org.springfr
amework.beans.FatalBeanException: Could not instantiate class [com.thtf.bjstat.xjtj.domain.logic.Sch
oolbaseinfoLogic]; constructor threw exception; nested exception is java.lang.ClassCastException: co
m.thtf.bjstat.xjtj.dao.hibernate.hql.SchoolBaseInfolDaoHibernateHQLImpl
org.springframework.beans.FatalBeanException: Could not instantiate class [com.thtf.bjstat.xjtj.doma
in.logic.SchoolbaseinfoLogic]; constructor threw exception; nested exception is java.lang.ClassCastE
xception: com.thtf.bjstat.xjtj.dao.hibernate.hql.SchoolBaseInfolDaoHibernateHQLImpl
java.lang.ClassCastException: com.thtf.bjstat.xjtj.dao.hibernate.hql.SchoolBaseInfolDaoHibernateHQLI
mpl
at com.thtf.bjstat.xjtj.domain.logic.SchoolbaseinfoLogic.<init>(SchoolbaseinfoLogic.java:31)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:
39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorIm
pl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:174)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:150)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleI
nstantiationStrategy.java:52)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateB
ean(AbstractAutowireCapableBeanFactory.java:494)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(A
bstractAutowireCapableBeanFactory.java:381)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBeanDef
inition(BeanDefinitionValueResolver.java:151)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNeces
sary(BeanDefinitionValueResolver.java:97)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropert
yValues(AbstractAutowireCapableBeanFactory.java:760)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean
(AbstractAutowireCapableBeanFactory.java:571)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(A
bstractAutowireCapableBeanFactory.java:414)
servers文件配置:
如下:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="schoolBaseGradLogic" parent="baseTransactionProxy">
<property name="target">
<bean />
</property>
</bean>
<bean id="worklevelsystemLogic" parent="baseTransactionProxy">
<property name="target">
<bean />
</property>
</bean>
<bean id="xjtjLogic" parent="baseTransactionProxy">
<property name="target">
<bean />
</property>
</bean>
</beans>
==================================
dao 文件配置:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<bean id="schoolBaseGradeDao" abstract="false" singleton="false" lazy-init="default" autowire="default" dependency-check="default">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="worklevelsystemDao" abstract="false" singleton="false" lazy-init="default" autowire="default" dependency-check="default">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
<bean id="xjtjDao" abstract="false" singleton="false" lazy-init="default" autowire="default" dependency-check="default">
<property name="sessionFactory"><ref bean="sessionFactory"/></property>
</bean>
</beans>
=====================================================[b][b]
我的异常网推荐解决方案:org.springframework.beans.factory.BeanCreationException:,http://www.myexception.cn/j2ee/10759.html