packagesToScan no setter found问题

问题:No setter found for property 'packagesToScan' of class 'org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean'


原因是在类库lib中org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean的spring包不是3.0的,只用spring3.0的包才有:

 

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
	<property name="configLocations">
		<value>classpath:hibernate.cfg.xml</value>
	</property>
	<property name="packagesToScan">
		<list>
			<value>com.gdie.account.entity</value>
		</list>
	</property>
	<property name="schemaUpdate">
		<value>true</value>	
	</property>
</bean>
 

 

的配置功能!!!

以后遇到这种问题就要小心spring的包引用是否正确!

你可能感兴趣的:(spring)