您的位置:首页 > 其它

关于ERROR LazyInitializationException:19 - could not initialize proxy - no Session的错误;

2013-10-13 06:42 411 查看
我在jsp 页面总是出现这个错误原来以为是hibernate 的错误; 每次跳转的时候都会报错;   我以为是hibernate 的问题;  有时候会提示 什么structs json 错误;
 郁闷了半天; 后来看到structs json 错误; 发现方法配置错误了;

    <action name="findQuestionByIndexAction" class="question"

            method="findQuestionByIndex" >

             <result type="json">        

            /front/exercise/exercise00.jsp

    </result>

原来是返回json 对象; 后来是进行转发;

 

把  type="json"去掉

改为    <action name="findQuestionByIndexAction" class="question"

            method="findQuestionByIndex" >

             <result>        

            /front/exercise/exercise00.jsp

    </result>

就不报错了

06:37:53,421 ERROR LazyInitializationException:19 - could not initialize proxy - no Session

org.hibernate.LazyInitializationException: could not initialize proxy - no Session

    at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:57)

    at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:111)

    at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.invoke(CGLIBLazyInitializer.java:150)

    at com.ibeifeng.po.Role$$EnhancerByCGLIB$$cffd6181.getRemark(<generated>)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

    at java.lang.reflect.Method.invoke(Method.java:597)

    at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:227)

    at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)

    at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)

    at org.apache.struts2.json.JSONWriter.add(JSONWriter.java:329)

    at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:228)

    at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)

    at org.apache.struts2.json.JSONWriter.value(JSONWriter.java:131)

    at org.apache.struts2.json.JSONWriter.add(JSONWriter.java:329)

    at org.apache.struts2.json.JSONWriter.bean(JSONWriter.java:228)

    at org.apache.struts2.json.JSONWriter.process(JSONWriter.java:165)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐