Spring+SpringMVC+hibernate报错
在Spring配置中向logindao中注入sessionFactory就报错:Causedby:org.springframework.beans.NotWritabl...
在Spring配置中向logindao中注入sessionFactory就报错:
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' of bean class [com.first.web.daoImpl.LoginDaoImpl]: Bean property 'sessionFactory' 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.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1064)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
... 27 more
把sessionFactory注入去掉,dao层用到getcutrrentSession就报空指针。
dao层中set get方法都有, 展开
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' of bean class [com.first.web.daoImpl.LoginDaoImpl]: Bean property 'sessionFactory' 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.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:1064)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:924)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:76)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:58)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1393)
... 27 more
把sessionFactory注入去掉,dao层用到getcutrrentSession就报空指针。
dao层中set get方法都有, 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询