gpt4 book ai didi

javax.ws.rs.ProcessingException : Unable to find a MessageBodyReader of content-type application/json and type class

转载 作者:行者123 更新时间:2023-12-02 04:37:34 28 4
gpt4 key购买 nike

jboss as 7.1 升级到 wildfly 8.1 时出现错误。

以下是我收到错误的代码。

try {

LOGGER.info("before authenticate {}");

userTO = restEasyPortalServiceProxy.getLoginService().authenticate(userName, userPass);
LOGGER.info("After authenticate : {}", userTO);
userSessionData.setAuthToken(userTO.getAuthToken());

} catch (ResponseProcessingException responseProcessingException) {

ExceptionMessage exceptionMessage = responseProcessingException
.getResponse()
.readEntity(ExceptionMessage.class);

我的jboss-deployment-struct.xml就像在jboss as 7.1

上工作一样
<jboss-deployment-structure>
<deployment>
<exclusions>
<!-- Exclude Version cxf of JBOSS -->
<module name="org.apache.cxf" />
<!-- Exclude JAVA EE of JBOSS (javax.ws..) => Add dependency javax.annotation -->
<module name="javaee.api" />
<!-- Exclude RestEasy conflict (javax.ws.rs.ext.RunDelegate) -->
<module name="javax.ws.rs.api" />
<module name="org.codehaus.jackson.jackson-core-asl" />
<module name="org.jboss.resteasy.resteasy-atom-provider" />
<module name="org.jboss.resteasy.resteasy-cdi" />
<module name="org.jboss.resteasy.resteasy-crypto" />
<!-- <module name="org.jboss.resteasy.resteasy-jackson-provider" /> -->
<module name="org.jboss.resteasy.resteasy-jaxb-provider" />
<module name="org.jboss.resteasy.resteasy-jaxrs" />
<module name="org.jboss.resteasy.resteasy-jettison-provider" />
<module name="org.jboss.resteasy.resteasy-jsapi" />
<module name="org.jboss.resteasy.resteasy-json-p-provider" />
<module name="org.jboss.resteasy.resteasy-multipart-provider" />
<module name="org.jboss.resteasy.resteasy-validator-provider-11" />
<module name="org.jboss.resteasy.resteasy-yaml-provider" />
<module name="org.codehaus.jackson.jackson-core-asl" />
<module name="org.codehaus.jackson.jackson-jaxrs" />
<module name="org.codehaus.jackson.jackson-mapper-asl" />
<module name="org.codehaus.jackson.jackson-xc" />
<module name="org.codehaus.jettison" />
<module name="javax.ws.rs.api" />
</exclusions>
<dependencies>
<module name="org.jboss.resteasy.resteasy-jackson-provider" services="import"/>
</dependencies>
</deployment>

最佳答案

我通过在 META-INF/services/javax.ws.rs.ext.Providers 文件中添加 org.jboss.resteasy.plugins.providers.jackson.ResteasyJacksonProvider 解决了这个问题。

关于javax.ws.rs.ProcessingException : Unable to find a MessageBodyReader of content-type application/json and type class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56543103/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com