gpt4 book ai didi

java - NoMessageBodyWriterFoundFailure : Could not find MessageBodyWriter for response object of type

转载 作者:塔克拉玛干 更新时间:2023-11-02 19:12:10 26 4
gpt4 key购买 nike

即使 RESTEasy JAXB jar - resteasy-jaxb-provider.jar 捆绑在 WAR 文件中,我也会收到以下错误

04:52:54,461 ERROR [org.jboss.resteasy.core.SynchronousDispatcher] (default task-1) Failed executing GET /editor/getMetadata/com.karthik.editor.model.EditorAuditEditor: o
rg.jboss.resteasy.core.NoMessageBodyWriterFoundFailure: Could not find MessageBodyWriter for response object of type: com.karthik.SerializedStatusTO of media type: app
lication/xml
at org.jboss.resteasy.core.ServerResponse.writeTo(ServerResponse.java:166)
at org.jboss.resteasy.core.SynchronousDispatcher.writeJaxrsResponse(SynchronousDispatcher.java:485)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:422)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:111)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:217)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:159)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

我还在我的 WAR 中包含了 jboss-deployment-structure.xml 以排除 JBoss 提供的模块/jars

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclude-subsystems>
<subsystem name="resteasy" />
</exclude-subsystems>
<exclusions>
<module name="javaee.api" />
<module name="javax.ws.rs.api"/>
<module name="org.jboss.resteasy.resteasy-jaxrs" />
</exclusions>
<local-last value="true" />
</deployment>
</jboss-deployment-structure>

我已经在 J​​Boss 7 EAP 上部署了 WAR。我目前正致力于将我的应用程序从 JBoss 5 迁移到 JBoss 7。没有代码更改并且在 JBoss5 上运行良好。你能帮忙解决 JBOSS 7 上的这个问题吗?

最佳答案

最后,我找到了解决方案。
问题出在子系统名称上。没有名为“resteasy”的子系统,该子系统实际上名为“jaxrs”。
我更新了 jboss-deployment-structure.xml 中的子系统名称,如下所示:

<exclude-subsystems>
<subsystem name="jaxrs" />
</exclude-subsystems>

关于java - NoMessageBodyWriterFoundFailure : Could not find MessageBodyWriter for response object of type,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42716060/

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