No setter found for property 'packagesToScan' of class 'org.springframework.orm.hibernate3.annotatio
2013-09-01 11:42
405 查看
问题: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的包才有:
Xml代码
<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的包引用是否正确!
原因是在类库lib中org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean的spring包不是3.0的,只用spring3.0的包才有:
Xml代码
<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>
<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的包引用是否正确!
相关文章推荐
- No setter found for property 'sessionFactory' in class 'com.ncs.dao.NewsTypeDAO'
- No setter found for property 'dwraccess ' in class
- tomcat启动报错:Invalid property 'userService' of bean class [xxxx]: No property 'xxx' found
- No setter found for property 'cronExpression' 找不到cronExpression
- 关于myBatis的问题There is no getter for property named 'USER_NAME' in 'class com.bky.model.实例类'
- Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource] for property 'dataSource': no matching e
- mybatis There is no getter for property named 'xx' in 'class java.lang.String
- No configuration found for the specified action: '/sum' in namespace: ''.Form action defaulting to '
- No setter found for property 'mapperLocation' in class 'org.mybatis.spring.SqlSessionFactoryBean' [c
- There is no getter for property named '**' in 'class java.lang.String'
- mybaits错误解决:There is no getter for property named 'id' in class 'java.lang.Long'
- mybatis报错 There is no getter for property named 'xx' in 'class java.lang.String
- Failed to allocate nodeid for API at 192.168.55.9. Returned eror: 'No free node id found for mysqld
- MyBatis There is no getter for property named 'xxx' in 'class java.lang.String'
- no known conversion for argument 1 from ‘[some_class]' to ‘[some_class]&’ 传const引用而非引用
- Mybatis-There is no getter for property named 'tj' in 'class
- mybatis加Spring项目: 解决There is no getter for property named '***' in 'class java.lang.String'问题
- There is no getter for property named 'xxxx' in 'class java.lang.Integer
- org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'funcSetId' in 'class java.lang.Integer'
- Mybatis-异常-There is no getter for property named 'VARCHAR' in 'class com.xxx.xxxxx