No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor

后端 未结 8 1790
野的像风
野的像风 2020-12-04 15:15

When i try to navigat to an endpoint i get tho following error

Type definition error: [simple type, class org.hibernate.proxy.pojo.bytebuddy.ByteBuddy

8条回答
  •  遥遥无期
    2020-12-04 16:09

    @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) work for me very well. It doesn't miss any reference objects and resolve the problem.

    In my case:

    @Entity
    @Table(name = "applications")
    public class Application implements Serializable {
    
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        private Long id;
    
        @NotBlank
        @Size(max = 36, min = 36)
        private String guid;
    
        @NotBlank
        @Size(max = 60)
        private String name;
    
        @Column(name = "refresh_delay")
        private int refreshDelay;
    
        @ManyToOne(fetch = LAZY)
        @JoinColumn(name = "id_production", referencedColumnName = "id")
        @JsonIgnoreProperties(value = {"applications", "hibernateLazyInitializer"})
        private Production production;
    

提交回复
热议问题