Which AWS SDK modules contain the software.amazon.awssdk.endpoints.EndpointProvider
and software.amazon.awssdk.core.client.config.SdkClientOption
classes in SDK version 2.28.5?
#3152
-
I am attempting to upgrade my team's AWS SDK dependencies from version 2.17.99 to version 2.28.5. However, after upgrading each of the modules my team uses, I get these two exceptions:
I thought maybe looking through the release notes for each major version from 2.18 to 2.28 might help me identify how the classes were reorganized into different modules. However, the only release notes I found that talked about refactors to modules was the 2.26.0 release notes, which did not talk about either of these two classes. Could someone please help me identify which modules now contain the Stack traces
```
java.lang.NoClassDefFoundError: software/amazon/awssdk/endpoints/EndpointProvider
at software.amazon.awssdk.core.client.config.SdkClientOption.(SdkClientOption.java:282)
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.httpClient(SdkDefaultClientBuilder.java:581)
at software.amazon.awssdk.services.iot.DefaultIotClientBuilder.httpClient(DefaultIotClientBuilder.java:25)
at com.redacted.detectionengine.HandlerFirehose.sendIotRequest(HandlerFirehose.java:293)
at com.redacted.detectionengine.HandlerFirehose.sendNewConfigs(HandlerFirehose.java:375)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at com.redacted.detectionengine.HandlerFirehose.sendNewConfigs(HandlerFirehose.java:363)
at com.redacted.detectionengine.HandlerFirehose.handleRequest(HandlerFirehose.java:157)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at com.redacted.detectionengine.HandlerFirehose.handleRequest(HandlerFirehose.java:112)
at tests.TestLambda.testLambdaDiscardedMetric(TestLambda.java:315)
... 32 trimmed
Caused by: java.lang.ClassNotFoundException: software.amazon.awssdk.endpoints.EndpointProvider
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:527)
at software.amazon.awssdk.core.client.config.SdkClientOption.(SdkClientOption.java:282)
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.httpClient(SdkDefaultClientBuilder.java:581)
at software.amazon.awssdk.services.iot.DefaultIotClientBuilder.httpClient(DefaultIotClientBuilder.java:25)
at com.redacted.detectionengine.HandlerFirehose.sendIotRequest(HandlerFirehose.java:297)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at org.mockito.internal.util.reflection.InstrumentationMemberAccessor$Dispatcher$ByteBuddy$U75cLH2s.invokeWithArguments(Unknown Source)
at org.mockito.internal.util.reflection.InstrumentationMemberAccessor.invoke(InstrumentationMemberAccessor.java:230)
at org.mockito.internal.util.reflection.ModuleMemberAccessor.invoke(ModuleMemberAccessor.java:43)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.tryInvoke(MockMethodAdvice.java:329)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.access$500(MockMethodAdvice.java:56)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice$RealMethodCall.invoke(MockMethodAdvice.java:249)
at org.mockito.internal.invocation.InterceptedInvocation.callRealMethod(InterceptedInvocation.java:141)
at org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:44)
at org.mockito.Answers.answer(Answers.java:98)
at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:106)
at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:33)
at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:82)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.handle(MockMethodAdvice.java:147)
at com.redacted.detectionengine.HandlerFirehose.sendIotRequest(HandlerFirehose.java:293)
at com.redacted.detectionengine.HandlerFirehose.sendNewConfigs(HandlerFirehose.java:375)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at org.mockito.internal.util.reflection.InstrumentationMemberAccessor$Dispatcher$ByteBuddy$U75cLH2s.invokeWithArguments(Unknown Source)
at org.mockito.internal.util.reflection.InstrumentationMemberAccessor.invoke(InstrumentationMemberAccessor.java:230)
at org.mockito.internal.util.reflection.ModuleMemberAccessor.invoke(ModuleMemberAccessor.java:43)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.tryInvoke(MockMethodAdvice.java:329)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.access$500(MockMethodAdvice.java:56)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice$RealMethodCall.invoke(MockMethodAdvice.java:249)
at org.mockito.internal.invocation.InterceptedInvocation.callRealMethod(InterceptedInvocation.java:141)
at org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:44)
at org.mockito.Answers.answer(Answers.java:98)
at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:106)
at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:33)
at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:82)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.handle(MockMethodAdvice.java:147)
at com.redacted.detectionengine.HandlerFirehose.sendNewConfigs(HandlerFirehose.java:363)
at com.redacted.detectionengine.HandlerFirehose.handleRequest(HandlerFirehose.java:157)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at org.mockito.internal.util.reflection.InstrumentationMemberAccessor$Dispatcher$ByteBuddy$U75cLH2s.invokeWithArguments(Unknown Source)
at org.mockito.internal.util.reflection.InstrumentationMemberAccessor.invoke(InstrumentationMemberAccessor.java:230)
at org.mockito.internal.util.reflection.ModuleMemberAccessor.invoke(ModuleMemberAccessor.java:43)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.tryInvoke(MockMethodAdvice.java:329)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.access$500(MockMethodAdvice.java:56)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice$RealMethodCall.invoke(MockMethodAdvice.java:249)
at org.mockito.internal.invocation.InterceptedInvocation.callRealMethod(InterceptedInvocation.java:141)
at org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:44)
at org.mockito.Answers.answer(Answers.java:98)
at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:106)
at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:33)
at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:82)
at org.mockito.internal.creation.bytebuddy.MockMethodAdvice.handle(MockMethodAdvice.java:147)
... 35 more
```
```
java.lang.NoClassDefFoundError: Could not initialize class software.amazon.awssdk.core.client.config.SdkClientOption
at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.httpClient(SdkDefaultClientBuilder.java:581)
at software.amazon.awssdk.services.iot.DefaultIotClientBuilder.httpClient(DefaultIotClientBuilder.java:25)
at com.redacted.detectionengine.HandlerFirehose.sendIotRequest(HandlerFirehose.java:293)
at com.redacted.detectionengine.HandlerFirehose.sendNewConfigs(HandlerFirehose.java:375)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at com.redacted.detectionengine.HandlerFirehose.sendNewConfigs(HandlerFirehose.java:363)
at com.redacted.detectionengine.HandlerFirehose.handleRequest(HandlerFirehose.java:157)
at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
at com.redacted.detectionengine.HandlerFirehose.handleRequest(HandlerFirehose.java:112)
at tests.TestLambda.testLambdaException(TestLambda.java:349)
```
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The release notes won't go into much detail about code refactoring in general. To answer your question: But the easiest way to troubleshoot ClassNotFound exceptions is to check which SDK module is in a different version than the rest, you can print the dependency tree and check for any mismatched versions - you can find instructions in our Troubleshooting guide: How do I fix a NoClassDefFoundError, NoSuchMethodError or NoSuchFieldError? All SDK modules should be in the same version. As the troubleshooting guide mentions, you can use the BOM artifact to facilitate this. |
Beta Was this translation helpful? Give feedback.
The release notes won't go into much detail about code refactoring in general.
To answer your question:
software.amazon.awssdk.endpoints.EndpointProvider
is insoftware.amazon.awssdk:endpoints-spi
, andsoftware.amazon.awssdk.core.client.config.SdkClientOption
is insoftware.amazon.awssdk:sdk-core
.But the easiest way to troubleshoot ClassNotFound exceptions is to check which SDK module is in a different version than the rest, you can print the dependency tree and check for any mismatched versions - you can find instructions in our Troubleshooting guide:
How do I fix a NoClassDefFoundError, NoSuchMethodError or NoSuchFieldError?
All SDK modules should be in the same version. As the trouble…