apache / servicecomb-samples

Apache servicecomb
https://servicecomb.apache.org/
Apache License 2.0
503 stars 145 forks source link

springmvc-sample示例程序运行失败 #106

Open xuezechao1 opened 1 year ago

xuezechao1 commented 1 year ago

下载servicecomb-samples代码后,参考https://github.com/apache/servicecomb-samples/tree/master/java-chassis-samples/springmvc-sample教程运行providerconsumerconsumer运行失败,报错如下所示:

Exception in thread "main" InvocationException: code=405;msg=CommonExceptionData [message=method POST, path /springmvchello/sayhi/, statusCode 405, reasonPhrase Method Not Allowed, response content-type text/html;charset=iso-8859-1 is not supported]
    at org.apache.servicecomb.transport.rest.client.http.DefaultHttpClientFilter.extractResponse(DefaultHttpClientFilter.java:126)
    at org.apache.servicecomb.transport.rest.client.http.DefaultHttpClientFilter.afterReceiveResponse(DefaultHttpClientFilter.java:133)
    at org.apache.servicecomb.transport.rest.client.http.RestClientInvocation.lambda$processResponseBody$6(RestClientInvocation.java:240)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
 at [Source: (org.apache.servicecomb.foundation.vertx.stream.BufferInputStream); line: 1, column: 2]
    at com.fasterxml.jackson.core.JsonParser._constructError(JsonParser.java:2337)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportError(ParserMinimalBase.java:710)
    at com.fasterxml.jackson.core.base.ParserMinimalBase._reportUnexpectedChar(ParserMinimalBase.java:635)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._handleUnexpectedValue(UTF8StreamJsonParser.java:2691)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:870)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:762)
    at com.fasterxml.jackson.databind.ObjectMapper._initForReading(ObjectMapper.java:4684)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4586)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3601)
    at org.apache.servicecomb.common.rest.codec.produce.ProduceJsonProcessor.doDecodeResponse(ProduceJsonProcessor.java:64)
    at org.apache.servicecomb.common.rest.codec.produce.ProduceProcessor.decodeResponse(ProduceProcessor.java:76)
    at org.apache.servicecomb.transport.rest.client.http.DefaultHttpClientFilter.extractResponse(DefaultHttpClientFilter.java:104)
    ... 7 more
liubao68 commented 1 year ago

感觉 provider 端口被其他服务占用, 没启动成功的样子。

xuezechao1 commented 1 year ago

感觉 provider 端口被其他服务占用, 没启动成功的样子。

provider没报错,查看注册中心provider也已经注册上了。

xuezechao1 commented 1 year ago

感觉 provider 端口被其他服务占用, 没启动成功的样子。

更换端口后,还是会报同样的错误