小编Oce*_*nth的帖子

没有找到类 org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor 的序列化器,也没有发现创建 BeanSerializer 的属性

我将 Spring Boot 与 Spring Data JPA 结合使用。但是,当我尝试从存储库检索数据时,会引发以下错误:

Type definition error: [simple type, class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor]; nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.hibernate.proxy.pojo.bytebuddy.ByteBuddyInterceptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: com.example.model.Pokemon$HibernateProxy$DuUnG9om[\"hibernateLazyInitializer\"])
Run Code Online (Sandbox Code Playgroud)

我看到的大多数“重复项”都有关系,但我的口袋妖怪类没有。我有什么遗漏的吗?

我的 Pokemon 类是一个简单的 POJO 类:

package com.example.model;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
public class Pokemon implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -2228784815938588107L;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO) …
Run Code Online (Sandbox Code Playgroud)

java spring hibernate spring-data-jpa

2
推荐指数
1
解决办法
7822
查看次数

标签 统计

hibernate ×1

java ×1

spring ×1

spring-data-jpa ×1