java ssh+dwr 错误org.hibernate.LazyInitializationException
在网上找的过滤器但是还是会报org.hibernate.LazyInitializationException 使用ssh+dwr开发工具MyEclipse服务...
在网上找的过滤器但是还是会报org.hibernate.LazyInitializationException 使用ssh+dwr 开发工具MyEclipse 服务器MyEclipse(6.0.1) 自带Tomcat web.xml如下: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <context-param> <param-name>contextConfigLocation </param-name> <param-value>classpath:applicationContext*.xml </param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <servlet> <servlet-name>action </servlet-name> <servlet-class> org.apache.struts.action.ActionServlet </servlet-class> <init-param> <param-name>config </param-name> <param-value>/WEB-INF/struts-config.xml </param-value> </init-param> <init-param> <param-name>debug </param-name> <param-value>3 </param-value> </init-param> <init-param> <param-name>detail </param-name> <param-value>3 </param-value> </init-param> <load-on-startup>0 </load-on-startup> </servlet> <servlet-mapping> <servlet-name>action </servlet-name> <url-pattern>*.do </url-pattern> </servlet-mapping> <filter> <filter-name>hibernateFilter </filter-name> <filter-class> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter </filter-class> <init-param> <param-name>singleSession </param-name> <param-value>true </param-value> </init-param> </filter> <filter-mapping> <filter-name>hibernateFilter </filter-name> <url-pattern>/* </url-pattern> </filter-mapping> <servlet> <servlet-name>dwr-invoker </servlet-name> <servlet-class>org.directwebremoting.servlet.DwrServlet </servlet-class> <init-param> <param-name>debug </param-name> <param-value>true </param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>dwr-invoker </servlet-name> <url-pattern>/dwr/* </url-pattern> </servlet-mapping> <filter-mapping> <filter-name>hibernateFilter </filter-name> <url-pattern>/dwr/* </url-pattern> </filter-mapping> <welcome-file-list> <welcome-file>index.jsp </welcome-file> </welcome-file-list> </web-app> 求大家帮帮忙!! 先谢谢了!! 最好能说的详细点 感激不尽!
展开
3个回答
展开全部
你是不是hibernate有外键链接?如果有请在外键主键设置lazy=false属性。这是延迟加载出错。就是加载的时候把外键的表数据也加载出来。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
该问题应该是你的在别的地方使用的session时报的错,应为此时session已经关闭
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询