Invalid property 'annotatedClasses' of bean class
Invalid property 'annotatedClasses' of bean class
在整合Hibernate和Spring时出现,Invalid property 'annotatedClasses' of bean class
<bean id="factory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name="annotatedClasses">
<list>
<value>org.yinpan.hibernate.GuestBook</value>
</list>
</property>
</bean>
<bean id="factory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="myDataSource"></property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.SQLServerDialect
</prop>
</props>
</property>
<property name="mappingResources">
<list>
<value>org/yinpan/hibernate/GuestBook.hbm.xml</value>
</list>
</property>
</bean>
上面只需要注意红色部分就行了