dubbo升级(com.alibaba.dubbo 2.6.6 升级为org.apache.dobbu 2.7.12)
1. 报错信息:
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call the method org.apache.curator.framework.api.CreateBuilder.creatingParentsIfNeeded()Lorg/apache/curator/framework/api/ProtectACLCreateModePathAndBytesable; but it does not exist. Its class, org.apache.curator.framework.api.CreateBuilder, is available from the following locations:
jar:file:/D:/Plug/localRepository-tiancheng/org/apache/curator/curator-framework/4.2.0/curator-framework-4.2.0.jar!/org/apache/curator/framework/api/CreateBuilder.class
It was loaded from the following location:
file:/D:/Plug/localRepository-tiancheng/org/apache/curator/curator-framework/4.2.0/curator-framework-4.2.0.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.apache.curator.framework.api.CreateBuilder
报错原因: curator-framework-4.2.0 4.x的版本对zk 3.x的版本不支持,缺少creatingParentsIfNeeded(),在curator-framework-2.12.0中是存在的(简单描述:zk不支持高版本的curator-framework) 解决办法: 降低curator-framework 的版本 或者 重写源码通过其他的方式实现 creatingParentsIfNeeded() 方法所提供的功能
2. 报错信息:
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call the method org.apache.curator.framework.api.ExistsBuilder.creatingParentContainersIfNeeded()Lorg/apache/curator/framework/api/ExistsBuilderMain; but it does not exist. Its class, org.apache.curator.framework.api.ExistsBuilder, is available from the following locations:
jar:file:/D:/Plug/localRepository-tiancheng/org/apache/curator/curator-framework/4.2.0/curator-framework-4.2.0.jar!/org/apache/curator/framework/api/ExistsBuilder.class
It was loaded from the following location:
file:/D:/Plug/localRepository-tiancheng/org/apache/curator/curator-framework/4.2.0/curator-framework-4.2.0.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.apache.curator.framework.api.ExistsBuilder
原因:缺少jar包 curator-recipes 解决办法: 引入 org.apache.curator curator-recipes
3. 报错信息:
Could not find artifact io.swagger:swagger-jaxrs:pom:unknown in snapshots
原因:当前 swagger-jaxrs 未指定version
4. 报错信息:
java.lang.ClassCastException: [Lcom.alibaba.dubbo.config.annotation.Method; cannot be cast to [Lorg.apache.dubbo.config.annotation.Method;
at org.apache.dubbo.config.spring.beans.factory.annotation.ServiceClassPostProcessor.convertMethodConfigs(ServiceClassPostProcessor.java:487)
at org.apache.dubbo.config.spring.beans.factory.annotation.ServiceClassPostProcessor.buildServiceBeanDefinition(ServiceClassPostProcessor.java:419)
at org.apache.dubbo.config.spring.beans.factory.annotation.ServiceClassPostProcessor.registerServiceBean(ServiceClassPostProcessor.java:294)
at org.apache.dubbo.config.spring.beans.factory.annotation.ServiceClassPostProcessor.registerServiceBeans(ServiceClassPostProcessor.java:176)
at org.apache.dubbo.config.spring.beans.factory.annotation.ServiceClassPostProcessor.postProcessBeanDefinitionRegistry(ServiceClassPostProcessor.java:135)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:125)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:316)
at com.bestpay.cf.web.DomainApplication.main(DomainApplication.java:46)
原因: 当前项目中存在 com.alibaba.dubbo.config.annotation 解决办法: 将com.alibaba 引用 改为 org.apache 包下的引用(比如Service 改为 DubboService)
jar包冲突:推荐使用IDEA的maven-helper插件https://plugins.jetbrains.com/plugin/7179-maven-helper 推荐查看jar依赖网站:https://mvnrepository.com/artifact/org.apache.dubbo/dubbo/2.7.12 其余信息上Google 或者 官网
|