<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="namingStrategy">
<bean class="org.hibernate.cfg.ImprovedNamingStrategy" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">${hibernate.dialect}</prop> </props>
</property>
<property name="packagesToScan">
<list>
<value>ya.tou.test.dao.*</value>
</list>
</property>
</bean>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [F:\mvenspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\yaTou\WEB-INF\classes\applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'packagesToScan' of bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Bean property 'packagesToScan' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1279)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="namingStrategy">
<bean class="org.hibernate.cfg.ImprovedNamingStrategy" />
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.dialect">${hibernate.dialect}</prop> </props>
</property>
<property name="packagesToScan">
<list>
<value>ya.tou.test.dao.*</value>
</list>
</property>
</bean>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [F:\mvenspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\yaTou\WEB-INF\classes\applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'packagesToScan' of bean class [org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean]: Bean property 'packagesToScan' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1279)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
解决方案 »
- 怎么把保质期预警消息保存到数据库中,然后再显示到页面上?
- SSH 整合登陆实例报错!
- <html:radio>中有默认值 在线等,急求,跪等
- 求教: 如何得到网页中的位置信息
- 有关jsp页面的两个书写方式
- 高兴,散分。
- 真诚请教:如何切换不同的tomcat,望牛人不吝啬回答,分数封上?????
- java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Invalid column
- jbuider 使用经验?
- ssh中hibernate的连接池问题:启动tomcat时就报这个错误,之前都挺好的
- 本人正在学习OA。 现在需要用OSWorkflow流程引擎制作 但是这个配置流程的文件是否有设计流程的设计器呢???
- weblogic连接池问题
<list>
<value>ya.tou.test.dao.* </value>
</list>
这样写的话,spring只会扫描dao下面的包。如果里面放类的话。是扫不到的。