Java调接口返回问题

org.springframework.web.client.HttpServerErrorException$InternalServerError:500

这个信息量有点少啊,调用的是什么接口,500 一般都是对接接口参数异常导致,接口对接的话,可以看下请求数据跟接口需要的数据是否一致

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 建议你看下这篇博客👉 :org.springframework.web.client.HttpServerErrorException: 500
  • 除此之外, 这篇博客: springcloud坑之 org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 null中的 springcloud坑之 org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 null 部分也许能够解决你的问题, 你可以仔细阅读以下内容或者直接跳转源博客中阅读:

    今天用springcloud玩了一个微服务,一切都准备就绪,当我用消费方调用生产方的数据时,在消费方的控制台上出现了以下错误信息:

    org.springframework.web.client.HttpServerErrorException$InternalServerError: 500 null

    于是我就按照这个信息在网上找解决方法,但都没有找到。最后我在生产方的控制台上发现了如下错误:

    java.sql.SQLException: The server time zone value ‘�й���׼ʱ��’ is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the ‘serverTimezone’ configuration property) to use a more specifc time zone value if you want to utilize time zone support.

    所以我就按照这个错误信息,在我的数据源的url后面加上了
    ?characterEncoding=utf8&serverTimezone=UTC
    之前是:

    spring:
    datasource:
    url: jdbc:mysql:///mybatis1

    加上之后:

    spring:
    datasource:
    url: jdbc:mysql:///mybatis1?characterEncoding=utf8&serverTimezone=UTC

    最后解决了这个问题!


如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^

500这是接口那里的错误,要么是你的参数传的不合法,要么服务器本身程序有bug