Code Monkey home page Code Monkey logo

Comments (8)

mp911de avatar mp911de commented on June 30, 2024 1

Interestingly, the method body containing the AWS IAM code causes the failure. Moving the code into another class fixes the problem.

from spring-vault.

mp911de avatar mp911de commented on June 30, 2024

This sounds like a bug. Can you attach the full stack trace so we get the detail where the exception is being thrown?

from spring-vault.

grmblfrz avatar grmblfrz commented on June 30, 2024

Please find attached the stacktrace (packages / source file names partially redacted):
stacktrace-redacted.txt

The problem only occurs with java -jar, when starting from the IDE (intellij idea) it works as expected. (needed to reload the maven project)
I will try to create a stripped down example.

from spring-vault.

mp911de avatar mp911de commented on June 30, 2024
java.lang.IllegalStateException: Failed to introspect Class [xx.xxx.xxxxxxx.backend.config.VaultPropertiesConfiguration] from ClassLoader [org.springframework.boot.loader.LaunchedURLClassLoader@6f496d9f]
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:483)
	at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:360)
	at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:417)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$1(AbstractAutowireCapableBeanFactory.java:748)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1740)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:747)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:680)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:651)
	at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1632)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:560)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:532)
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:252)
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:245)
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:235)
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:183)
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:158)
	at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
	... 25 common frames omitted
Caused by: java.lang.NoClassDefFoundError: software/amazon/awssdk/auth/credentials/AwsCredentialsProvider
	at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
	at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3402)
	at java.base/java.lang.Class.getDeclaredMethods(Class.java:2504)
	at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:465)
	... 41 common frames omitted
Caused by: java.lang.ClassNotFoundException: software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
	at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:587)
	at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:149)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 45 common frames omitted

This exception shows a failure originating from your class xx.xxx.xxxxxxx.backend.config.VaultPropertiesConfiguration. I suggest that you set a breakpoint in the ClassNotFoundException constructor and that you take a look with the debugger, where this comes from.

from spring-vault.

grmblfrz avatar grmblfrz commented on June 30, 2024

Here is a small sample project:
vaultbugdemo.tar.gz
(with 3.0.2 it will crash with ClassNotFoundException, with 3.0.1 it will crash because of missing keystore, which is expected).

from spring-vault.

mp911de avatar mp911de commented on June 30, 2024

Thanks a lot, this makes things much easier.

from spring-vault.

mp911de avatar mp911de commented on June 30, 2024

That's fixed now. Care to test against the latest 3.0.3-SNAPSHOT?

from spring-vault.

grmblfrz avatar grmblfrz commented on June 30, 2024

I can confirm it works with 3.0.3-SNAPSHOT.

from spring-vault.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.