当前位置:网站首页>No serializer found for class ** and no propert no properties discovered to create BeanSerializer
No serializer found for class ** and no propert no properties discovered to create BeanSerializer
2022-06-24 01:56:00 【CrystalLightGhost】
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class priv.crystallightghost.frscommunity.respond.PagerResult and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: priv.crystallightghost.frscommunity.respond.Result["data"])
at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77)
at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1191)
at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:313)
at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:71)
at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:33)
at com.fasterxml.jackson.databind.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:727)
at com.fasterxml.jackson.databind.ser.std.BeanSerializerBase.serializeFields(BeanSerializerBase.java:719)
at com.fasterxml.jackson.databind.ser.BeanSerializer.serialize(BeanSerializer.java:155)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1396)
at com.fasterxml.jackson.databind.ObjectWriter.writeValue(ObjectWriter.java:913)
at org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter.writeInternal(AbstractJackson2HttpMessageConverter.java:291)
... 66 more
Display such an error :
No serializer found for class ** and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: priv.crystallightghost.frscommunity.respond.Result["data"])
The cause of the error
This is because the entity class is in json It is necessary to use get** Method
So create for each attribute in the entity class that needs to be transformed pulic Of get Method
Or use Lomk Annotate in the entity class @Data Method
Example :
// Add this note
@Data
public class PagerResult {
private Object object;
private Boolean hasNext;
public PagerResult(Object object, Boolean hasNext) {
this.object = object;
this.hasNext = hasNext;
}
}
Or add... Manually
public class PagerResult {
private Object object;
private Boolean hasNext;
public PagerResult(Object object, Boolean hasNext) {
this.object = object;
this.hasNext = hasNext;
}
public Object getObject() {
return object;
}
public void setObject(Object object) {
this.object = object;
}
public Boolean getHasNext() {
return hasNext;
}
public void setHasNext(Boolean hasNext) {
this.hasNext = hasNext;
}
}
边栏推荐
- Devops learning notes (II)
- Detailed explanation of SSH tunnel and stable intranet penetration using autossh
- 5、 Array base
- How to restart the server through the fortress machine how to log in to the fortress machine
- From idea to finished product, the necessary process of APP product development
- Thoroughly explain the details of the simple factory that you haven't paid attention to
- Gin framework: implementing service end flow limiting Middleware
- "Cross border" layout photovoltaic circle Green Island wind invested 4.6 million to layout distributed photovoltaic power generation
- Super parameter tuning of neural network using keras tuner
- Summary of various situations in which easycvr cannot use voice intercom function
猜你喜欢

Review of AI hotspots this week: the Gan compression method consumes less than 1/9 of the computing power, and the open source generator turns your photos into hand drawn photos

It's too difficult for me. Ali has had 7 rounds of interviews (5 years of experience and won the offer of P7 post)

layer 3 switch

I, a 27 year old female programmer, feel that life is meaningless, not counting the accumulation fund deposit of 430000
![[SQL injection 12] user agent injection foundation and Practice (based on burpsuite tool and sqli labs LESS18 target machine platform)](/img/c8/f6c2a62b8ab8fa88bd2b3d8f35f592.jpg)
[SQL injection 12] user agent injection foundation and Practice (based on burpsuite tool and sqli labs LESS18 target machine platform)

Stm32g474 infrared receiving based on irtim peripherals
![[SQL injection 13] referer injection foundation and Practice (based on burpseuite tool and sqli labs less19 target platform)](/img/b5/a8c4bbaf868dd20b7dc9449d2a4378.jpg)
[SQL injection 13] referer injection foundation and Practice (based on burpseuite tool and sqli labs less19 target platform)

BIM model example
随机推荐
How to set up AI speech synthesis? What is the function of speech synthesis?
Make standardized tools in the cloud native era to realize efficient cloud R & D workflow
Why do cloud desktops use rack servers? What are the functions of cloud desktop?
[technical grass planting] how to batch check your server status? Cloud probe panel setup tutorial
Collation of commonly used glusterfs commands
Grpc: implement grpc proxy
Build and enable all plug-ins of kubesphere high availability cluster
It's too difficult for me. Ali has had 7 rounds of interviews (5 years of experience and won the offer of P7 post)
[read together] Web penetration attack and defense practice (I)
Five things programmers need to consider when developing with low code – thenewstack
[actual combat] how to realize people nearby through PostGIS
Why promote steam education?
Tcapulusdb Jun · industry news collection
2021-11-10:o (1) time inserts, deletes and obtains random elements. Implement ra
Typescript is a weak type
[SQL injection 13] referer injection foundation and Practice (based on burpseuite tool and sqli labs less19 target platform)
Global and Chinese gallium industry market panoramic survey and investment strategy proposal report 2022-2028
How about speech synthesis? Is speech synthesis effective?
layer 3 switch
[new function!] How anycast CLB supports multi location & dynamically accelerated load balancing services and high-speed Internet forwarding!