这个是我的spring配置文件
<?xml version="1.0" encoding="UTF-8"?>
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
<property name="url"
value="jdbc:mysql://localhost:3306/houseproject?useUnicode=true&characterEncoding=UTF-8"></property>
<property name="username" value="root"></property>
<property name="password" value=""></property>
<property name="maxActive" value="100"></property>
<property name="maxIdle" value="30"></property>
<property name="maxWait" value="500"></property>
<property name="defaultAutoCommit" value="true"></property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/shj/houseproject/pojo/Users.hbm.xml</value>
<value>org/shj/houseproject/pojo/Area.hbm.xml</value>
<value>org/shj/houseproject/pojo/House.hbm.xml</value>
<value>org/shj/houseproject/pojo/Street.hbm.xml</value>
</list>
</property>
</bean>
<!-- 事务处理 固定模式 -->
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<tx:advice id="txAdvicehouse" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="list" propagation="REQUIRED" />
<!--对name对应的方法进行事务处理 -->
<!--
<tx:method name="ad*" propagation="REQUIRED" /> <tx:method
name="del*" propagation="REQUIRED" /> <tx:method name="upd*"
propagation="REQUIRED" /> <tx:method name="findBy*"
propagation="REQUIRED" />
-->
</tx:attributes>
</tx:advice>
<!--设置切点 -->
<aop:config>
<aop:pointcut id="allManagerMethodhouse" expression="execution(* org.shj.houseproject.houseService.*.*(..))" />
<aop:advisor advice-ref="txAdvicehouse" pointcut-ref="allManagerMethodhouse" />
</aop:config>
<!-- 设置login切面通知 -->
<tx:advice id="txAdvicelogin" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="log*" propagation="REQUIRED" />
</tx:attributes>
</tx:advice>
<!-- 设置切点 -->
<aop:config>
<!-- 设置对那个包里面的类里面的方法进行代理 这样就精确到了一个方法 也就是一个切点-->
<aop:pointcut id="allManagerMethodlogin"
expression="execution(* org.shj.houseproject.loginService.*.*(..))" />
<!--这个就是将切点和通知结合起来桥梁 这样就可以进行代理了 -->
<!--箭头只是代表的标记作用 -->
<aop:advisor advice-ref="txAdvicelogin" pointcut-ref="allManagerMethodlogin" />
</aop:config>
<!--
将sessionfactory注入到logindaoimpl中里面 为什么代码里面没有写sessionFactory
因为logindaoimpl是继承HibernateDaoSupport
-->
<bean id="loginDAOImpl" class="org.shj.houseproject.login.dao.LoginDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<!-- 将loginDAO注入到logindaoserviceImpl中 -->
<bean id="loginManager" class="org.shj.houseproject.login.Service.LoginServiceImpl">
<property name="logindaoi">
<ref bean="loginDAOImpl" />
</property>
</bean>
<!-- 将loginserviceImpl注入到Action -->
<bean id="loginAction" class="org.shj.houseproject.login.action.LoginAction">
<property name="longinservice">
<ref bean="loginManager" />
</property>
</bean>
<bean id="houseDAOImpl" class="org.shj.houseproject.login.dao.LoginDAOImpl">
<property name="sessionFactory">
<ref bean="sessionFactory" />
</property>
</bean>
<bean id="houseService" class="org.shj.houseproject.houseService.HouseServiceImpl">
<property name="housedao">
<ref bean="houseDAOImpl" />
</property>
</bean>
<bean id="HouseAction" class="org.shj.houseproject.house.action.HouseAction">
<property name="houseservice">
<ref bean="houseService" />
</property>
</bean>
出现下面异常
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'houseManager' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'org.shj.houseproject.login.dao.LoginDAOImpl' to required type 'org.shj.houseproject.house.dao.IHouseDAO' for property 'housedao'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [org.shj.houseproject.login.dao.LoginDAOImpl] to required type [org.shj.houseproject.house.dao.IHouseDAO] for property 'housedao': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:521)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:562)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:871)
at org.springframewo
求解决 搞了一下午了解决不了求大家帮忙