2023-05-15 15:34:25.227 [main] ERROR c.a.o.canal.adapter.launcher.loader.CanalAdapterLoader - Load canal adapter: es7 failed java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'es-mapping' to com.alibaba.otter.canal.client.adapter.es.core.config.ESSyncConfig$ESMapping at com.alibaba.otter.canal.client.adapter.es7x.ES7xAdapter.init(ES7xAdapter.java:54) ~[client-adapter.es7x-1.1.7-SNAPSHOT-jar-with-dependencies.jar:na] at com.alibaba.otter.canal.adapter.launcher.loader.CanalAdapterLoader.loadAdapter(CanalAdapterLoader.java:111) [client-adapter.launcher-1.1.7-SNAPSHOT.jar:na] at com.alibaba.otter.canal.adapter.launcher.loader.CanalAdapterLoader.init(CanalAdapterLoader.java:69) [client-adapter.launcher-1.1.7-SNAPSHOT.jar:na] at com.alibaba.otter.canal.adapter.launcher.loader.CanalAdapterService.init(CanalAdapterService.java:60) [client-adapter.launcher-1.1.7-SNAPSHOT.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_333] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_333] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:365) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:308) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:135) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:422) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1694) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:579) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:501) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$1(AbstractBeanFactory.java:353) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.cloud.context.scope.GenericScope$BeanLifecycleWrapper.getBean(GenericScope.java:390) ~[spring-cloud-context-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.cloud.context.scope.GenericScope.get(GenericScope.java:184) ~[spring-cloud-context-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:350) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) [spring-beans-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1089) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.cloud.context.scope.refresh.RefreshScope.eagerlyInitialize(RefreshScope.java:126) ~[spring-cloud-context-2.0.0.RELEASE.jar:2.0.0.RELEASE] at org.springframework.cloud.context.scope.refresh.RefreshScope.start(RefreshScope.java:117) ~[spring-cloud-context-2.0.0.RELEASE.jar:2.0.0.RELEASE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_333] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_333] at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_333] at org.springframework.context.event.ApplicationListenerMethodAdapter.doInvoke(ApplicationListenerMethodAdapter.java:264) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.event.ApplicationListenerMethodAdapter.processEvent(ApplicationListenerMethodAdapter.java:182) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.event.ApplicationListenerMethodAdapter.onApplicationEvent(ApplicationListenerMethodAdapter.java:144) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:400) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:354) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:888) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:161) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) ~[spring-context-5.0.5.RELEASE.jar:5.0.5.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:327) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at com.alibaba.otter.canal.adapter.launcher.CanalAdapterApplication.main(CanalAdapterApplication.java:21) ~[client-adapter.launcher-1.1.7-SNAPSHOT.jar:na] Caused by: java.lang.RuntimeException: java.lang.RuntimeException: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'es-mapping' to com.alibaba.otter.canal.client.adapter.es.core.config.ESSyncConfig$ESMapping at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.init(ESAdapter.java:72) ~[client-adapter.es7x-1.1.7-SNAPSHOT-jar-with-dependencies.jar:na] at com.alibaba.otter.canal.client.adapter.es7x.ES7xAdapter.init(ES7xAdapter.java:52) ~[client-adapter.es7x-1.1.7-SNAPSHOT-jar-with-dependencies.jar:na] ... 42 common frames omitted Caused by: java.lang.RuntimeException: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'es-mapping' to com.alibaba.otter.canal.client.adapter.es.core.config.ESSyncConfig$ESMapping at com.alibaba.otter.canal.client.adapter.support.YamlUtils.ymlToObj(YamlUtils.java:95) ~[client-adapter.common-1.1.7-SNAPSHOT.jar:na] at com.alibaba.otter.canal.client.adapter.es.core.config.ESSyncConfigLoader.lambda$load$0(ESSyncConfigLoader.java:31) ~[client-adapter.es7x-1.1.7-SNAPSHOT-jar-with-dependencies.jar:na] at java.util.HashMap.forEach(Unknown Source) ~[na:1.8.0_333] at com.alibaba.otter.canal.client.adapter.es.core.config.ESSyncConfigLoader.load(ESSyncConfigLoader.java:30) ~[client-adapter.es7x-1.1.7-SNAPSHOT-jar-with-dependencies.jar:na] at com.alibaba.otter.canal.client.adapter.es.core.ESAdapter.init(ESAdapter.java:61) ~[client-adapter.es7x-1.1.7-SNAPSHOT-jar-with-dependencies.jar:na] ... 43 common frames omitted Caused by: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'es-mapping' to com.alibaba.otter.canal.client.adapter.es.core.config.ESSyncConfig$ESMapping at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:250) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:226) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$4(Binder.java:334) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:73) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:62) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.lambda$null$5(Binder.java:342) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[na:1.8.0_333] at java.util.ArrayList$ArrayListSpliterator.tryAdvance(Unknown Source) ~[na:1.8.0_333] at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) ~[na:1.8.0_333] at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) ~[na:1.8.0_333] at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:1.8.0_333] at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[na:1.8.0_333] at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) ~[na:1.8.0_333] at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[na:1.8.0_333] at java.util.stream.ReferencePipeline.findFirst(Unknown Source) ~[na:1.8.0_333] at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$6(Binder.java:343) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:442) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder$Context.withBean(Binder.java:428) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder$Context.access$400(Binder.java:382) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.bindBean(Binder.java:340) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:279) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:210) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:166) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at com.alibaba.otter.canal.client.adapter.support.YamlUtils.ymlToObj(YamlUtils.java:93) ~[client-adapter.common-1.1.7-SNAPSHOT.jar:na] ... 47 common frames omitted Caused by: org.springframework.boot.context.properties.source.InvalidConfigurationPropertyNameException: Configuration property name '-id' is not valid at org.springframework.boot.context.properties.source.InvalidConfigurationPropertyNameException.throwIfHasInvalidChars(InvalidConfigurationPropertyNameException.java:51) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.source.ConfigurationPropertyName.append(ConfigurationPropertyName.java:189) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$4(Binder.java:335) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:73) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:62) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.JavaBeanBinder.bind(JavaBeanBinder.java:54) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.lambda$null$5(Binder.java:342) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) ~[na:1.8.0_333] at java.util.ArrayList$ArrayListSpliterator.tryAdvance(Unknown Source) ~[na:1.8.0_333] at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) ~[na:1.8.0_333] at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) ~[na:1.8.0_333] at java.util.stream.AbstractPipeline.copyInto(Unknown Source) ~[na:1.8.0_333] at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) ~[na:1.8.0_333] at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) ~[na:1.8.0_333] at java.util.stream.AbstractPipeline.evaluate(Unknown Source) ~[na:1.8.0_333] at java.util.stream.ReferencePipeline.findFirst(Unknown Source) ~[na:1.8.0_333] at org.springframework.boot.context.properties.bind.Binder.lambda$bindBean$6(Binder.java:343) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:442) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder$Context.withBean(Binder.java:428) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder$Context.access$400(Binder.java:382) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.bindBean(Binder.java:340) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:279) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:221) ~[spring-boot-2.0.1.RELEASE.jar:2.0.1.RELEASE] ... 71 common frames omitted
这个是springboot版本的原因,有三种方案
- 升级springboot 2.0.1release版本
- 修改esMaping配置属性_id,_index,_type为id,index,type
- 使用自己的工具包解析yml