简体   繁体   English

找不到响应类ArrayList [jboss 7]的消息正文编写器

[英]No message body writer has been found for response class ArrayList [jboss 7]

Our application with restful services are working fine on jboss 6, after upgrading to jboss 7, none of the rest services are working. 我们的带有静态服务的应用程序在jboss 6上可以正常运行,升级到jboss 7后,其余的服务都无法正常工作。

Exception we encountered is http 500 internal server error: 我们遇到的异常是http 500内部服务器错误:

One of the restful service error is:
    INFO  - HTTP Status Code: 500
    INFO  - Web Service call execution: 1410 ms.
    INFO  - Content-Length: null
    INFO  - Content-Type: text/plain
    INFO  - Message-Body: **No message body writer has been found for response class ArrayList.**

application has the following dependencies. 应用程序具有以下依赖性。

<dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-bundle-jaxrs</artifactId>
            <version>2.7.8</version>
            <exclusions>
                <exclusion>
                    <groupId>com.sun.xml.bind</groupId>
                    <artifactId>jaxb-impl</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>javax.ws.rs</groupId>
                    <artifactId>javax.ws.rs-api</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
   <dependency>
            <groupId>javax.ws.rs</groupId>
            <artifactId>javax.ws.rs-api</artifactId>
            <version>2.0</version>
        </dependency>

After analysis I found that the jboss has rest easy api which is conflicting with cxf libraries. 经过分析,我发现jboss具有rest easy api,它与cxf库冲突。

I tried lot of options available on the web to exclude resteasy, but it didnt help. 我尝试了网络上提供的许多选项来消除烦恼,但这并没有帮助。

how to exclude the jboss embedded libraries rest easy and other rest components to force jboss to use the application libraries? 如何排除jboss嵌入式库rest easy和其他rest组件来迫使jboss使用应用程序库?

I found excluding the jaxrs sub system as a whole in jboss 7 helped me to force jboss to rely on my application provided cxf and javax.ws.rs-api libraries. 我发现在jboss 7中将整个jaxrs子系统排除在外有助于我迫使jboss依靠我的应用程序提供的cxf和javax.ws.rs-api库。

I have added the file jboss-deployment-structure.xml shown below to war file to exclude jaxrs sub system. 我将以下所示的文件jboss-deployment-structure.xml添加到war文件中以排除jaxrs子系统。

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
    <deployment>
        <exclude-subsystems>
            <subsystem name="jaxrs" />
        </exclude-subsystems>
    </deployment>
</jboss-deployment-structure>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 未找到响应类 ArrayList 的消息正文编写器 - No message body writer has been found for response class ArrayList 在restfulcxf中未找到响应的消息正文编写器 - No message body writer has been found for response in restfulcxf 访问服务时,未找到响应类别的消息正文编写器 - No message body writer has been found for response class when accessing the service Apache CXF作为Restful API的客户端-找不到该类的消息正文编写器 - Apache CXF as Client for restful API - No message body writer has been found for class 严重:未找到 class java.util.Vector 的消息正文编写器,ContentType:application/xml - SEVERE: No message body writer has been found for class java.util.Vector, ContentType: application/xml 找不到Java类的消息正文编写器 - A message body writer for Java class not found 没有为MultipartBody,multipart / form-data找到消息正文编写器 - No message body writer has been found for MultipartBody, multipart/form-data 在osgi中使用带有cxf的jackson提供程序(未找到消息正文编写器) - Using jackson provider with cxf in osgi (no message body writer has been found) 找不到Java类型类java.util.ArrayList和MIME媒体类型application / xml的消息正文编写器 - A message body writer for Java type, class java.util.ArrayList, and MIME media type, application/xml, was not found 找不到Java类java.util.ArrayList和MIME媒体类型application / json的消息正文编写器 - A message body writer for Java class java.util.ArrayList and MIME media type application/json was not found
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM