Tried upgrading to 3.3.8 from Spring Boot 3.3.5.
I have an application-SslBundles.yml file containing:
CustomerDistribution_Bundle:
reload-on-update: true
truststore:
location: file:./dist/MOCKS/config/rest/CustomerDistribution/truststore-CustomerDistribution.pkcs12
password: password
type: PKCS12
options:
enabled-protocols:
- TLSv1.3
No problems under 3.3.5.
With 3.3.8, I see:
19:44:45.535 [main ] ERROR [?:?:?:?] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'aboutController' defined in file [E:\DEV\EQ\CutieBootie\build\classes\java\main\tce\AboutController.class]: Unsatisfied dependency expressed through constructor parameter 6: Error creating bean with name 'customerDistributionInvoker' defined in file [E:\DEV\EQ\CutieBootie\build\classes\java\main\tce\integrations\rest\CustomerDistribution\CustomerDistributionInvoker.class]: Failed to instantiate [tce.integrations.rest.CustomerDistribution.CustomerDistributionInvoker]: Constructor threw exception
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:795) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:237) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1375) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1212) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:971) ~[spring-context-6.1.16.jar:6.1.16]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625) ~[spring-context-6.1.16.jar:6.1.16]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.3.8.jar:3.3.8]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.3.8.jar:3.3.8]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.3.8.jar:3.3.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[spring-boot-3.3.8.jar:3.3.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363) ~[spring-boot-3.3.8.jar:3.3.8]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352) ~[spring-boot-3.3.8.jar:3.3.8]
at tce.CutieBootieApplication.main(CutieBootieApplication.java:12) ~[main/:na]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'customerDistributionInvoker' defined in file [E:\DEV\EQ\CutieBootie\build\classes\java\main\tce\integrations\rest\CustomerDistribution\CustomerDistributionInvoker.class]: Failed to instantiate [tce.integrations.rest.CustomerDistribution.CustomerDistributionInvoker]: Constructor threw exception
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:318) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:306) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1375) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1212) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1694) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1658) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeanCollection(DefaultListableBeanFactory.java:1548) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1516) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1397) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1358) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:904) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:782) ~[spring-beans-6.1.16.jar:6.1.16]
... 19 common frames omitted
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [tce.integrations.rest.CustomerDistribution.CustomerDistributionInvoker]: Constructor threw exception
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:221) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117) ~[spring-beans-6.1.16.jar:6.1.16]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:315) ~[spring-beans-6.1.16.jar:6.1.16]
... 37 common frames omitted
Caused by: java.lang.IllegalStateException: SSL Options cannot be specified with Java connections
at org.springframework.util.Assert.state(Assert.java:76) ~[spring-core-6.1.16.jar:6.1.16]
at org.springframework.boot.web.client.ClientHttpRequestFactories$Simple.get(ClientHttpRequestFactories.java:325) ~[spring-boot-3.3.8.jar:3.3.8]
at org.springframework.boot.web.client.ClientHttpRequestFactories.get(ClientHttpRequestFactories.java:111) ~[spring-boot-3.3.8.jar:3.3.8]
at tce.integrations.rest.CustomerDistribution.CustomerDistributionInvoker.lambda$new$1(CustomerDistributionInvoker.java:125) ~[main/:na]
at tce.integrations.rest.CustomerDistribution.CustomerDistributionInvoker.<init>(CustomerDistributionInvoker.java:131) ~[main/:na]
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:501) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:485) ~[na:na]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:208) ~[spring-beans-6.1.16.jar:6.1.16]
... 39 common frames omitted
Process finished with exit code 1
There are other entries in the file. This is the first with a truststore defiinition in the file (if that is relevant).
The SOLE change is to update the plugin definition in my build.gradle.kts file:
plugins {
idea
java
id("io.spring.dependency-management") version "1.1.6"
// id("org.springframework.boot") version "3.3.5"
id("org.springframework.boot") version "3.3.8"
}
Seems to come from:
Not sure what changed with 3.3.8?
Comment From: wilkinsona
I don't think anything's changed in this area in 3.3.8. That assertion has been in place since 3.1.x.
You haven't shared any information about the HTTP client that you expect your application to use. The stack trace shows that it's falling back to the URLConnection
-based simple client which means that none of Apache HTTP client, Jetty HTTP client, or OkHttp are on the classpath. I would guess that one of these clients was present previously and that's no longer the case for some reason.
If this doesn't help and you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
Comment From: transentia
Just tried 3.4.2. Same issue.
Again, the only change is:
id("org.springframework.boot") version "3.4.2"
I've always intended/assumed to use the JDK client, as per: https://docs.spring.io/spring-boot/reference/io/rest-client.html#io.rest-client.clienthttprequestfactory
I judge that any changes in dependencies would be a side effect of this change in spring version. I don't see an alternative library on my classpath.
I've also tried explicitly setting my application.yml:
spring:
http:
client:
factory: jdk
No change.
I don't have a minimal sample for this.
I'll work around the issue in code, if I can.
Easiest to close this...
If anyone else has this issue, maybe they will find here as a starting point and may be able to add to the knowledgebase.