当前位置:网站首页>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;
}
}
边栏推荐
- What does fortress server mean? What are the benefits of Fortress server installation
- Query report of each mic quality inspection result on SAP QM inspection lot?
- Super parameter tuning of neural network using keras tuner
- 5、 Array base
- 5、 Build freestyle projects and related knowledge
- [technical grass planting] the cloud driver takes you straight to the clouds
- Ppt layout design how to make pages not messy
- Summary of various situations in which easycvr cannot use voice intercom function
- Practical case - Tencent security hosting service MSS helped "zero accident" during the period of digital Guangdong re insurance!
- Global and Chinese micro focus X-ray tube industry competitiveness analysis and Investment Strategy Research Report 2022-2028
猜你喜欢

BIM model example

layer 3 switch

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)
![[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)

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 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)
随机推荐
Thoroughly explain the details of the simple factory that you haven't paid attention to
My eight year relationship with the message queue
What is the reason why the switching page group disappears after easycvr establishes a multi-level group?
Intensive use of glusterfs 4.1
LeetCode 1289. Descent path min and II
Disruptor note 2: disruptor class analysis
How to do AI speech synthesis? How to download the voice of AI speech synthesis?
Ppt layout design how to make pages not messy
Baysor: cell segmentation in imaging based spatial transcriptomics
[technical grass planting] look what I did with my server!
Tcapulusdb Jun · industry news collection
How does the education industry realize the TRTC interactive classroom apaas solution under the "double reduction policy"?
Embedded hardware development tutorial -- Xilinx vivado HLS case (2)
Typescript is a weak type
A marriage app_ T signature analysis
What is the relationship between cloud desktop and cloud server? How to understand the relationship between the two
How to use the speech synthesis assistant? Does speech synthesis cost money?
Gin framework: implementing service end flow limiting Middleware
tokio_ Rustls self signed certificate
Implementing cos signature with postman