org.glassfish.jersey.message.internal.messagebodyprovidernotfoundexception:未找到媒体类型为text/html的messagebodyreader;字符集=utf-8

epfja78i  于 2021-06-30  发布在  Java
关注(0)|答案(0)|浏览(263)

我们的休息服务一直到昨天都很好。weblogic12中突然出现了下面的错误
org.glassfish.jersey.message.internal.messagebodyprovidernotfoundexception:未找到媒体类型为text/html的messagebodyreader;charset=utf-8,type=class com.test.createusecaseapprovalresponse
clientconfigapi.java代码如下

public <T> Response doPostService(T request, String path) {

            try {
            RequestAttributes requestAttributes = RequestContextHolder.currentRequestAttributes();
            ServletRequestAttributes attributes = (ServletRequestAttributes) requestAttributes;
            HttpServletRequest servletRequest = attributes.getRequest();
            HttpSession httpSession = servletRequest.getSession(false);  
            LoginResponse loginResponse = (LoginResponse) httpSession.getAttribute(Constants.CONST_USER_DTLS);
            Long userId = loginResponse.getUserDetails().getId();
            headerMap.put("userId", userId);
            }
            catch(Exception e)
            {
                //
            }

        Response response = getInvocationBuilder(path).post(Entity.entity(request, MediaType.APPLICATION_JSON));
        if(response.getStatus() == 401)
            {loginRedirect(response);}

        return response;
    }

usecasecontrollerimpl.java文件

public CreateUseCaseApprovalResponse createUseCaseApproval(CreateUseCaseApprovalRequest request) {
        logger.info("Entering createUseCaseApproval method in useCaseApprvalController");
        CreateUseCaseApprovalResponse createUseCaseApprovalResponse = null;
        Response apiResponse = clientApiConfig.doPostService(request,createUseCaseApprovalsUrl);
        createUseCaseApprovalResponse = apiResponse.readEntity(CreateUseCaseApprovalResponse.class);
        logger.info("Exiting createUseCaseApproval method in UseCaseApprvalController");
        return createUseCaseApprovalResponse;
    }

我们尝试了添加jersey jar,添加构造函数。但这个错误仍然没有解决。我是weblogic的新手,请指导我如何解决此错误

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题