Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Application fails to start after configuring Parameter Store #1014

Closed
alo-id opened this issue Jan 9, 2024 · 2 comments
Closed

Application fails to start after configuring Parameter Store #1014

alo-id opened this issue Jan 9, 2024 · 2 comments

Comments

@alo-id
Copy link

alo-id commented Jan 9, 2024

Type: Bug

Component:
Parameter Store

Describe the bug
Application failed to start when trying to use the parameter store.

Sample
Pom snippet:

  <dependency>
      <groupId>io.awspring.cloud</groupId>
      <artifactId>spring-cloud-aws-starter</artifactId>
  </dependency>
  <dependency>
      <groupId>io.awspring.cloud</groupId>
      <artifactId>spring-cloud-aws-starter-parameter-store</artifactId>
  </dependency>
  <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>sts</artifactId>
  </dependency>
  <dependency>
      <groupId>software.amazon.awssdk</groupId>
      <artifactId>s3</artifactId>
  </dependency>

Log output:

6:25:35.634 [main] ERROR org.springframework.boot.SpringApplication -- Application run failed
java.lang.NoClassDefFoundError: org/apache/http/impl/client/DefaultClientConnectionReuseStrategy
 at java.base/java.lang.ClassLoader.defineClass1(Native Method)
 at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1027)
 at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
 at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:862)
 at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:760)
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:681)
 at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:639)
 at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
 at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
 at software.amazon.awssdk.http.apache.ApacheHttpClient.createClient(ApacheHttpClient.java:159)
 at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:125)
 at software.amazon.awssdk.http.apache.ApacheHttpClient.<init>(ApacheHttpClient.java:104)
 at software.amazon.awssdk.http.apache.ApacheHttpClient$DefaultBuilder.buildWithDefaults(ApacheHttpClient.java:649)
 at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder.lambda$buildWithDefaults$0(DefaultSdkHttpClientBuilder.java:42)
 at java.base/java.util.Optional.map(Optional.java:260)
 at software.amazon.awssdk.core.internal.http.loader.DefaultSdkHttpClientBuilder.buildWithDefaults(DefaultSdkHttpClientBuilder.java:42)
 at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.lambda$resolveSyncHttpClient$7(SdkDefaultClientBuilder.java:450)
 at java.base/java.util.Optional.orElseGet(Optional.java:364)
 at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.resolveSyncHttpClient(SdkDefaultClientBuilder.java:450)
 at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.finalizeSyncConfiguration(SdkDefaultClientBuilder.java:380)
 at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.syncClientConfiguration(SdkDefaultClientBuilder.java:194)
 at software.amazon.awssdk.services.sts.DefaultStsClientBuilder.buildClient(DefaultStsClientBuilder.java:38)
 at software.amazon.awssdk.services.sts.DefaultStsClientBuilder.buildClient(DefaultStsClientBuilder.java:27)
 at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build(SdkDefaultClientBuilder.java:157)
 at io.awspring.cloud.autoconfigure.core.CredentialsProviderAutoConfiguration$StsCredentialsProviderFactory.create(CredentialsProviderAutoConfiguration.java:137)
 at io.awspring.cloud.autoconfigure.core.CredentialsProviderAutoConfiguration.createCredentialsProvider(CredentialsProviderAutoConfiguration.java:93)
 at io.awspring.cloud.autoconfigure.config.AbstractAwsConfigDataLocationResolver.configure(AbstractAwsConfigDataLocationResolver.java:139)
 at io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStoreConfigDataLocationResolver.createSimpleSystemManagementClient(ParameterStoreConfigDataLocationResolver.java:88)
 at org.springframework.boot.DefaultBootstrapContext.getInstance(DefaultBootstrapContext.java:119)
 at org.springframework.boot.DefaultBootstrapContext.getOrElseThrow(DefaultBootstrapContext.java:111)
 at org.springframework.boot.DefaultBootstrapContext.get(DefaultBootstrapContext.java:88)
 at io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStoreConfigDataLoader.load(ParameterStoreConfigDataLoader.java:48)
 at io.awspring.cloud.autoconfigure.config.parameterstore.ParameterStoreConfigDataLoader.load(ParameterStoreConfigDataLoader.java:36)
 at org.springframework.boot.context.config.ConfigDataLoaders.load(ConfigDataLoaders.java:96)
 at org.springframework.boot.context.config.ConfigDataImporter.load(ConfigDataImporter.java:132)
 at org.springframework.boot.context.config.ConfigDataImporter.resolveAndLoad(ConfigDataImporter.java:87)
 at org.springframework.boot.context.config.ConfigDataEnvironmentContributors.withProcessedImports(ConfigDataEnvironmentContributors.java:115)
 at org.springframework.boot.context.config.ConfigDataEnvironment.processWithProfiles(ConfigDataEnvironment.java:313)
 at org.springframework.boot.context.config.ConfigDataEnvironment.processAndApply(ConfigDataEnvironment.java:234)
 at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:96)
 at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89)
 at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:109)
 at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:94)
 at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:174)
 at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:167)
 at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:145)
 at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:133)
 at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136)
 at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:81)
 at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:64)
 at java.base/java.lang.Iterable.forEach(Iterable.java:75)
 at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118)
 at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:112)
 at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:63)
 at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:360)
 at org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
 at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:150)
 ... 58 common frames omitted
Logs von 09.01.2024 bis 09.01.2024 UTC
@alo-id
Copy link
Author

alo-id commented Jan 10, 2024

It seems that the dependency is missing.

<dependency>
    <groupId>software.amazon.awssdk</groupId>
    <artifactId>apache-client</artifactId>
</dependency>

@maciejwalkowiak
Copy link
Contributor

This must have been something specific for your setup as by default there is no need to provide a dependency to http client.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants