ssm框架整合CXF框架,接口调用报org.apache.cxf.jaxrs.utils.JAXRSUtils.logMessageHandlerProblem No message body reader has been found for class com.fox.entity.UserVO, ContentType: application/json

图片说明
实在找不到什么原因了,请大神帮帮忙指点下,刚搭的环境,初来没有币可悬赏,谢谢

POM.xml
  <!--CXF web service框架依赖-->
      <dependency>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-core</artifactId>
          <version>3.1.11</version>
      </dependency>
      <!-- cxf 进行rs开发 必须导入  -->
      <dependency>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-rt-frontend-jaxrs</artifactId>
          <version>3.1.11</version>
      </dependency>
      <!-- 客户端 -->
      <dependency>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-rt-rs-client</artifactId>
          <version>3.1.11</version>
      </dependency>
      <dependency>
          <groupId>org.codehaus.jackson</groupId>
          <artifactId>jackson-jaxrs</artifactId>
          <version>1.9.13</version>
      </dependency>
      <!--<dependency>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-rt-rs-extension-providers</artifactId>
          <version>3.1.17</version>
      </dependency>-->
      <dependency>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-rt-transports-http</artifactId>
          <version>3.1.11</version>
      </dependency>
web.xml
<!--设置配置文件的路径-->
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath:applicationContext.xml,classpath:springMVC.xml,classpath:com/fox/services/resources/services-config.xml</param-value>
  </context-param>
    <!--配置Spring的监听器,默认只加载WEB-INF目录下的applicationContext.xml配置文件-->
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
    </listener>

  <!--配置前端控制器-->
  <servlet>
    <servlet-name>dispatcherServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <!--加载springmvc.xml配置文件-->
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:springMVC.xml</param-value>
    </init-param>
    <!--启动服务器,创建该servlet-->
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>dispatcherServlet</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>CXFServlet</servlet-name>
    <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
    <!--<load-on-startup>1</load-on-startup>-->
    <!--<init-param>
      <param-name>config-location</param-name>
      <param-value>classpath*:services-config.xml</param-value>
    </init-param>-->
  </servlet>
  <servlet-mapping>
    <servlet-name>CXFServlet</servlet-name>
    <url-pattern>/webservice/*</url-pattern>
  </servlet-mapping>
  <!--解决中文乱码的过滤器-->
  <filter>
    <filter-name>characterEncodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>characterEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

接口
package com.fox.services;

import com.fox.entity.UserVO;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import java.util.List;

@Path("/user")
@Produces({MediaType.APPLICATION_JSON})
public interface IUser {

@POST
@Path("/queryUser")
@Consumes({MediaType.APPLICATION_JSON})
public List<UserVO> queryUser(UserVO userVO) throws Exception;

}

1个回答

qq_30885871
qq_30885871 并不是同个问题,试过了
3 个月之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问