<h1> nested exception is org.hibernate.LazyInitializationException:</h1>

stackoverflow:http://stackoverflow.com/questions/36106620/failed-to-lazily-initialize-a-collection-of-role-user-authorities-could-not-in

也可以

@ManyToMany(fetch = FetchType.LAZY)  ==》 (fetch = FetchType.EAGER)
@Fetch(FetchMode.SUBSELECT)
@JoinTable(
name = "sys_user_role",
joinColumns = { @JoinColumn(name = "role_id") },
inverseJoinColumns = @JoinColumn(name = "user_id")
)
@JsonIgnore
public Set<SysUser> getSysUsers() {
return sysUsers;
} public void setSysUsers(Set<SysUser> sysUsers) {
this.sysUsers = sysUsers;
}

hibernate异常的更多相关文章

  1. Hibernate 异常总结

    异常一 异常一 异常描述: Sax解析异常:cvc-复杂的类型,发现了以元素maping开头的无效内容,应该是以 ‘{“http://www.hibernate.org/xsd/orm/cfg“:pr ...

  2. Hibernate 异常 —— No CurrentSessionContext configured

    在使用 SessionFactory 的 getCurrentSession 方法时遇到如下异常 “No CurrentSessionContext configured ” 原因是: 在hibern ...

  3. Hibernate 异常 —— Unable to instantiate default tuplize

    出现这个异常 —— Unable to instantiate default tuplizer ,是 Hibernate 的映射文件(*.hbm.xml)导致的.仔细检查一下工程里的映射文件吧. 笔 ...

  4. Hibernate 异常 集锦

    异常1.Error parsing JNDI name [foo] 异常信息摘要: org.hibernate.engine.jndi.JndiException: Error parsing JND ...

  5. hibernate异常:org.hibernate.exception.GenericJDBCException

    异常:org.hibernate.exception.GenericJDBCException 提示:Cannot open connection 提示:不能打开链接 一般这个异常是由 java.sq ...

  6. hibernate异常:org.hibernate.MappingException

    这个是映射文件配置错误 异常:org.hibernate.MappingException 提示:Could not determine type for: java.lang,String, at ...

  7. hibernate异常:org.hibernate.NonUniqueObjectException

    异常:org.hibernate.NonUniqueObjectException 提示:a different object with the same identifier value was a ...

  8. Hibernate异常之命名查询节点未找到

    异常信息: java.lang.IllegalArgumentException: No query defined for that name [salaryEmps] at org.hiberna ...

  9. Hibernate异常之Integer转float(自动类型转换错误)

    错误代码: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Float at org.hiber ...

  10. Java EE 之Hibernate异常总结【1】org.hibernate.LazyInitializationException: could not initialize proxy - no Session

    字面意义就是不能被初始化. 简单理解就是因为,你使用了lazy=true,这样hibernate在从数据库中调数据的时候是不会把关联的对象查出来的,而是保存一个获取值得方法,在你使用getXXX()调 ...

随机推荐

  1. VisualStudio.DTE 对象可以通过检索 GetService() 方法

    DTE dte = (DTE)GetService(typeof(DTE)); string solutionDir = System.IO.Path.GetDirectoryName(dte.Sol ...

  2. eclipse美化,全黑eclipse 保护眼睛

    如标题,闲话不多说.有图说明一切.看看这是你想要的嘛? 教程及资源下载地址: http://download.csdn.net/detail/shoneworn/8326097

  3. Android studio教程:[4]真机测试

    有了Android studio这么好用的软件,自然要有一部不错的安卓手机,然后在真机上测试自己的程序,那样才能更好的发现程序中存在的问题,毕竟模拟器不是真正的手机嘛. 工具/原料 Android s ...

  4. map——映射(message.cpp)

    信息交换 (message.cpp) [题目描述] Byteland战火又起,农夫John派他的奶牛潜入敌国获取情报信息. Cow历尽千辛万苦终于将敌国的编码规则总结如下: 1 编码是由大写字母组成的 ...

  5. SimpleDateFormat的使用

    SimpleDateFormat 是一个以国别敏感的方式格式化和分析数据的具体类. 它允许格式化 (date -> text).语法分析 (text -> date)和标准化. 下面是个小 ...

  6. BottomSheetBehavior 之 java.lang.IllegalArgumentException: The view is not associated with BottomSheetBehavior

    AndroidRuntime: FATAL EXCEPTION: main Process: me.chunsheng.uberdriver, PID: 13674 java.lang.Runtime ...

  7. CentOS minimal版安装图形界面的步骤(自动获取IP)

    1.连接网络: CentOS minimal.iso安装好后,进入终端,默认是不开网络的, 首先启用网卡, 自动获取ip. ifconfig eth0 up   www.2cto.com  dhcli ...

  8. Piggy-Bank (hdoj1114)

    Piggy-Bank Problem Description Before ACM can do anything, a budget must be prepared and the necessa ...

  9. 微软云基础架构Hyper-scale Datacenter

    每天醒来,可能很多人的习惯都是打开手机,看看微信,刷刷朋友圈,或者看看新闻,去咖啡店,打开电脑搜索一些关键字,观看视频,电视剧--可是你有没有想过你每一次键盘的敲击,每一次微信的语音的发送,数据会流向 ...

  10. Android之用PopupWindow实现弹出listview形式菜单

    Android 4.0之前的菜单使用非常广泛,但是在android4.0之后,很少使用先前的菜单样式了.那如何实现下图的样式了? 我们简单模拟一下. (1)屏蔽系统弹出的菜单: 1.首先创建至少一个系 ...