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
When using XRay SDK 2.0.1, we see every 5 seconds:
java.lang.NullPointerException: null
at com.amazonaws.xray.handlers.TracingHandler.beforeExecution(TracingHandler.java:138) ~[aws-xray-recorder-sdk-aws-sdk-2.0.1.jar:?]
at com.amazonaws.AmazonWebServiceClient.beforeClientExecution(AmazonWebServiceClient.java:723) ~[aws-java-sdk-core-1.11.398.jar:?]
at com.amazonaws.services.xray.AWSXRayClient.getSamplingRules(AWSXRayClient.java:538) ~[aws-java-sdk-xray-1.11.398.jar:?]
at com.amazonaws.xray.strategy.sampling.pollers.RulePoller.pollRule(RulePoller.java:53) ~[aws-xray-recorder-sdk-core-2.0.1.jar:?]
at com.amazonaws.xray.strategy.sampling.pollers.RulePoller.lambda$start$0(RulePoller.java:41) ~[aws-xray-recorder-sdk-core-2.0.1.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_152]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [?:1.8.0_152]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [?:1.8.0_152]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [?:1.8.0_152]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_152]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_152]
This is caused by the TracingHandler being created when the globalrecorder has not yet finished initialization. Then the recorder of the TracingHandler will be null. See stacktrace below. The globalrecorder is in the process of being created but AWSXray.globalRecorder has not been assigned yet.
When just getting the globalRecorder, you will trigger this problem:
at com.amazonaws.xray.AWSXRay.getGlobalRecorder(AWSXRay.java:28)
at com.amazonaws.xray.handlers.TracingHandler.<init>(TracingHandler.java:94)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-1)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at com.amazonaws.handlers.HandlerChainFactory.createRequestHandler(HandlerChainFactory.java:113)
at com.amazonaws.handlers.HandlerChainFactory.getGlobalHandlers(HandlerChainFactory.java:74)
at com.amazonaws.services.xray.AWSXRayClient.init(AWSXRayClient.java:283)
at com.amazonaws.services.xray.AWSXRayClient.<init>(AWSXRayClient.java:256)
at com.amazonaws.services.xray.AWSXRayClientBuilder.build(AWSXRayClientBuilder.java:61)
at com.amazonaws.services.xray.AWSXRayClientBuilder.build(AWSXRayClientBuilder.java:27)
at com.amazonaws.client.builder.AwsSyncClientBuilder.build(AwsSyncClientBuilder.java:46)
at com.amazonaws.xray.strategy.sampling.XRayClient.newClient(XRayClient.java:31)
at com.amazonaws.xray.strategy.sampling.CentralizedSamplingStrategy.<init>(CentralizedSamplingStrategy.java:40)
at com.amazonaws.xray.strategy.sampling.DefaultSamplingStrategy.<init>(DefaultSamplingStrategy.java:5)
at com.amazonaws.xray.AWSXRayRecorder.<init>(AWSXRayRecorder.java:87)
at com.amazonaws.xray.AWSXRayRecorderBuilder.build(AWSXRayRecorderBuilder.java:145)
at com.amazonaws.xray.AWSXRayRecorderBuilder.defaultRecorder(AWSXRayRecorderBuilder.java:78)
at com.amazonaws.xray.AWSXRay.<clinit>(AWSXRay.java:18)
Setting the samplingStrategy to CentralizedSampling again later, is a workaround.
When using XRay SDK 2.0.1, we see every 5 seconds:
This is caused by the TracingHandler being created when the globalrecorder has not yet finished initialization. Then the recorder of the TracingHandler will be null. See stacktrace below. The globalrecorder is in the process of being created but AWSXray.globalRecorder has not been assigned yet.
When just getting the globalRecorder, you will trigger this problem:
Setting the samplingStrategy to CentralizedSampling again later, is a workaround.
The text was updated successfully, but these errors were encountered: