当前位置:网站首页>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;
}
}
边栏推荐
- LeetCode 1289. Descent path min and II
- What is the relationship between cloud desktop and cloud server? How to understand the relationship between the two
- Tke cluster setup linkerd2
- How to create a group on a barcode label
- [new function!] How anycast CLB supports multi location & dynamically accelerated load balancing services and high-speed Internet forwarding!
- 4-data persistence and shared interconnection
- Thoroughly explain the details of the simple factory that you haven't paid attention to
- Easycvr connects with Huawei IVS platform to query the foreign domain list interface definition and use sharing
- How to use the speech synthesis tool? Does the speech synthesis tool cost money?
- Disruptor note 2: disruptor class analysis
猜你喜欢

Stm32g474 infrared receiving based on irtim peripherals

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

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

I, a 27 year old female programmer, feel that life is meaningless, not counting the accumulation fund deposit of 430000
![[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

layer 3 switch
![[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)
随机推荐
Logistics industry supplier collaborative management platform supplier life cycle management to optimize logistics costs
Five things programmers need to consider when developing with low code – thenewstack
[tcapulusdb knowledge base] how to rebuild tables in tcapulusdb table management?
Oracle sqlldr quick import and sqluldr2 quick export
[actual combat] how to realize people nearby through PostGIS
November 15, 2021: add four numbers II. Here are four integer arrays nums1, num
SAP mm maintains inter company sto error -no delivery type defined for supplying
[JS reverse hundred examples] md5+aes encryption analysis of an easy payment password
How does the education industry realize the TRTC interactive classroom apaas solution under the "double reduction policy"?
Tcapulusdb database: the king behind the "Tianya Mingyue swordsman Tour"
Grpc: implement grpc proxy
How to confirm whether IPv6 is enabled for a website
What is the difference between code signing certificates? What is the use of code signing certificates?
[tcapulusdb knowledge base] how does tcapulusdb add a business cluster cluster?
Blog platform was falsely blackmailed and the new hacker organization claimed responsibility for the Israeli attack | November 16 global network security hotspot
Moment. JS to UTC format
[tcapulusdb knowledge base] how to delete a table in tcapulusdb table management?
Global and Chinese micro focus X-ray tube industry competitiveness analysis and Investment Strategy Research Report 2022-2028
Tcapulusdb Jun · industry news collection
[tcapulusdb knowledge base] common problems of tcapulusdb local deployment