JPA 中 failed to lazily initialize a collection of role: com.test.security.rbac.domain.Resource.urls, could not initialize proxy - no Session

 

failed to lazily initialize a collection of role: com.test.security.rbac.domain.Resource.urls, could not initialize proxy - no Session

 

原:

......
/**
 * 实际需要控制权限的url
*/
@ElementCollection
private Set<String> urls;
......

 

新:

......
    /**
     * 实际需要控制权限的url
     */
    @ElementCollection(fetch =FetchType.EAGER)
    private Set<String> urls;
.....

 

网上说的原因是惰加引用的错误

posted @ 2022-05-17 17:56  三瑞  阅读(52)  评论(0编辑  收藏  举报