Springboot -- 由于jar版本不匹配遇到的问题
网上整合dubbo的例子很多,我这边今天整合了一个例子,但是发现启动dubbo service时候,提示log4j日志类无法找到,启动client的时候,注入的service为空,调试了半天,编码并无误
最终发现是由于版本号的原因,
<dependency>
<groupId>io.dubbo.springboot</groupId>
<artifactId>spring-boot-starter-dubbo</artifactId>
<version>1.0.0</version>
</dependency>
引入的是最新的spring-boot-starter-dubbo的依赖。
使用springboot的版本号:2.0.4.RELEASE
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
在http://mvnrepository.com/artifact/io.dubbo.springboot/spring-boot-starter-dubbo/1.0.0可以注意到依赖的版本关系。


如上图,可以看出springboot2.0.4-RELEASE版本对应的zkclient版本应该为0.10,而spring-boot-starter-dubbo自动引入的zkclient版本为0.7所以会出现一堆难解决的问题,更新后,项目正常运行。
完整pom.xml如下:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId>
<artifactId>spring-boot-dubbo-client</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging> <name>spring-boot-dubbo-client</name>
<description>Demo project for Spring Boot</description> <parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>1.8</java.version>
</properties> <dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency> <!-- https://mvnrepository.com/artifact/io.dubbo.springboot/spring-boot-starter-dubbo -->
<dependency>
<groupId>io.dubbo.springboot</groupId>
<artifactId>spring-boot-starter-dubbo</artifactId>
<version>1.0.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.101tec/zkclient -->
<dependency>
<groupId>com.101tec</groupId>
<artifactId>zkclient</artifactId>
<version>0.10</version>
</dependency> <dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies> <build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build> </project>
Springboot -- 由于jar版本不匹配遇到的问题的更多相关文章
- org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout() mybatis和spring-mybatis版本不匹配问题
java.lang.AbstractMethodError: org.mybatis.spring.transaction.SpringManagedTransaction.getTimeout() ...
- SpringBoot thymeleaf模板版本,thymeleaf模板更换版本
SpringBoot thymeleaf模板版本 thymeleaf模板更换版本 修改thymeleaf模板版本 ================================ ©Copyright ...
- Springboot 打jar包分离lib,配置文件正确方式(二)
Springboot 打jar包分离lib,配置文件正确方式(二) 背景 从<Springboot 打jar包分离lib,配置文件正确方式>中,可以达到把配置文件和依赖第三方的jar包分离 ...
- springboot和springcloud版本冲突问题
最近搭建eureka项目,出现boot和cloud版本不匹配错误,记录下来 2019-12-06 14:00:20.043 ERROR 180780 --- [ main] o.s.boot.Spri ...
- springboot的jar为何能独立运行
欢迎访问我的GitHub https://github.com/zq2599/blog_demos 内容:所有原创文章分类汇总及配套源码,涉及Java.Docker.Kubernetes.DevOPS ...
- Tomcat打包时多项目共享jar和精确指定jar版本
在产品打包发布时一个tomcat中如果存在多个war,部署的一般方式是部署到%TOMCAT_HOME%/webapps目录下,目录结构遵循J2EE规范,把引用的jar放到%TOMCAT_HOME%/w ...
- windbg sos版本不匹配问题解决
dumpheap 时提示: 0:105> !dumpheap -stat The garbage collector data structures are not in a valid sta ...
- bug_ _小心android-support-v4.jar版本混乱造成的NoClassDefFoundError
当你的项目出现以下红色提示的时候,要小心了, 因为很可能因为这个错误而导致解释不通的异常出现. Found 2 versions of android-support-v4.jar in the de ...
- python的tkinter版本不匹配问题:RuntimeError: test:tk.h version (8.4) doesn't match libtk.a version (8.5)
Traceback (most recent call last): File "/root/CodeWorkPace/test/TCPClient.py", line 20, i ...
随机推荐
- webpack 打包编译-webkit-box-orient: vertical 后消失
/* autoprefixer: off */ -webkit-box-orient: vertical; // 参考 https://github.com/postcss/autoprefixer/ ...
- HTML知识点总结[部分]
Web服务的本质(socket实例) import socket def handle_request(client): buf = client.recv(1024) client.send(byt ...
- zabbix自动注册
实现方法是: 第一: 选择动作-->事件源-->自动注册-->创建动作 第二: 动作-->触发条件-->主机元数据-->contains-->Linux 第四 ...
- nginx压测工具--wrk
基本使用 命令行敲下wrk,可以看到使用帮助 Usage: wrk <options> <url> Options: -c, --connections <N> C ...
- VMware ezmomi工具使用
用两个静态IP克隆模板: ezmomi clone --template centos67 --hostname test01 --cpus 2 --mem 4 --ips 172.10.16.203 ...
- POJ1860-Currency Exchange-判正环
两种货币的交换可以当成两条边,建图后跑Bellman_ford算法就好了. Bellman_ford算法可以用来处理负边权,所以可以判断是否存在负环.反过来就可以判断是否存在正环. /*------- ...
- 如何使用JPQL写纯SQL语句
使用JPQL,需要把SQL语句修改成类似HQL 语句.SQL 查询的是数据库,而JPQL 查询的是对象和属性,在语法上是有些不同的.对于有些用JPQL 无法写出来的查询,还是使用原生SQL写出来方便 ...
- 后台CRUD管理jqGrid 插件下载、使用、demo演示
jqGrid:demo?version=5.2.1download src: http://www.trirand.com/blog/ github:https://github.com/tonyto ...
- 洛谷P4155 [SCOI2015]国旗计划(贪心,树形结构,基数排序)
洛谷题目传送门 \(O(n)\)算法来啦! 复杂度优化的思路是建立在倍增思路的基础上的,看看楼上几位巨佬的描述吧. 首先数组倍长是一样的.倍增法对于快速找到\(j\)满足\(l_j+m\le r_i\ ...
- Codeforces Round #463 F. Escape Through Leaf (李超线段树合并)
听说正解是啥 set启发式合并+维护凸包+二分 根本不会啊 , 只会 李超线段树合并 啦 ... 题意 给你一颗有 \(n\) 个点的树 , 每个节点有两个权值 \(a_i, b_i\) . 从 \( ...