这两天出了个问题,配置文件只能写在本地,写到Git上无法读取,可愁死本菜鸡了,配置文件写在本地怎么跑都行,但是一旦写到Git,进行读取,启动服务就报错,报错信息是这样的
D:\soft\develop\Java\jdk_8_X64\bin\java.exe -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:D:\soft\develop\IDEA_2019.3.3\ideaIU-2019.3.3.win\lib\idea_rt.jar=51743:D:\soft\develop\IDEA_2019.3.3\ideaIU-2019.3.3.win\bin -Dfile.encoding=UTF-8 -classpath D:\soft\develop\Java\jdk_8_X64\jre\lib\charsets.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\deploy.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\access-bridge-64.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\cldrdata.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\dnsns.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\jaccess.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\jfxrt.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\localedata.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\nashorn.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\sunec.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\sunjce_provider.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\sunmscapi.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\sunpkcs11.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\ext\zipfs.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\javaws.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\jce.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\jfr.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\jfxswt.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\jsse.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\management-agent.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\plugin.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\resources.jar;D:\soft\develop\Java\jdk_8_X64\jre\lib\rt.jar;D:\soft\develop\IDEA_project_ALL\com-MySQLToES\target\classes;D:\soft\develop\repository\org\springframework\cloud\spring-cloud-starter-config\2.2.2.RELEASE\spring-cloud-starter-config-2.2.2.RELEASE.jar;D:\soft\develop\repository\org\springframework\cloud\spring-cloud-starter\2.2.2.RELEASE\spring-cloud-starter-2.2.2.RELEASE.jar;D:\soft\develop\repository\org\springframework\cloud\spring-cloud-context\2.2.2.RELEASE\spring-cloud-context-2.2.2.RELEASE.jar;D:\soft\develop\repository\org\springframework\security\spring-security-crypto\5.1.4.RELEASE\spring-security-crypto-5.1.4.RELEASE.jar;D:\soft\develop\repository\org\springframework\cloud\spring-cloud-commons\2.2.2.RELEASE\spring-cloud-commons-2.2.2.RELEASE.jar;D:\soft\develop\repository\org\springframework\security\spring-security-rsa\1.0.9.RELEASE\spring-security-rsa-1.0.9.RELEASE.jar;D:\soft\develop\repository\org\bouncycastle\bcpkix-jdk15on\1.64\bcpkix-jdk15on-1.64.jar;D:\soft\develop\repository\org\bouncycastle\bcprov-jdk15on\1.64\bcprov-jdk15on-1.64.jar;D:\soft\develop\repository\org\springframework\cloud\spring-cloud-config-client\2.2.2.RELEASE\spring-cloud-config-client-2.2.2.RELEASE.jar;D:\soft\develop\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\soft\develop\repository\com\fasterxml\jackson\core\jackson-databind\2.9.8\jackson-databind-2.9.8.jar;D:\soft\develop\repository\com\fasterxml\jackson\core\jackson-core\2.9.8\jackson-core-2.9.8.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot-starter\2.1.3.RELEASE\spring-boot-starter-2.1.3.RELEASE.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot\2.1.3.RELEASE\spring-boot-2.1.3.RELEASE.jar;D:\soft\develop\repository\org\springframework\spring-context\5.1.5.RELEASE\spring-context-5.1.5.RELEASE.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.3.RELEASE\spring-boot-autoconfigure-2.1.3.RELEASE.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot-starter-logging\2.1.3.RELEASE\spring-boot-starter-logging-2.1.3.RELEASE.jar;D:\soft\develop\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\soft\develop\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\soft\develop\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;D:\soft\develop\repository\org\slf4j\jul-to-slf4j\1.7.25\jul-to-slf4j-1.7.25.jar;D:\soft\develop\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\soft\develop\repository\org\springframework\spring-core\5.1.5.RELEASE\spring-core-5.1.5.RELEASE.jar;D:\soft\develop\repository\org\springframework\spring-jcl\5.1.5.RELEASE\spring-jcl-5.1.5.RELEASE.jar;D:\soft\develop\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot-starter-web\2.1.3.RELEASE\spring-boot-starter-web-2.1.3.RELEASE.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot-starter-json\2.1.3.RELEASE\spring-boot-starter-json-2.1.3.RELEASE.jar;D:\soft\develop\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.8\jackson-datatype-jdk8-2.9.8.jar;D:\soft\develop\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.8\jackson-datatype-jsr310-2.9.8.jar;D:\soft\develop\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.8\jackson-module-parameter-names-2.9.8.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.3.RELEASE\spring-boot-starter-tomcat-2.1.3.RELEASE.jar;D:\soft\develop\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.16\tomcat-embed-core-9.0.16.jar;D:\soft\develop\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.16\tomcat-embed-el-9.0.16.jar;D:\soft\develop\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.16\tomcat-embed-websocket-9.0.16.jar;D:\soft\develop\repository\org\hibernate\validator\hibernate-validator\6.0.14.Final\hibernate-validator-6.0.14.Final.jar;D:\soft\develop\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\soft\develop\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;D:\soft\develop\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;D:\soft\develop\repository\org\springframework\spring-web\5.1.5.RELEASE\spring-web-5.1.5.RELEASE.jar;D:\soft\develop\repository\org\springframework\spring-beans\5.1.5.RELEASE\spring-beans-5.1.5.RELEASE.jar;D:\soft\develop\repository\org\springframework\spring-webmvc\5.1.5.RELEASE\spring-webmvc-5.1.5.RELEASE.jar;D:\soft\develop\repository\org\springframework\spring-aop\5.1.5.RELEASE\spring-aop-5.1.5.RELEASE.jar;D:\soft\develop\repository\org\springframework\spring-expression\5.1.5.RELEASE\spring-expression-5.1.5.RELEASE.jar;D:\soft\develop\repository\com\google\code\gson\gson\2.8.5\gson-2.8.5.jar;D:\soft\develop\repository\mysql\mysql-connector-java\8.0.15\mysql-connector-java-8.0.15.jar;D:\soft\develop\repository\com\alibaba\druid\1.1.8\druid-1.1.8.jar;D:\soft\develop\repository\org\elasticsearch\client\elasticsearch-rest-high-level-client\7.8.0\elasticsearch-rest-high-level-client-7.8.0.jar;D:\soft\develop\repository\org\elasticsearch\plugin\mapper-extras-client\7.8.0\mapper-extras-client-7.8.0.jar;D:\soft\develop\repository\org\elasticsearch\plugin\parent-join-client\7.8.0\parent-join-client-7.8.0.jar;D:\soft\develop\repository\org\elasticsearch\plugin\aggs-matrix-stats-client\7.8.0\aggs-matrix-stats-client-7.8.0.jar;D:\soft\develop\repository\org\elasticsearch\plugin\rank-eval-client\7.8.0\rank-eval-client-7.8.0.jar;D:\soft\develop\repository\org\elasticsearch\plugin\lang-mustache-client\7.8.0\lang-mustache-client-7.8.0.jar;D:\soft\develop\repository\com\github\spullara\mustache\java\compiler\0.9.6\compiler-0.9.6.jar;D:\soft\develop\repository\org\elasticsearch\client\elasticsearch-rest-client\7.8.0\elasticsearch-rest-client-7.8.0.jar;D:\soft\develop\repository\org\apache\httpcomponents\httpclient\4.5.7\httpclient-4.5.7.jar;D:\soft\develop\repository\org\apache\httpcomponents\httpcore\4.4.11\httpcore-4.4.11.jar;D:\soft\develop\repository\org\apache\httpcomponents\httpasyncclient\4.1.4\httpasyncclient-4.1.4.jar;D:\soft\develop\repository\org\apache\httpcomponents\httpcore-nio\4.4.11\httpcore-nio-4.4.11.jar;D:\soft\develop\repository\commons-codec\commons-codec\1.11\commons-codec-1.11.jar;D:\soft\develop\repository\org\elasticsearch\elasticsearch\7.8.0\elasticsearch-7.8.0.jar;D:\soft\develop\repository\org\elasticsearch\elasticsearch-core\7.8.0\elasticsearch-core-7.8.0.jar;D:\soft\develop\repository\org\elasticsearch\elasticsearch-secure-sm\7.8.0\elasticsearch-secure-sm-7.8.0.jar;D:\soft\develop\repository\org\elasticsearch\elasticsearch-x-content\7.8.0\elasticsearch-x-content-7.8.0.jar;D:\soft\develop\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-smile\2.9.8\jackson-dataformat-smile-2.9.8.jar;D:\soft\develop\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.9.8\jackson-dataformat-yaml-2.9.8.jar;D:\soft\develop\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-cbor\2.9.8\jackson-dataformat-cbor-2.9.8.jar;D:\soft\develop\repository\org\elasticsearch\elasticsearch-geo\7.8.0\elasticsearch-geo-7.8.0.jar;D:\soft\develop\repository\org\apache\lucene\lucene-core\8.5.1\lucene-core-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-analyzers-common\8.5.1\lucene-analyzers-common-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-backward-codecs\8.5.1\lucene-backward-codecs-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-grouping\8.5.1\lucene-grouping-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-highlighter\8.5.1\lucene-highlighter-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-join\8.5.1\lucene-join-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-memory\8.5.1\lucene-memory-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-misc\8.5.1\lucene-misc-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-queries\8.5.1\lucene-queries-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-queryparser\8.5.1\lucene-queryparser-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-sandbox\8.5.1\lucene-sandbox-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-spatial-extras\8.5.1\lucene-spatial-extras-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-spatial3d\8.5.1\lucene-spatial3d-8.5.1.jar;D:\soft\develop\repository\org\apache\lucene\lucene-suggest\8.5.1\lucene-suggest-8.5.1.jar;D:\soft\develop\repository\org\elasticsearch\elasticsearch-cli\7.8.0\elasticsearch-cli-7.8.0.jar;D:\soft\develop\repository\net\sf\jopt-simple\jopt-simple\5.0.2\jopt-simple-5.0.2.jar;D:\soft\develop\repository\com\carrotsearch\hppc\0.8.1\hppc-0.8.1.jar;D:\soft\develop\repository\joda-time\joda-time\2.10.1\joda-time-2.10.1.jar;D:\soft\develop\repository\com\tdunning\t-digest\3.2\t-digest-3.2.jar;D:\soft\develop\repository\org\hdrhistogram\HdrHistogram\2.1.9\HdrHistogram-2.1.9.jar;D:\soft\develop\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;D:\soft\develop\repository\org\elasticsearch\jna\4.5.1\jna-4.5.1.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot-starter-test\2.1.3.RELEASE\spring-boot-starter-test-2.1.3.RELEASE.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot-test\2.1.3.RELEASE\spring-boot-test-2.1.3.RELEASE.jar;D:\soft\develop\repository\org\springframework\boot\spring-boot-test-autoconfigure\2.1.3.RELEASE\spring-boot-test-autoconfigure-2.1.3.RELEASE.jar;D:\soft\develop\repository\com\jayway\jsonpath\json-path\2.4.0\json-path-2.4.0.jar;D:\soft\develop\repository\net\minidev\json-smart\2.3\json-smart-2.3.jar;D:\soft\develop\repository\net\minidev\accessors-smart\1.2\accessors-smart-1.2.jar;D:\soft\develop\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar;D:\soft\develop\repository\org\slf4j\slf4j-api\1.7.25\slf4j-api-1.7.25.jar;D:\soft\develop\repository\junit\junit\4.12\junit-4.12.jar;D:\soft\develop\repository\org\assertj\assertj-core\3.11.1\assertj-core-3.11.1.jar;D:\soft\develop\repository\org\mockito\mockito-core\2.23.4\mockito-core-2.23.4.jar;D:\soft\develop\repository\net\bytebuddy\byte-buddy\1.9.10\byte-buddy-1.9.10.jar;D:\soft\develop\repository\net\bytebuddy\byte-buddy-agent\1.9.10\byte-buddy-agent-1.9.10.jar;D:\soft\develop\repository\org\objenesis\objenesis\2.6\objenesis-2.6.jar;D:\soft\develop\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\soft\develop\repository\org\hamcrest\hamcrest-library\1.3\hamcrest-library-1.3.jar;D:\soft\develop\repository\org\skyscreamer\jsonassert\1.5.0\jsonassert-1.5.0.jar;D:\soft\develop\repository\com\vaadin\external\google\android-json\0.0.20131108.vaadin1\android-json-0.0.20131108.vaadin1.jar;D:\soft\develop\repository\org\springframework\spring-test\5.1.5.RELEASE\spring-test-5.1.5.RELEASE.jar;D:\soft\develop\repository\org\xmlunit\xmlunit-core\2.6.2\xmlunit-core-2.6.2.jar;D:\soft\develop\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;D:\soft\develop\repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;D:\soft\develop\repository\org\projectlombok\lombok\1.18.6\lombok-1.18.6.jar cn.com.MySQLToESApplication
2020-07-02 17:15:46.525 WARN 14524 --- [ main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapImportSelectorConfiguration': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationPropertiesBean
2020-07-02 17:15:46.533 INFO 14524 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-07-02 17:15:46.567 ERROR 14524 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapImportSelectorConfiguration': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationPropertiesBean
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:212) [spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:117) [spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:74) [spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) [spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:347) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at cn.com.MySQLToESApplication.main(MySQLToESApplication.java:19) [classes/:na]
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationPropertiesBean
at org.springframework.cloud.context.properties.ConfigurationPropertiesBeans.postProcessBeforeInitialization(ConfigurationPropertiesBeans.java:94) ~[spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1754) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
... 26 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationPropertiesBean
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_152]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_152]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_152]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_152]
... 30 common frames omitted
2020-07-02 17:15:46.569 ERROR 14524 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'bootstrapImportSelectorConfiguration': Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationPropertiesBean
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:601) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:849) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:139) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:212) ~[spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:117) ~[spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:74) ~[spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127) ~[spring-context-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:75) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:54) ~[spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:347) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:306) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at cn.com.MySQLToESApplication.main(MySQLToESApplication.java:19) [classes/:na]
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/context/properties/ConfigurationPropertiesBean
at org.springframework.cloud.context.properties.ConfigurationPropertiesBeans.postProcessBeforeInitialization(ConfigurationPropertiesBeans.java:94) ~[spring-cloud-context-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1754) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) ~[spring-beans-5.1.5.RELEASE.jar:5.1.5.RELEASE]
... 26 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.properties.ConfigurationPropertiesBean
at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_152]
at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_152]
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338) ~[na:1.8.0_152]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_152]
... 30 common frames omitted
Process finished with exit code 1
呐,这本菜鸡实力有限,找了好久,还找了好几个同事帮忙,终于发现了问题所在!先看看我的pom文件:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
</parent>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
<version>2.2.2.RELEASE</version>
</dependency>
有没有想到什么问题,对啊,依赖冲突,不兼容!!!(这玩意我是真的没想到)
经过本菜鸡花了差不多两分钟的搜索,终于搞定了,解决方法就是指定springcloud版本!!! 然后就解决了,服务正常启动了
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Greenwich.SR2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>