我正在尝试使用 Apache CXF DOSGI 在 Karaf 4.0.8 中创建一个 RESTful Web 服务。正在调用该服务,但我收到此错误:没有为类找到消息正文编写器....
欢迎任何建议。谢谢!!!
零件:
@Component(immediate = true, property = {
"service.exported.interfaces=*",
"service.exported.configs=org.apache.cxf.rs",
"org.apache.cxf.rs.provider=com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider",
"org.apache.cxf.rs.address=/integr" })
public class AccountRestService implements AccountWebUserIdResource {
...
}
Interface:
------------
@GET
@Produces({
"application/json"
})
AccountWebUserIdResource.GetAccountByWebUserIdResponse getAccountByWebUserId(
@PathParam("webUserId")
String webUserId,
@QueryParam("sc")
String sc,
@QueryParam("fields")
String fields)
throws Exception
;
实体:
@JsonInclude(JsonInclude.Include.NON_NULL)
@Generated("org.jsonschema2pojo")
@JsonPropertyOrder({
"href",
"crm_member_id",
"email_address",
"account_status"
})
public class Account {
/**
*
* (Required)
*
*/
@JsonProperty("href")
private String href;
/**
*
* (Required)
*
*/
@JsonProperty("crm_member_id")
private String crmMemberId;
/**
*
* (Required)
*
*/
@JsonProperty("email_address")
private String emailAddress;
……