Comments (8)
Interestingly, the method body containing the AWS IAM code causes the failure. Moving the code into another class fixes the problem.
from spring-vault.
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.
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.
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.
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.
Thanks a lot, this makes things much easier.
from spring-vault.
That's fixed now. Care to test against the latest 3.0.3-SNAPSHOT
?
from spring-vault.
I can confirm it works with 3.0.3-SNAPSHOT.
from spring-vault.
Related Issues (20)
- Make the default LeaseStrategy configurable and default to retainOnIOException for more resilient applications HOT 3
- EnvironmentVaultConfiguration does not check for spring.cloud prefix by default. HOT 3
- Leases no longer revoked after stopping `SecretLeaseContainer` HOT 3
- Refresh authentication token and leases related to it after expire of authentication token HOT 3
- Release Spring Vault 3.1.1
- Upgrade to Spring Data 2023.1.2
- Upgrade to Spring Framework 6.1.3
- Upgrade to Project Reactor 2023.0.2
- Upgrade dependencies
- Extend copyright license headers to 2024
- Leases no longer revoked after stopping SecretLeaseContainer HOT 3
- Assistance Needed with Dynamic Vault Template Creation Using RoleID and SecretID HOT 1
- Private Key is `null` in `CertificateBundle` using `of(String serialNumber, String certificate, String issuingCaCertificate, String privateKey)` HOT 2
- Page not found for 2.3.3 reference doc HOT 2
- Dynamically Configure Cipher Suites for Vault Communication HOT 3
- Read-Timeout not applied with Apache Http Components and no-SSL HOT 3
- Leases no longer revoked after stopping SecretLeaseContainer #855 HOT 2
- Update `SessionManager` implementation for non-renewable tokens HOT 6
- What is the property value to set for certificate authentication name? HOT 1
- Add support for IMDSv2 on EC2 instances HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-vault.