开发者社区> 问答> 正文

下载的canal.adapter1.1.2,准备做es同步,但是启动后不会同步

我下载的canal.adapter1.1.2,准备做es同步,但是启动后不会同步,并且8081端口没有开启,日志文件提示是

Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationContextInitializer : org.springframework.boot.autoconfigure.SharedMetadataReaderFactoryContextInitializer at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:448) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:427) at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:418) at org.springframework.boot.SpringApplication.(SpringApplication.java:266) at org.springframework.boot.SpringApplication.(SpringApplication.java:247) at com.alibaba.otter.canal.adapter.launcher.CanalAdapterApplication.main(CanalAdapterApplication.java:17) Caused by: java.lang.NoClassDefFoundError: org/springframework/core/KotlinDetector at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:169) at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:444) ... 5 more Caused by: java.lang.ClassNotFoundException: org.springframework.core.KotlinDetector at java.net.URLClassLoader.findClass(URLClassLoader.java:382) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

配置文件如下

server: port: 80811 logging: level: org.springframework: WARN com.alibaba.otter.canal.client.adapter.hbase: DEBUG com.alibaba.otter.canal.client.adapter.es: DEBUG com.alibaba.otter.canal.client.adapter.rdb: DEBUG spring: jackson: date-format: yyyy-MM-dd HH:mm:ss time-zone: GMT+8 default-property-inclusion: non_null canal.conf: canalServerHost: 127.0.0.1:11111

zookeeperHosts: slave1:2181

batchSize: 500 syncBatchSize: 1000 retries: 0 timeout:

accessKey:

secretKey:

mode: tcp srcDataSources: defaultDS: url: jdbc:mysql://mydb.mysql.rds.aliyuncs.com:3306/mydb?useUnicode=true username: test password: test_1234xxxxxxx canalAdapters: - instance: example # canal instance Name or mq topic name groups: - groupId: g1 outerAdapters: - name: es hosts: 100.66.222.xxx:9300 properties: cluster.name: my-test

es 配置

dataSourceKey: defaultDS destination: example esMapping: _index: my_index _type: product _id: _id

pk: id

sql: "SELECT p.id as _id, p.id as id, p.category_id, p.name FROM product p"

objFields:

sku_code: array:;

etlCondition: "" commitBatch: 1000

我需要怎么做呢? 谢谢!

原提问者GitHub用户elim051

展开
收起
古拉古拉 2023-05-08 17:06:47 152 0
1 条回答
写回答
取消 提交回答
  • 重新更新一下代码, 之前spring版本有冲突

    原回答者GitHub用户agapple

    2023-05-09 18:36:55
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载