Liferay工程调用RoleLocalServiceUtil方法报no hibernate session bound to Thread 异常的解决方法
来源:互联网 发布:普林科技 大数据 编辑:程序博客网 时间:2024/06/05 08:22
这两天遇到了一个问题。在Liferay工程里根据companyId和name获取角色的时候,调用RoleLocalServiceUtil的getRole()方法。代码在执行到底层的时候,在sessionFactory.getCurrentSession()的时候会报hibernate异常:“No hibernate session bound to Thread.....”。搜了网上各种方法,各种修改hibernate的配置,都未能解决问题。好吧,最后只好舍弃百度,用谷歌搜,看老外遇到的问题。看了几个帖子,逐渐有了头绪。大都是说通过****Util调用,我想,也许不是平台的问题,于是从外部入手,又想起以前有看到过Local和不带Local的,于是在插件工程里就改用RoleServiceUtil调用。问题顺利解决。但遗留下一个问题:两者的区别在于 没加Local的类会有permission的判断。而插件工程跟平台也算是本地的,但调了带Local的就会出问题。
- Liferay工程调用RoleLocalServiceUtil方法报no hibernate session bound to Thread 异常的解决方法
- spring hibernate No Hibernate Session bound to thread异常
- hibernate的session的No Hibernate Session bound to thread
- 异常:No Hibernate Session bound to thread……
- No Hibernate Session bound to thread
- No Hibernate Session bound to thread
- HibernateException: No Hibernate Session bound to thread
- springmvc No Hibernate Session bound to thread
- HibernateException: No Hibernate Session bound to thread
- No Hibernate Session bound to thread、No Session found f
- 报错:org.hibernate.HibernateException: No Hibernate Session bound to thread
- Spring+Hibernate 异常No Hibernate Session bound to thread, and configuration does not allow creation
- org.hibernate.HibernateException: No Hibernate Session bound to thread, and
- org.hibernate.HibernateException: No Hibernate Session bound to thread
- org.hibernate.HibernateException: No Hibernate Session bound to thread
- org.hibernate.HibernateException: No Hibernate Session bound to thread
- No Hibernate Session bound to thread纠结了很久
- No Hibernate Session bound to thread, and configuration
- 替代或删除指定的子串(相当于Replace的应用),以递归方式实现
- c++一句话设计模式
- BAPI调用 - SAP 货物移动相关Bapi(MIGO/MB1A)
- JS 判断字符串中是否包含中文
- PowerDesigner 15 导入表
- Liferay工程调用RoleLocalServiceUtil方法报no hibernate session bound to Thread 异常的解决方法
- oracle数据的恢复与备份
- 如何在程序启动默认浏览器与电子邮件系统
- poj3261(后缀数组+二分)
- webdriver知识点总结
- JSON 教程
- Android 学习笔记 Contacts (二)Contacts 联系人详解
- vc中用WaveOut写音乐播放器
- android listView嵌套gridview的使用心得