Bean Config
Код: Выделить всё
@Configuration
public class JsonProviderConfig {
@Bean
public JacksonJsonProvider jacksonJsonProvider() {
return new JacksonJsonProvider();
}
Код: Выделить всё
private CxfClientModel createResourceClientModule(Conn conn) {
return super.createClientModel(conn)
.builder()
.setProviders(Arrays.asList(jsonProvider))
.setLogging(Logging.base().builder()
.setLogging(true)
.setInInterceptors(Arrays.asList(new LoggingInInterceptor()))
.setOutInterceptors(Arrays.asList(new LoggingOutInterceptor()))
.build())
.build();
}
Код: Выделить всё
public class Request {
@JsonProperty
private String id;
@JsonProperty
private String key;
@JsonProperty
private String reference;
@JsonProperty
private final List encrypted;
public Request() {
}
}
Код: Выделить всё
public class Response {
@JsonProperty
private Boolean success;
@JsonProperty
private String reference;
@JsonProperty
private String messageId;
@JsonProperty
private List decrypted;
public Response() {
}
}
Код: Выделить всё
org.apache.cxf.jaxrs.utils.JAXRSUtils : No message body writer has been found for class Request, ContentType: application/json
o.a.cxf.phase.PhaseInterceptorChain : Interceptor for {http://connector/}Resource has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: No message body writer has been found for class Request, ContentType: application/json
at org.apache.cxf.jaxrs.client.ClientProxyImpl$BodyWriter.doWriteBody(ClientProxyImpl.java:1142)
at org.apache.cxf.jaxrs.client.AbstractClient$AbstractBodyWriter.handleMessage(AbstractClient.java:1223)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
at org.apache.cxf.jaxrs.client.AbstractClient.doRunInterceptorChain(AbstractClient.java:710)
at org.apache.cxf.jaxrs.client.ClientProxyImpl.doChainedInvocation(ClientProxyImpl.java:925)
at org.apache.cxf.jaxrs.client.ClientProxyImpl.invoke(ClientProxyImpl.java:348)
at jdk.proxy2/jdk.proxy2.$Proxy451.decrypt(Unknown Source)
Подробнее здесь: https://stackoverflow.com/questions/792 ... -cxfclient
Мобильная версия