今天遇到一个
Exception thrown by getter for property ** of bean ***
的问题,查了半天还是找不到问题,其实应该从提示信息着手,因为其他同样的页面没有问题,单单一个页面出现问题,后来查数据库发现该页面关联的某页面在数据库中的某一个表中没有数据。。汗了一地。。。
其他相关的解决方法:
1,
配置hibernate文件
http://hi.baidu.com/200770842223/item/830e16dcb8b8fe57d73aae11
2,
解决方法:
可以在web.xml中配置一个openSesseionInViewFilter过滤器
配置如下:
<!-- 配置一个OpenSessionInViewFilter的过滤器,用于当用户请求带有延迟加载的数据时,解决lazyInitialization的问题 -->
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<!-- 在referenced Libraries文件夹下的: spring-orm.jar-->
<filter-class>
org.springframework.orm.jdo.support.OpenPersistenceManagerInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
问题解决了!
参见 http://xiaoxuejie.iteye.com/blog/791872