You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The service service-res doesn't exist or already offline .
val resp = restTemplate.getForEntity("http://service-res/res/api/ms/app", Result::class.java)
The NullPointerException occured:
java.lang.NullPointerException: null
at org.springframework.web.client.DefaultResponseErrorHandler.hasError(DefaultResponseErrorHandler.java:64) ~[spring-web-5.3.5.jar:5.3.5]
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:807) ~[spring-web-5.3.5.jar:5.3.5]
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:777) ~[spring-web-5.3.5.jar:5.3.5]
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:711) ~[spring-web-5.3.5.jar:5.3.5]
at org.springframework.web.client.RestTemplate.getForEntity(RestTemplate.java:361) ~[spring-web-5.3.5.jar:5.3.5]
I trace the class SentinelProtectInterceptor.intercept
found that the exception has be catched and the IllegalStateException is not BlockException, so it do nothing. java.lang.IllegalStateException: No instances available for service-res
I think that sentinel with openfeign work fine, why RestTemplate not,and I saw the SentinelInvocationHandler's process:
I am confused !!!
I configed the SentinelRestTemplatefallbackClass, if can't access the service ,it shouldn't run the method handleFallback?
我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。
We recommend using English. If you are non-native English speaker, you can use the translation software.
Which Component
Sentinel
Describe the bug
The RestTempte configuration:
fallbackClass Configuration:
The service
service-res
doesn't exist or already offline .The
NullPointerException
occured:I trace the class
SentinelProtectInterceptor.intercept
found that the exception has be catched and the
IllegalStateException
is not BlockException, so it do nothing.java.lang.IllegalStateException: No instances available for service-res
I think that
sentinel
withopenfeign
work fine, whyRestTemplate
not,and I saw theSentinelInvocationHandler
's process:I am confused !!!
I configed the
SentinelRestTemplate
fallbackClass
, if can't access the service ,it shouldn't run the methodhandleFallback
?The text was updated successfully, but these errors were encountered: