无法实例化 VaultConfigDataLoader
Unable to instantiate VaultConfigDataLoader
我正在尝试在我的 Spring 启动应用程序(v. 2.4.2)中配置 Spring Cloud Vault。我正在使用 Spring Cloud v. 2020.0.5(根据 Release train,应该没问题)。
C:\Tools\jdk1.8.0_92\bin\java.exe -Dspring.profiles.active=DEV,local -javaagent:C:\Apps\IC\idealC-2021.1.2\lib\idea_rt.jar=52879:C:\Apps\IC\idealC-2021.1.2\bin -Dfile.encoding=UTF-8 -classpath C:\Tools\jdk1.8.0_92\jre\lib\charsets.jar;C:\Tools\jdk1.8.0_92\jre\lib\deploy.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\access-bridge-64.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\cldrdata.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\dnsns.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\jaccess.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\jfxrt.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\localedata.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\nashorn.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\sunec.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\sunjce_provider.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\sunmscapi.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\sunpkcs11.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\zipfs.jar;C:\Tools\jdk1.8.0_92\jre\lib\javaws.jar;C:\Tools\jdk1.8.0_92\jre\lib\jce.jar;C:\Tools\jdk1.8.0_92\jre\lib\jfr.jar;C:\Tools\jdk1.8.0_92\jre\lib\jfxswt.jar;C:\Tools\jdk1.8.0_92\jre\lib\jsse.jar;C:\Tools\jdk1.8.0_92\jre\lib\management-agent.jar;C:\Tools\jdk1.8.0_92\jre\lib\plugin.jar;C:\Tools\jdk1.8.0_92\jre\lib\resources.jar;C:\Tools\jdk1.8.0_92\jre\lib\rt.jar;C:\repositories\org\apache\cxf\cxf-spring-boot-starter-jaxws.4.5\cxf-spring-boot-starter-jaxws-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-spring-boot-autoconfigure.4.5\cxf-spring-boot-autoconfigure-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-transports-http.4.5\cxf-rt-transports-http-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-core.4.5\cxf-core-3.4.5.jar;C:\repositories\com\fasterxml\woodstox\woodstox-core.2.6\woodstox-core-6.2.6.jar;C:\repositories\org\codehaus\woodstox\stax2-api.2.1\stax2-api-4.2.1.jar;C:\repositories\org\apache\ws\xmlschema\xmlschema-core.2.5\xmlschema-core-2.2.5.jar;C:\repositories\org\apache\cxf\cxf-rt-frontend-jaxws.4.5\cxf-rt-frontend-jaxws-3.4.5.jar;C:\repositories\xml-resolver\xml-resolver.2\xml-resolver-1.2.jar;C:\repositories\org\ow2\asm\asm.2\asm-9.2.jar;C:\repositories\org\apache\cxf\cxf-rt-bindings-soap.4.5\cxf-rt-bindings-soap-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-wsdl.4.5\cxf-rt-wsdl-3.4.5.jar;C:\repositories\wsdl4j\wsdl4j.6.3\wsdl4j-1.6.3.jar;C:\repositories\org\apache\cxf\cxf-rt-databinding-jaxb.4.5\cxf-rt-databinding-jaxb-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-bindings-xml.4.5\cxf-rt-bindings-xml-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-frontend-simple.4.5\cxf-rt-frontend-simple-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-ws-addr.4.5\cxf-rt-ws-addr-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-ws-policy.4.5\cxf-rt-ws-policy-3.4.5.jar;C:\repositories\org\apache\neethi\neethi.1.1\neethi-3.1.1.jar;C:\repositories\org\apache\cxf\cxf-rt-features-metrics.4.5\cxf-rt-features-metrics-3.4.5.jar;C:\repositories\jakarta\validation\jakarta.validation-api.0.2\jakarta.validation-api-2.0.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter.4.2\spring-boot-starter-2.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter-logging.4.2\spring-boot-starter-logging-2.4.2.jar;C:\repositories\ch\qos\logback\logback-classic.2.3\logback-classic-1.2.3.jar;C:\repositories\ch\qos\logback\logback-core.2.3\logback-core-1.2.3.jar;C:\repositories\org\apache\logging\log4j\log4j-to-slf4j.13.3\log4j-to-slf4j-2.13.3.jar;C:\repositories\org\apache\logging\log4j\log4j-api.13.3\log4j-api-2.13.3.jar;C:\repositories\org\slf4j\jul-to-slf4j.7.30\jul-to-slf4j-1.7.30.jar;C:\repositories\jakarta\annotation\jakarta.annotation-api.3.5\jakarta.annotation-api-1.3.5.jar;C:\repositories\org\yaml\snakeyaml.27\snakeyaml-1.27.jar;C:\repositories\org\apache\commons\commons-lang3.0\commons-lang3-3.0.jar;C:\repositories\javax\xml\bind\jaxb-api.1\jaxb-api-2.1.jar;C:\repositories\javax\xml\stream\stax-api.0-2\stax-api-1.0-2.jar;C:\repositories\javax\activation\activation.1\activation-1.1.jar;C:\repositories\com\sun\xml\bind\jaxb-impl.1.13\jaxb-impl-2.1.13.jar;C:\repositories\org\springframework\security\spring-security-core.4.2\spring-security-core-5.4.2.jar;C:\repositories\org\springframework\spring-aop.3.3\spring-aop-5.3.3.jar;C:\repositories\org\springframework\spring-expression.3.3\spring-expression-5.3.3.jar;C:\repositories\org\springframework\spring-context.3.3\spring-context-5.3.3.jar;C:\repositories\org\slf4j\slf4j-api.7.30\slf4j-api-1.7.30.jar;C:\repositories\org\springframework\spring-web.3.3\spring-web-5.3.3.jar;C:\repositories\org\springframework\security\spring-security-config.4.2\spring-security-config-5.4.2.jar;C:\repositories\org\springframework\security\spring-security-web.4.2\spring-security-web-5.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter-web.4.2\spring-boot-starter-web-2.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter-json.4.2\spring-boot-starter-json-2.4.2.jar;C:\repositories\com\fasterxml\jackson\core\jackson-databind.11.4\jackson-databind-2.11.4.jar;C:\repositories\com\fasterxml\jackson\core\jackson-annotations.11.4\jackson-annotations-2.11.4.jar;C:\repositories\com\fasterxml\jackson\core\jackson-core.11.4\jackson-core-2.11.4.jar;C:\repositories\com\fasterxml\jackson\datatype\jackson-datatype-jdk8.11.4\jackson-datatype-jdk8-2.11.4.jar;C:\repositories\com\fasterxml\jackson\datatype\jackson-datatype-jsr310.11.4\jackson-datatype-jsr310-2.11.4.jar;C:\repositories\com\fasterxml\jackson\module\jackson-module-parameter-names.11.4\jackson-module-parameter-names-2.11.4.jar;C:\repositories\org\springframework\boot\spring-boot-starter-tomcat.4.2\spring-boot-starter-tomcat-2.4.2.jar;C:\repositories\org\apache\tomcat\embed\tomcat-embed-core.0.41\tomcat-embed-core-9.0.41.jar;C:\repositories\org\apache\tomcat\embed\tomcat-embed-websocket.0.41\tomcat-embed-websocket-9.0.41.jar;C:\repositories\org\springframework\spring-webmvc.3.3\spring-webmvc-5.3.3.jar;C:\repositories\org\springframework\boot\spring-boot-starter-validation.4.2\spring-boot-starter-validation-2.4.2.jar;C:\repositories\org\glassfish\jakarta.el.0.3\jakarta.el-3.0.3.jar;C:\repositories\org\hibernate\validator\hibernate-validator.1.7.Final\hibernate-validator-6.1.7.Final.jar;C:\repositories\org\jboss\logging\jboss-logging.4.1.Final\jboss-logging-3.4.1.Final.jar;C:\repositories\com\fasterxml\classmate.5.1\classmate-1.5.1.jar;C:\repositories\org\springframework\boot\spring-boot-starter-data-jpa.4.2\spring-boot-starter-data-jpa-2.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter-aop.4.2\spring-boot-starter-aop-2.4.2.jar;C:\repositories\org\aspectj\aspectjweaver.9.6\aspectjweaver-1.9.6.jar;C:\repositories\org\springframework\boot\spring-boot-starter-jdbc.4.2\spring-boot-starter-jdbc-2.4.2.jar;C:\repositories\com\zaxxer\HikariCP.4.5\HikariCP-3.4.5.jar;C:\repositories\org\springframework\spring-jdbc.3.3\spring-jdbc-5.3.3.jar;C:\repositories\jakarta\transaction\jakarta.transaction-api.3.3\jakarta.transaction-api-1.3.3.jar;C:\repositories\jakarta\persistence\jakarta.persistence-api.2.3\jakarta.persistence-api-2.2.3.jar;C:\repositories\org\hibernate\hibernate-core.4.27.Final\hibernate-core-5.4.27.Final.jar;C:\repositories\org\javassist\javassist.27.0-GA\javassist-3.27.0-GA.jar;C:\repositories\net\bytebuddy\byte-buddy.10.19\byte-buddy-1.10.19.jar;C:\repositories\antlr\antlr.7.7\antlr-2.7.7.jar;C:\repositories\org\jboss\jandex.1.3.Final\jandex-2.1.3.Final.jar;C:\repositories\org\dom4j\dom4j.1.3\dom4j-2.1.3.jar;C:\repositories\org\hibernate\common\hibernate-commons-annotations.1.2.Final\hibernate-commons-annotations-5.1.2.Final.jar;C:\repositories\org\glassfish\jaxb\jaxb-runtime.3.3\jaxb-runtime-2.3.3.jar;C:\repositories\jakarta\xml\bind\jakarta.xml.bind-api.3.3\jakarta.xml.bind-api-2.3.3.jar;C:\repositories\org\glassfish\jaxb\txw2.3.3\txw2-2.3.3.jar;C:\repositories\com\sun\istack\istack-commons-runtime.0.11\istack-commons-runtime-3.0.11.jar;C:\repositories\com\sun\activation\jakarta.activation.2.2\jakarta.activation-1.2.2.jar;C:\repositories\org\springframework\data\spring-data-jpa.4.3\spring-data-jpa-2.4.3.jar;C:\repositories\org\springframework\data\spring-data-commons.4.3\spring-data-commons-2.4.3.jar;C:\repositories\org\springframework\spring-orm.3.3\spring-orm-5.3.3.jar;C:\repositories\org\springframework\spring-tx.3.3\spring-tx-5.3.3.jar;C:\repositories\org\springframework\spring-aspects.3.3\spring-aspects-5.3.3.jar;C:\repositories\org\springframework\cloud\spring-cloud-starter-vault-config.0.5\spring-cloud-starter-vault-config-3.0.5.jar;C:\repositories\org\apache\httpcomponents\httpclient.5.13\httpclient-4.5.13.jar;C:\repositories\org\apache\httpcomponents\httpcore.4.14\httpcore-4.4.14.jar;C:\repositories\org\springframework\cloud\spring-cloud-starter.0.5\spring-cloud-starter-3.0.5.jar;C:\repositories\org\springframework\cloud\spring-cloud-context.0.5\spring-cloud-context-3.0.5.jar;C:\repositories\org\springframework\security\spring-security-crypto.4.2\spring-security-crypto-5.4.2.jar;C:\repositories\org\springframework\cloud\spring-cloud-commons.0.5\spring-cloud-commons-3.0.5.jar;C:\repositories\org\springframework\security\spring-security-rsa.0.10.RELEASE\spring-security-rsa-1.0.10.RELEASE.jar;C:\repositories\org\springframework\cloud\spring-cloud-vault-config.0.5\spring-cloud-vault-config-3.0.5.jar;C:\repositories\org\springframework\vault\spring-vault-core.3.2\spring-vault-core-2.3.2.jar;C:\repositories\com\ibm\mq\mq-jms-spring-boot-starter.4.2\mq-jms-spring-boot-starter-2.4.2.jar;C:\repositories\com\ibm\mq\com.ibm.mq.allclient.2.1.0\com.ibm.mq.allclient-9.2.1.0.jar;C:\repositories\org\bouncycastle\bcprov-jdk15on.66\bcprov-jdk15on-1.66.jar;C:\repositories\org\bouncycastle\bcpkix-jdk15on.66\bcpkix-jdk15on-1.66.jar;C:\repositories\javax\jms\javax.jms-api.0.1\javax.jms-api-2.0.1.jar;C:\repositories\org\json\json080701\json-20080701.jar;C:\repositories\org\springframework\spring-core.3.3\spring-core-5.3.3.jar;C:\repositories\org\springframework\spring-jcl.3.3\spring-jcl-5.3.3.jar;C:\repositories\org\springframework\spring-beans.3.3\spring-beans-5.3.3.jar;C:\repositories\org\springframework\spring-jms.3.3\spring-jms-5.3.3.jar;C:\repositories\org\springframework\spring-messaging.3.3\spring-messaging-5.3.3.jar;C:\repositories\org\messaginghub\pooled-jms.2.1\pooled-jms-1.2.1.jar;C:\repositories\org\apache\geronimo\specs\geronimo-jms_2.0_spec.0-alpha-2\geronimo-jms_2.0_spec-1.0-alpha-2.jar;C:\repositories\org\apache\commons\commons-pool2.9.0\commons-pool2-2.9.0.jar;C:\repositories\org\springframework\boot\spring-boot.4.2\spring-boot-2.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-autoconfigure.4.2\spring-boot-autoconfigure-2.4.2.jar;C:\repositories\net\sf\dozer\dozer.5.1\dozer-5.5.1.jar;C:\repositories\commons-beanutils\commons-beanutils.8.0\commons-beanutils-1.8.0.jar;C:\repositories\org\slf4j\jcl-over-slf4j.7.30\jcl-over-slf4j-1.7.30.jar;C:\repositories\commons-io\commons-io.3.2\commons-io-1.3.2.jar;C:\repositories\commons-configuration\commons-configuration.10\commons-configuration-1.10.jar;C:\repositories\commons-lang\commons-lang.4\commons-lang-2.4.jar;C:\repositories\commons-logging\commons-logging.1.1\commons-logging-1.1.1.jar;C:\repositories\commons-codec\commons-codec.10\commons-codec-1.10.jar;C:\repositories\stax\stax.2.0\stax-1.2.0.jar;C:\repositories\com\ibm\mq\mqjms.0.1.7\mqjms-7.0.1.7.jar;C:\repositories\com\ibm\mq\dhbcore.0.1.7\dhbcore-7.0.1.7.jar;C:\repositories\com\ibm\mq\jmqi.0.1.7\jmqi-7.0.1.7.jar;C:\repositories\com\google\guava\guava.0-rc2\guava-13.0-rc2.jar;C:\repositories\com\oracle\jdbc\ojdbc8.2.0.1.0\ojdbc8-12.2.0.1.0.jar;C:\repositories\com\oracle\jdbc\ucp.2.0.1\ucp-12.2.0.1.jar;C:\repositories\net\sf\ehcache\ehcache-core.3.1\ehcache-core-2.3.1.jar com.example.ExampleServApplication
17:00:24.235 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalArgumentException: Unable to instantiate org.springframework.boot.context.config.ConfigDataLoader [org.springframework.cloud.vault.config.VaultConfigDataLoader]
at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:103)
at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:90)
at org.springframework.boot.context.config.ConfigDataLoaders.<init>(ConfigDataLoaders.java:75)
at org.springframework.boot.context.config.ConfigDataLoaders.<init>(ConfigDataLoaders.java:56)
at org.springframework.boot.context.config.ConfigDataEnvironment.<init>(ConfigDataEnvironment.java:155)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.getConfigDataEnvironment(ConfigDataEnvironmentPostProcessor.java:108)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:97)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:100)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:86)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared(SpringApplicationRunListeners.java:63)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:362)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144)
at com.example.ExampleServApplication.main(ExampleServApplication.java:29)
Caused by: java.lang.IllegalAccessException: Unable to find suitable constructor
at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:118)
at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:100)
... 23 common frames omitted
知道哪里出了问题吗?我是否遗漏了一些依赖项?
我发现了问题。似乎这些特定的版本集不兼容(即使发布列车另有说明):
- spring-boot2.4.2
- spring-cloud 2020.0.5
问题是 class ConfigDataLoaders 仅在 spring-boot 2.4.3:
中支持 DeferredLogFactory 注入
https://github.com/spring-projects/spring-boot/commit/1def245a2cb7f5aa520531059956c3c3794625d7
另一方面,从 Spring Cloud 3.0.2 开始,VaultConfigDataLoader 有一个接受 DeferredLogFactory 的新构造函数:
https://github.com/spring-cloud/spring-cloud-vault/commit/a9fd88c3b768a1f6e485851423dd8f62afae71ba
因此,要么使用 Spring Boot 2.4.2 和 Spring Cloud 3.0.1(或更低版本),要么使用 Spring Boot 2.4.3 和 Spring Cloud 3.0.2+.
我希望这次调查能节省一些时间,因为我花了大约半天的时间..
我正在尝试在我的 Spring 启动应用程序(v. 2.4.2)中配置 Spring Cloud Vault。我正在使用 Spring Cloud v. 2020.0.5(根据 Release train,应该没问题)。
C:\Tools\jdk1.8.0_92\bin\java.exe -Dspring.profiles.active=DEV,local -javaagent:C:\Apps\IC\idealC-2021.1.2\lib\idea_rt.jar=52879:C:\Apps\IC\idealC-2021.1.2\bin -Dfile.encoding=UTF-8 -classpath C:\Tools\jdk1.8.0_92\jre\lib\charsets.jar;C:\Tools\jdk1.8.0_92\jre\lib\deploy.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\access-bridge-64.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\cldrdata.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\dnsns.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\jaccess.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\jfxrt.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\localedata.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\nashorn.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\sunec.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\sunjce_provider.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\sunmscapi.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\sunpkcs11.jar;C:\Tools\jdk1.8.0_92\jre\lib\ext\zipfs.jar;C:\Tools\jdk1.8.0_92\jre\lib\javaws.jar;C:\Tools\jdk1.8.0_92\jre\lib\jce.jar;C:\Tools\jdk1.8.0_92\jre\lib\jfr.jar;C:\Tools\jdk1.8.0_92\jre\lib\jfxswt.jar;C:\Tools\jdk1.8.0_92\jre\lib\jsse.jar;C:\Tools\jdk1.8.0_92\jre\lib\management-agent.jar;C:\Tools\jdk1.8.0_92\jre\lib\plugin.jar;C:\Tools\jdk1.8.0_92\jre\lib\resources.jar;C:\Tools\jdk1.8.0_92\jre\lib\rt.jar;C:\repositories\org\apache\cxf\cxf-spring-boot-starter-jaxws.4.5\cxf-spring-boot-starter-jaxws-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-spring-boot-autoconfigure.4.5\cxf-spring-boot-autoconfigure-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-transports-http.4.5\cxf-rt-transports-http-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-core.4.5\cxf-core-3.4.5.jar;C:\repositories\com\fasterxml\woodstox\woodstox-core.2.6\woodstox-core-6.2.6.jar;C:\repositories\org\codehaus\woodstox\stax2-api.2.1\stax2-api-4.2.1.jar;C:\repositories\org\apache\ws\xmlschema\xmlschema-core.2.5\xmlschema-core-2.2.5.jar;C:\repositories\org\apache\cxf\cxf-rt-frontend-jaxws.4.5\cxf-rt-frontend-jaxws-3.4.5.jar;C:\repositories\xml-resolver\xml-resolver.2\xml-resolver-1.2.jar;C:\repositories\org\ow2\asm\asm.2\asm-9.2.jar;C:\repositories\org\apache\cxf\cxf-rt-bindings-soap.4.5\cxf-rt-bindings-soap-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-wsdl.4.5\cxf-rt-wsdl-3.4.5.jar;C:\repositories\wsdl4j\wsdl4j.6.3\wsdl4j-1.6.3.jar;C:\repositories\org\apache\cxf\cxf-rt-databinding-jaxb.4.5\cxf-rt-databinding-jaxb-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-bindings-xml.4.5\cxf-rt-bindings-xml-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-frontend-simple.4.5\cxf-rt-frontend-simple-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-ws-addr.4.5\cxf-rt-ws-addr-3.4.5.jar;C:\repositories\org\apache\cxf\cxf-rt-ws-policy.4.5\cxf-rt-ws-policy-3.4.5.jar;C:\repositories\org\apache\neethi\neethi.1.1\neethi-3.1.1.jar;C:\repositories\org\apache\cxf\cxf-rt-features-metrics.4.5\cxf-rt-features-metrics-3.4.5.jar;C:\repositories\jakarta\validation\jakarta.validation-api.0.2\jakarta.validation-api-2.0.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter.4.2\spring-boot-starter-2.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter-logging.4.2\spring-boot-starter-logging-2.4.2.jar;C:\repositories\ch\qos\logback\logback-classic.2.3\logback-classic-1.2.3.jar;C:\repositories\ch\qos\logback\logback-core.2.3\logback-core-1.2.3.jar;C:\repositories\org\apache\logging\log4j\log4j-to-slf4j.13.3\log4j-to-slf4j-2.13.3.jar;C:\repositories\org\apache\logging\log4j\log4j-api.13.3\log4j-api-2.13.3.jar;C:\repositories\org\slf4j\jul-to-slf4j.7.30\jul-to-slf4j-1.7.30.jar;C:\repositories\jakarta\annotation\jakarta.annotation-api.3.5\jakarta.annotation-api-1.3.5.jar;C:\repositories\org\yaml\snakeyaml.27\snakeyaml-1.27.jar;C:\repositories\org\apache\commons\commons-lang3.0\commons-lang3-3.0.jar;C:\repositories\javax\xml\bind\jaxb-api.1\jaxb-api-2.1.jar;C:\repositories\javax\xml\stream\stax-api.0-2\stax-api-1.0-2.jar;C:\repositories\javax\activation\activation.1\activation-1.1.jar;C:\repositories\com\sun\xml\bind\jaxb-impl.1.13\jaxb-impl-2.1.13.jar;C:\repositories\org\springframework\security\spring-security-core.4.2\spring-security-core-5.4.2.jar;C:\repositories\org\springframework\spring-aop.3.3\spring-aop-5.3.3.jar;C:\repositories\org\springframework\spring-expression.3.3\spring-expression-5.3.3.jar;C:\repositories\org\springframework\spring-context.3.3\spring-context-5.3.3.jar;C:\repositories\org\slf4j\slf4j-api.7.30\slf4j-api-1.7.30.jar;C:\repositories\org\springframework\spring-web.3.3\spring-web-5.3.3.jar;C:\repositories\org\springframework\security\spring-security-config.4.2\spring-security-config-5.4.2.jar;C:\repositories\org\springframework\security\spring-security-web.4.2\spring-security-web-5.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter-web.4.2\spring-boot-starter-web-2.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter-json.4.2\spring-boot-starter-json-2.4.2.jar;C:\repositories\com\fasterxml\jackson\core\jackson-databind.11.4\jackson-databind-2.11.4.jar;C:\repositories\com\fasterxml\jackson\core\jackson-annotations.11.4\jackson-annotations-2.11.4.jar;C:\repositories\com\fasterxml\jackson\core\jackson-core.11.4\jackson-core-2.11.4.jar;C:\repositories\com\fasterxml\jackson\datatype\jackson-datatype-jdk8.11.4\jackson-datatype-jdk8-2.11.4.jar;C:\repositories\com\fasterxml\jackson\datatype\jackson-datatype-jsr310.11.4\jackson-datatype-jsr310-2.11.4.jar;C:\repositories\com\fasterxml\jackson\module\jackson-module-parameter-names.11.4\jackson-module-parameter-names-2.11.4.jar;C:\repositories\org\springframework\boot\spring-boot-starter-tomcat.4.2\spring-boot-starter-tomcat-2.4.2.jar;C:\repositories\org\apache\tomcat\embed\tomcat-embed-core.0.41\tomcat-embed-core-9.0.41.jar;C:\repositories\org\apache\tomcat\embed\tomcat-embed-websocket.0.41\tomcat-embed-websocket-9.0.41.jar;C:\repositories\org\springframework\spring-webmvc.3.3\spring-webmvc-5.3.3.jar;C:\repositories\org\springframework\boot\spring-boot-starter-validation.4.2\spring-boot-starter-validation-2.4.2.jar;C:\repositories\org\glassfish\jakarta.el.0.3\jakarta.el-3.0.3.jar;C:\repositories\org\hibernate\validator\hibernate-validator.1.7.Final\hibernate-validator-6.1.7.Final.jar;C:\repositories\org\jboss\logging\jboss-logging.4.1.Final\jboss-logging-3.4.1.Final.jar;C:\repositories\com\fasterxml\classmate.5.1\classmate-1.5.1.jar;C:\repositories\org\springframework\boot\spring-boot-starter-data-jpa.4.2\spring-boot-starter-data-jpa-2.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-starter-aop.4.2\spring-boot-starter-aop-2.4.2.jar;C:\repositories\org\aspectj\aspectjweaver.9.6\aspectjweaver-1.9.6.jar;C:\repositories\org\springframework\boot\spring-boot-starter-jdbc.4.2\spring-boot-starter-jdbc-2.4.2.jar;C:\repositories\com\zaxxer\HikariCP.4.5\HikariCP-3.4.5.jar;C:\repositories\org\springframework\spring-jdbc.3.3\spring-jdbc-5.3.3.jar;C:\repositories\jakarta\transaction\jakarta.transaction-api.3.3\jakarta.transaction-api-1.3.3.jar;C:\repositories\jakarta\persistence\jakarta.persistence-api.2.3\jakarta.persistence-api-2.2.3.jar;C:\repositories\org\hibernate\hibernate-core.4.27.Final\hibernate-core-5.4.27.Final.jar;C:\repositories\org\javassist\javassist.27.0-GA\javassist-3.27.0-GA.jar;C:\repositories\net\bytebuddy\byte-buddy.10.19\byte-buddy-1.10.19.jar;C:\repositories\antlr\antlr.7.7\antlr-2.7.7.jar;C:\repositories\org\jboss\jandex.1.3.Final\jandex-2.1.3.Final.jar;C:\repositories\org\dom4j\dom4j.1.3\dom4j-2.1.3.jar;C:\repositories\org\hibernate\common\hibernate-commons-annotations.1.2.Final\hibernate-commons-annotations-5.1.2.Final.jar;C:\repositories\org\glassfish\jaxb\jaxb-runtime.3.3\jaxb-runtime-2.3.3.jar;C:\repositories\jakarta\xml\bind\jakarta.xml.bind-api.3.3\jakarta.xml.bind-api-2.3.3.jar;C:\repositories\org\glassfish\jaxb\txw2.3.3\txw2-2.3.3.jar;C:\repositories\com\sun\istack\istack-commons-runtime.0.11\istack-commons-runtime-3.0.11.jar;C:\repositories\com\sun\activation\jakarta.activation.2.2\jakarta.activation-1.2.2.jar;C:\repositories\org\springframework\data\spring-data-jpa.4.3\spring-data-jpa-2.4.3.jar;C:\repositories\org\springframework\data\spring-data-commons.4.3\spring-data-commons-2.4.3.jar;C:\repositories\org\springframework\spring-orm.3.3\spring-orm-5.3.3.jar;C:\repositories\org\springframework\spring-tx.3.3\spring-tx-5.3.3.jar;C:\repositories\org\springframework\spring-aspects.3.3\spring-aspects-5.3.3.jar;C:\repositories\org\springframework\cloud\spring-cloud-starter-vault-config.0.5\spring-cloud-starter-vault-config-3.0.5.jar;C:\repositories\org\apache\httpcomponents\httpclient.5.13\httpclient-4.5.13.jar;C:\repositories\org\apache\httpcomponents\httpcore.4.14\httpcore-4.4.14.jar;C:\repositories\org\springframework\cloud\spring-cloud-starter.0.5\spring-cloud-starter-3.0.5.jar;C:\repositories\org\springframework\cloud\spring-cloud-context.0.5\spring-cloud-context-3.0.5.jar;C:\repositories\org\springframework\security\spring-security-crypto.4.2\spring-security-crypto-5.4.2.jar;C:\repositories\org\springframework\cloud\spring-cloud-commons.0.5\spring-cloud-commons-3.0.5.jar;C:\repositories\org\springframework\security\spring-security-rsa.0.10.RELEASE\spring-security-rsa-1.0.10.RELEASE.jar;C:\repositories\org\springframework\cloud\spring-cloud-vault-config.0.5\spring-cloud-vault-config-3.0.5.jar;C:\repositories\org\springframework\vault\spring-vault-core.3.2\spring-vault-core-2.3.2.jar;C:\repositories\com\ibm\mq\mq-jms-spring-boot-starter.4.2\mq-jms-spring-boot-starter-2.4.2.jar;C:\repositories\com\ibm\mq\com.ibm.mq.allclient.2.1.0\com.ibm.mq.allclient-9.2.1.0.jar;C:\repositories\org\bouncycastle\bcprov-jdk15on.66\bcprov-jdk15on-1.66.jar;C:\repositories\org\bouncycastle\bcpkix-jdk15on.66\bcpkix-jdk15on-1.66.jar;C:\repositories\javax\jms\javax.jms-api.0.1\javax.jms-api-2.0.1.jar;C:\repositories\org\json\json080701\json-20080701.jar;C:\repositories\org\springframework\spring-core.3.3\spring-core-5.3.3.jar;C:\repositories\org\springframework\spring-jcl.3.3\spring-jcl-5.3.3.jar;C:\repositories\org\springframework\spring-beans.3.3\spring-beans-5.3.3.jar;C:\repositories\org\springframework\spring-jms.3.3\spring-jms-5.3.3.jar;C:\repositories\org\springframework\spring-messaging.3.3\spring-messaging-5.3.3.jar;C:\repositories\org\messaginghub\pooled-jms.2.1\pooled-jms-1.2.1.jar;C:\repositories\org\apache\geronimo\specs\geronimo-jms_2.0_spec.0-alpha-2\geronimo-jms_2.0_spec-1.0-alpha-2.jar;C:\repositories\org\apache\commons\commons-pool2.9.0\commons-pool2-2.9.0.jar;C:\repositories\org\springframework\boot\spring-boot.4.2\spring-boot-2.4.2.jar;C:\repositories\org\springframework\boot\spring-boot-autoconfigure.4.2\spring-boot-autoconfigure-2.4.2.jar;C:\repositories\net\sf\dozer\dozer.5.1\dozer-5.5.1.jar;C:\repositories\commons-beanutils\commons-beanutils.8.0\commons-beanutils-1.8.0.jar;C:\repositories\org\slf4j\jcl-over-slf4j.7.30\jcl-over-slf4j-1.7.30.jar;C:\repositories\commons-io\commons-io.3.2\commons-io-1.3.2.jar;C:\repositories\commons-configuration\commons-configuration.10\commons-configuration-1.10.jar;C:\repositories\commons-lang\commons-lang.4\commons-lang-2.4.jar;C:\repositories\commons-logging\commons-logging.1.1\commons-logging-1.1.1.jar;C:\repositories\commons-codec\commons-codec.10\commons-codec-1.10.jar;C:\repositories\stax\stax.2.0\stax-1.2.0.jar;C:\repositories\com\ibm\mq\mqjms.0.1.7\mqjms-7.0.1.7.jar;C:\repositories\com\ibm\mq\dhbcore.0.1.7\dhbcore-7.0.1.7.jar;C:\repositories\com\ibm\mq\jmqi.0.1.7\jmqi-7.0.1.7.jar;C:\repositories\com\google\guava\guava.0-rc2\guava-13.0-rc2.jar;C:\repositories\com\oracle\jdbc\ojdbc8.2.0.1.0\ojdbc8-12.2.0.1.0.jar;C:\repositories\com\oracle\jdbc\ucp.2.0.1\ucp-12.2.0.1.jar;C:\repositories\net\sf\ehcache\ehcache-core.3.1\ehcache-core-2.3.1.jar com.example.ExampleServApplication
17:00:24.235 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
java.lang.IllegalArgumentException: Unable to instantiate org.springframework.boot.context.config.ConfigDataLoader [org.springframework.cloud.vault.config.VaultConfigDataLoader]
at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:103)
at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:90)
at org.springframework.boot.context.config.ConfigDataLoaders.<init>(ConfigDataLoaders.java:75)
at org.springframework.boot.context.config.ConfigDataLoaders.<init>(ConfigDataLoaders.java:56)
at org.springframework.boot.context.config.ConfigDataEnvironment.<init>(ConfigDataEnvironment.java:155)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.getConfigDataEnvironment(ConfigDataEnvironmentPostProcessor.java:108)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:97)
at org.springframework.boot.context.config.ConfigDataEnvironmentPostProcessor.postProcessEnvironment(ConfigDataEnvironmentPostProcessor.java:89)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEnvironmentPreparedEvent(EnvironmentPostProcessorApplicationListener.java:100)
at org.springframework.boot.env.EnvironmentPostProcessorApplicationListener.onApplicationEvent(EnvironmentPostProcessorApplicationListener.java:86)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131)
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:82)
at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared(SpringApplicationRunListeners.java:63)
at java.util.ArrayList.forEach(ArrayList.java:1249)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:117)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:111)
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:62)
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:362)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144)
at com.example.ExampleServApplication.main(ExampleServApplication.java:29)
Caused by: java.lang.IllegalAccessException: Unable to find suitable constructor
at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:118)
at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:100)
... 23 common frames omitted
知道哪里出了问题吗?我是否遗漏了一些依赖项?
我发现了问题。似乎这些特定的版本集不兼容(即使发布列车另有说明):
- spring-boot2.4.2
- spring-cloud 2020.0.5
问题是 class ConfigDataLoaders 仅在 spring-boot 2.4.3:
中支持 DeferredLogFactory 注入https://github.com/spring-projects/spring-boot/commit/1def245a2cb7f5aa520531059956c3c3794625d7
另一方面,从 Spring Cloud 3.0.2 开始,VaultConfigDataLoader 有一个接受 DeferredLogFactory 的新构造函数:
https://github.com/spring-cloud/spring-cloud-vault/commit/a9fd88c3b768a1f6e485851423dd8f62afae71ba
因此,要么使用 Spring Boot 2.4.2 和 Spring Cloud 3.0.1(或更低版本),要么使用 Spring Boot 2.4.3 和 Spring Cloud 3.0.2+.
我希望这次调查能节省一些时间,因为我花了大约半天的时间..