Closed qinchunabng closed 3 years ago
Hi, @qinchunabng, I wasn't able to reproduce the issue on my end. Could you add a minimal sample that reproduces this issue?
Also, what triggers this exception? Is it on application start or later?
Hi, @qinchunabng, I wasn't able to reproduce the issue on my end. Could you add a minimal sample that reproduces this issue?
Also, what triggers this exception? Is it on application start or later?
You can use this sample to reproduce this issue. It happens after application starts. When I sent a request to "/test/time", the exception triggered.
Thanks for getting back to me @qinchunabng. Unfortunately, even with the sample I am not seeing the issue. Sending a request to "/test/time" returns the current time as expected.
Which Java version and OS are you running on?
Perhaps you can start with a fresh project from start.spring.io and add the dependencies one by one to see which one causes the error you are seeing.
Thanks for your reply @eleftherias . I found this problem when I upgraded the springcloud version of my project. I removed the dependency one by one, and finally I found if I removed the spring-cloud-starter-sleuth dependency, the exception wouldn't be occured.
So I suppose if it is incompatible with this spring session version. And I find this problem only triggers with redis cluster mode.If it is standalone mode, it won't be happened too.
My java version is 1.8. My OS is win10.
Thanks for pointing out that the sample uses redis cluster mode. I can see the error now.
When I remove the Spring Session dependency and run the application using just Sleuth and Spring Data Redis, I see the same error in the /test/setHash/ endpoint. Is that what you see as well?
Yes. And I find if I disable sleuth config for redis. This error won't happen.
Thanks for sharing the workaround @qinchunabng. I will go ahead and close this issue since it occurs even when Spring Session is not in the picture. Feel free to open an issue with Spring Data Redis if you are still having trouble.
Use spring session with redis, when then project has dependency with spring-cloud-starter-sleuth. It will throw NullPointerException.
Here is the exception information:
My Springboot version is 2.3.8.RELEASE. My springcloud version is Hoxton.SR10. I haven't found how to fix it.