具体报错信息:
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: java.util.HashMap[“arcType”]->com.java1234.entity.ArcType
H
i
b
e
r
n
a
t
e
P
r
o
x
y
HibernateProxy
HibernateProxyeQj3Wb0k[“hibernateLazyInitializer”])] with root cause
下面就在实体类上面加上此注解:
@JsonIgnoreProperties(value={"hibernateLazyInitializer","handler","fieldHandler"})
作用在于告诉你的jsonplug组件,在将你的代理对象转换为json对象时,忽略value对应的数组中的属性