使用Spring-Boot在http中返回jax-rs响应时出错

问题描述 投票:0回答:1

我正在使用带有cxf 3.4.4的spring-boot 2.2得到错误“找不到类的消息正文编写器:类x.y.z.Test”

[ERROR] - No message body writer found for class : class x.y.z.Test. (CachingMessageBodyWriter.java:getWriter:89)
[ERROR] - Problem with writing the data, class x.y.z.Test, ContentType: application/json (JAXRSUtils.java:logMessageHandlerProblem:1864)
[WARN] - javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
at 

提前感谢

spring-boot jax-rs cxf
1个回答
0
投票

我已经解决了这个问题。我在Spring Boot 2.2中使用CXF jaxrs。我没有在cxf.jaxrs.classes-scan-packages中扫描JsonJacksonProvider,所以只添加了完整路径。

© www.soinside.com 2019 - 2024. All rights reserved.