`
jiangnan2112
  • 浏览: 122231 次
  • 性别: Icon_minigender_1
  • 来自: 重庆
社区版块
存档分类
最新评论

could not initialize proxy - no Session

阅读更多
好好的程序第二天报如下错:
2010-9-27 10:44:16 org.apache.catalina.core.ApplicationDispatcher invoke
严重: Servlet.service() for servlet jsp threw exception
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
	at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:132)
	at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(AbstractLazyInitializer.java:174)
	at org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.invoke(JavassistLazyInitializer.java:190)
	at com.adtech.libraryunion.domain.service.TbFaqType_$$_javassist_45.getBftyTypeName(TbFaqType_$$_javassist_45.java)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at javax.el.BeanELResolver.getValue(BeanELResolver.java:62)
	at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
	at org.apache.el.parser.AstValue.getValue(AstValue.java:118)
	at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
	at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:935)
	at org.apache.jsp.WEB_002dINF.views.faq.faq_jsp._jspService(faq_jsp.java:450)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
	at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
	at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:145)
	at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:251)
	at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1144)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:880)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:793)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:476)
	at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:431)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
	at java.lang.Thread.run(Unknown Source)
2010-9-27 10:44:16 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet libunion threw exception
org.hibernate.LazyInitializationException: could not initialize proxy - no Session
	at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:132)


设置把set 里有改lazy="false",结果还是一样的,最后发现不知哪位兄弟把我的过滤器的一段给注释了,才造成报这个错。如果有过滤器,mapping别忘了!
	<filter>   
	    <filter-name>OpenSessionInView</filter-name>   
	    <filter-class>   
	        org.springframework.orm.hibernate3.support.OpenSessionInViewFilter    
	   </filter-class>   
	    <init-param>   
	        <param-name>singleSession</param-name>   
	        <param-value>false</param-value> 
		</init-param>
		<init-param>
			<param-name>sessionFactoryBeanName</param-name>   
	   		<param-value>sessionFactoryCenter</param-value>
	   	</init-param> 
	</filter>


	<filter-mapping>
		<filter-name>OpenSessionInView</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
0
1
分享到:
评论

相关推荐

    S2S3H3整合以及泛型Dao与Service封装

    2.2.3.1+spring-framework-3.1.0+hibernate-distribution-3.6.8+JSON+MySQL+Annotation,并且对Dao和Service进行了封装,内含.jar包,并且解决了一对多双向关联的could not initialize proxy - no Session错误,同时...

    集成spring的hibernate懒加载

    当你尝试在Controller层或者视图层访问懒加载的属性时,如果Session已经关闭("no Session..."错误),就会抛出`org.hibernate.LazyInitializationException`。这是因为懒加载的代理对象需要Session来执行数据库查询...

    基于SSH框架的BBS论坛JavaEE项目源码

    7.注册如果发送邮件激活的方式出错(返回页面错误org.hibernate.LazyInitializationException: could not initialize proxy - no Session) 8.禁止用户后不允许登录、发帖、回帖等 9.后台会员搜索中文名搜索乱码 ...

    Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser

    标题 "Could not initialize class net.sf.jasperreports.engine.util.JRStyledTextParser" 提示了一个Java运行时错误,这通常意味着在尝试加载或初始化`JRStyledTextParser`类时遇到了问题。`JRStyledTextParser`是...

    Plsql 12连接Oracle时出现Could not initialize oci.dll解决方案 oracle 客户端

    在使用PL/SQL Developer 12连接Oracle数据库时,可能会遇到“Could not initialize oci.dll”这样的错误提示。这个错误通常表明系统无法找到或正确加载Oracle客户端的oci.dll库文件,这是Oracle Instant Client的一...

    JAVA错误文档[归纳].pdf

    7. **Action的返回方法出错,could not initialize proxy - no Session** 这可能是在Hibernate操作中没有正确初始化Session。确保在访问数据库之前已打开Session,并在完成后关闭。 8. **查询数据出现乱码问题** ...

    Hibernate配置常见错误

    错误表现:在Session关闭后尝试访问懒加载属性,抛出“org.hibernate.LazyInitializationException: could not initialize proxy - no Session”异常。 解决方案:理解并合理使用Open Session in View(OSIV)模式...

    oracle_plsql连服务端时 Initialization error could initialize错误处理方法

    解决:oracle_plsql连服务端时 Initialization error could initialize错误处理方法

    Plsql Developer连接Oracle时出现Could not initialize oci.dll解决方案

    在使用PL/SQL Developer这款强大的Oracle数据库管理工具时,有时可能会遇到“Could not initialize oci.dll”的错误提示,这通常是由于应用程序与Oracle客户端组件之间的兼容性问题导致的。本文将详细介绍如何解决这...

    java开源论坛jeebbs系统源码包

    7.注册如果发送邮件激活的方式出错(返回页面错误org.hibernate.LazyInitializationException: could not initialize proxy - no Session) 8.禁止用户后不允许登录、发帖、回帖等 9.后台会员搜索中文名搜索乱码 ...

    java串口所需依赖dll文件合集

    监听COM口启动程序报错 Could not initialize class gnu.io.RXTXCommDriver异常 是因为需要在%JAVA_HOME%/jre/bin目录中添加rxtxParallel.dll、rxtxSerial.dll文件

    解决hbase client在windows环境下报NoClassDefFound问题

    解决hbase client在windows环境下报Could not initialize class org.fusesource.jansi.internal.Kernel32的问题,把jar包放入hbase client的lib包下,重新运行hbase.cmd shell即可

    jacob_1.14.3.rar

    内涵jacob_1.14.3-x64.dll;jacob_1.14.3-64.jdk(maven地址);解决方法:Could not initialize class com.jacob.com.ComThread

    ezmorph-1.0.6.jar

    缺少这个包可能导致Could not initialize class net.sf.json.JsonConfig 使用json时候将会用到的一个jar包,发现这个包在网上提供的比较少.缺少这个包可能导致Could not initialize class net.sf.json.JsonConfig ...

    linux上实现视频截图

    在Linux操作系统上实现视频截图是一项常见的任务,尤其对于开发者来说,可能需要在处理多媒体内容时进行这样的操作。这里我们将深入探讨如何使用JavaCPP库在32位Linux环境下完成这一目标。 JavaCPP是一个强大的Java...

    instantclient_11_2.zip

    Could not initialize "D:\app\Happy\product\11.2.0\dbhome_1\bin\oci.dll" Make sure you have the 32 bits Oracle Client installed. OracleHomeKey: OracleHomeDir: D:\app\Happy\product\11.2.0\dbhome_1 ...

    derby.jar 。。

    java.lang.NoClassDefFoundError: Could not initialize class org.apache.derby.jdbc.AutoloadedDriver40 导致的原因: 在azkaban的server和executor中缺少一个叫derby.jar的包

    mysql第一次安装成功后初始化密码操作步骤

    在这种情况下,运行`mysqld --initialize-insecure --user=mysql`,这会创建一个无密码的用户。 6. **登录并修改默认密码**: 打开新的命令提示符,输入`mysql -u root -p`,然后输入之前生成的随机密码。登录成功...

    WINSOCK坏了 winsockfix

    错误消息“unable to initialize windows sockets interface error code 0”表明Winsock初始化失败,错误代码0通常表示系统级的错误,可能是由于Winsock配置出错、相关动态链接库(DLL)文件损坏、网络驱动程序冲突...

Global site tag (gtag.js) - Google Analytics