-
Notifications
You must be signed in to change notification settings - Fork 7.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[1.1.0]canal与springboot.2.0.4集成异常,guava-18 版本太低,springboot 集成guava-20 #912
Comments
貌似可以解决把? |
我是修改了原代码解决的 import java.util.Map; import com.google.common.cache.CacheBuilder; import com.google.common.base.Function; /**
|
我说的是你在pom里面 都使用到guava的地方 其中一个旧依赖的地方加上exclusion标签,看看能不能解决 |
不行啊,canal依赖的是旧版本guava-18的,用上新guava-20的话其中一个类里过时的方法已经被移除了,想统一用新版本行不通啊,所以我现在修改了canal里面源码,将过期的guava方法替换成新的方式 |
canal使用spring版本为3.2.6,而spring-boot2.0.4依赖spring版本为5.x |
有替换成功的,可以提交一个PR给我 |
@panjianping 兄弟你后来用的是哪个版本的canal 和哪个版本的springboot |
@gezhiwei8899 就用了canal-1.1.0 和 springboot-2.0.4 的,修改了canal 的源码 ZkClientx.java |
我还引入了dubbo根本起不来了 @panjianping |
@panjianping 能不能重新canal的一个方法 避免修改源码嘛 |
@gezhiwei8899 现在主要是问题是,高版本的spring-boot使用的是guava-20,而当前canal中的ZkClientx.java依赖提guava-18中的方法,但这个方法在guava-20中已经被移除了,所以不想修改原码的话,需要使用spring-3.x的版本。我大概想到的解决方法就这个了 |
直接在你的pom里面显示依赖guava-18不就可以了么? 我就是这么解决的
|
java.lang.NoSuchMethodError: com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; at com.google.common.collect.MigrateMap.makeComputingMap(MigrateMap.java:17) ~[canal.common-1.1.0.jar:na] at com.alibaba.otter.canal.common.zookeeper.ZkClientx.<clinit>(ZkClientx.java:26) ~[canal.common-1.1.0.jar:na] at com.alibaba.otter.canal.client.kafka.KafkaCanalConnector.<init>(KafkaCanalConnector.java:52) ~[classes/:na] at com.alibaba.otter.canal.client.kafka.KafkaCanalConnectors.newKafkaConnector(KafkaCanalConnectors.java:47) ~[classes/:na] at com.louxun.search.service.SyncDataToESJob.syncHouseDataToES(SyncDataToESJob.java:41) ~[classes/:na] at com.louxun.search.listener.StartupListener.onApplicationEvent(StartupListener.java:18) ~[classes/:na] at com.louxun.search.listener.StartupListener.onApplicationEvent(StartupListener.java:10) ~[classes/:na] at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:400) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:354) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:888) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:161) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:553) ~[spring-context-5.0.8.RELEASE.jar:5.0.8.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140) ~[spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:398) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:330) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1258) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246) [spring-boot-2.0.4.RELEASE.jar:2.0.4.RELEASE] at com.louxun.search.SearchApplication.main(SearchApplication.java:10) [classes/:na]
The text was updated successfully, but these errors were encountered: