Another entities-cannot-be-cast-to-javassist-util-proxy-proxy

后端 未结 3 1072
北海茫月
北海茫月 2021-01-18 08:09

Following thread [entities cannot be cast to javassist.util.proxy.Proxy, i do have now a server side error ( tks thomas) I wasn\'t able to face the real problem within my ap

3条回答
  •  星月不相逢
    2021-01-18 08:22

    I also hit this issue while attempting to render an entity as JSON using Spring's @ResponseBody annotation. The issue turned out to be a relationship annotated as @ManyToOne with a FetchType of LAZY. The error message was not at all helpful. Switching to EAGER fetch solved the problem.

    It may be helpful to note that in my case, the target entity also had a relationship of @ManyToOne which was recursive (target table had a foreign key to itself) which was also mapped as LAZY. Both relationships had to be switched to EAGER to get the problem resolved.

提交回复
热议问题