当前位置:网站首页>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;
}
}
边栏推荐
- Learn 30 programming languages in 1 minute
- Dart series: generics in dart classes
- How to access the server through the fortress machine? What if the fortress cannot access the server?
- Thorough and thorough analysis of factory method mode
- How to make a ECS into a fortress machine how long does it take to build a fortress machine
- [seckill] new / old users lock in the "explosive seckill zone" and snap up the one-year validity cloud function resource yyds for 63 yuan!
- Embedded hardware development tutorial -- Xilinx vivado HLS case (3)
- Software cost evaluation: a method for estimating software scale by fast function point method
- Stm32g474 infrared receiving based on irtim peripherals
- Railway patrol system - Railway Intelligent Patrol communication system
猜你喜欢

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

layer 3 switch

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

I, a 27 year old female programmer, feel that life is meaningless, not counting the accumulation fund deposit of 430000

Stm32g474 infrared receiving based on irtim peripherals
![[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)

BIM model example
![[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)
随机推荐
Implementing cos signature with postman
Grp: implement GRP timeout interceptor
[new function!] How anycast CLB supports multi location & dynamically accelerated load balancing services and high-speed Internet forwarding!
Global and Chinese dealox industry development status and demand trend forecast report 2022-2028
A review of Nature Neuroscience: dynamic representation in networked nervous system
How to develop the industrial Internet platform?
What is the reason why the switching page group disappears after easycvr establishes a multi-level group?
How to do AI speech synthesis? How to download the voice of AI speech synthesis?
Tke cluster setup linkerd2
[technical grass planting] the cloud driver takes you straight to the clouds
[tcapulusdb knowledge base] how to clean up tables in tcapulusdb table management?
Analysis report on development trends and prospects of China's pyrolytic boron nitride (PBN) component industry 2022-2028
Software cost evaluation: a method for estimating software scale by fast function point method
Embedded hardware development tutorial -- Xilinx vivado HLS case (3)
2021-11-14:Fizz Buzz。 I'll give you an integer n and find the number from 1 to n
SAP WM displays the standard report lx09 of TR item
Moment. JS to UTC format
Tcapulusdb Jun · industry news collection (November 22)
"Cross border" layout photovoltaic circle Green Island wind invested 4.6 million to layout distributed photovoltaic power generation
Easycvr's use of Huawei IVS query directory shared information list interface