错误提示:javax.servlet.ServletException: Error creating bean with name '/notice' defined in ServletContext resource [/WEB-INF/action-servlet.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'noticeManager' of bean class [web.action.NoticeAction]: Bean property
都说是Spring配置的问题。。。。 但是我查不到。。。。 是照着例子做的 觉得没什么和例子不同的地方啊。。。
配置文件如下:
<?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="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://localhost:3306/book</value>
</property>
<property name="username">
<value>root</value>
</property>
<property name="password">
<value>root</value>
</property>
</bean>
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource">
<ref bean="dataSource" />
</property>
<property name="mappingDirectoryLocations">
<list>
<value>WEB-INF/classes/dao/model</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop k**="hibernate.dialect">
org.hibernate.dialect.MySQLDialect
</prop>
<prop k**="hibernate.show_sql">false</prop>
</props>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<!-- **************************** add the conf********************************** -->
<bean id="noticeDao"
class="dao.dao.hibernate.NoticeDaoHibernate">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="noticeManagerTarget"
class="service.impl.NoticeManagerImpl">
<property name="noticeDao" ref="noticeDao" />
</bean>
<!-- ********************Transaction Configration***************************** -->
<!-- *****************************************************add the back************************************************** -->
<bean id="noticeManager"
class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
<property name="transactionManager">
<ref bean="transactionManager" />
</property>
<property name="target">
<ref local="noticeManagerTarget" />
</property>
<property name="transactionAttributes">
<props>
<prop k**="find*">PROPAGATION_REQUIRED</prop>
<prop k**="get*">PROPAGATION_REQUIRED,readOnly</prop>
<prop k**="save*">PROPAGATION_REQUIRED</prop>
<prop k**="remove*">PROPAGATION_REQUIRED</prop>
<prop k**="insert*">PROPAGATION_REQUIRED</prop>
<prop k**="update*">PROPAGATION_REQUIRED</prop>
<prop k**="*">PROPAGATION_REQUIRED</prop>
</props>
</property>
</bean>
<!-- *************************************************add the back end******************************************************** -->
</beans>
// 在此输入java代码
// 在此输入java代码
// 在此输入java代码