spark,poi,jar包冲突(commons.io)

server/2024/10/25 14:35:17/

1.查看报错类是属于哪个jar

System.out.println("ZipArchiveInputStream类是:" + ZipArchiveInputStream.class.getProtectionDomain().getCodeSource().getLocation());
System.out.println("UnsynchronizedByteArrayOutputStream 类是:" + UnsynchronizedByteArrayOutputStream.class.getProtectionDomain().getCodeSource().getLocation());
System.out.println("IOUtils 类是:" + IOUtils.class.getProtectionDomain().getCodeSource().getLocation());

2.使用shade来打包并隔离依赖,就是重命名包名

<plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-shade-plugin</artifactId><version>3.2.4</version><executions><execution><phase>package</phase><goals><goal>shade</goal></goals><configuration><relocations><relocation><pattern>org.apache.commons.io</pattern><shadedPattern>myshade.org.apache.commons.io</shadedPattern></relocation></relocations></configuration></execution></executions>
</plugin>

3.排除jar

<dependency><groupId>org.apache.spark</groupId><artifactId>spark-core_${scala.version}</artifactId><version>${spark.version}</version><exclusions><exclusion><artifactId>jackson-annotations</artifactId><groupId>com.fasterxml.jackson.core</groupId></exclusion><exclusion><artifactId>jackson-core</artifactId><groupId>com.fasterxml.jackson.core</groupId></exclusion><exclusion><artifactId>jackson-databind</artifactId><groupId>com.fasterxml.jackson.core</groupId></exclusion><exclusion><artifactId>jackson-module-scala_2.11</artifactId><groupId>com.fasterxml.jackson.module</groupId></exclusion><exclusion><artifactId>commons-compress</artifactId><groupId>org.apache.commons</groupId></exclusion></exclusions>
<!--            <scope>provided</scope>-->
</dependency>

4.引入jar

<dependency><groupId>commons-io</groupId><artifactId>commons-io</artifactId><version>2.17.0</version>
</dependency>
<dependency><groupId>org.apache.commons</groupId><artifactId>commons-compress</artifactId><version>1.18</version>
</dependency>


http://www.ppmy.cn/server/122319.html

相关文章

BeautifulSoup4在爬虫中的使用

简称bs4&#xff0c;是一个工具箱&#xff0c;通过解析文档为用户提供需要抓取的数据 bs4是Python的一个库&#xff0c;最主要的功能是从网页中获取数据 一、bs4支持的解析器 1、Python标准库 2、lxml HTML解析器 lxml匹配结构规则 3、html5lib 二、提取数据 1、根据标…

力扣 中等 445.两数相加 II

文章目录 题目介绍题解 题目介绍 题解 首先反转两个链表&#xff0c;再调用 2. 两数相加 链接的代码&#xff0c;得到链表&#xff0c;最后将其翻转即可。 class Solution {public ListNode addTwoNumbers(ListNode l1, ListNode l2) {l1 reverseList(l1);l2 reverseList(l…

【国家博物馆应对黄牛办法解析】

一 国家博物馆预约流程及独家预约问题 微信公众号的预约引导页&#xff0c;有微信小程序和PC端预约两种方式&#xff1a; PC端预约和微信小程序明明是两中方式&#xff0c;现在却变成一种了&#xff0c; 为何不能在支付宝小程序预约&#xff1f; 独家的背后往往有故事&#x…

村田发布全球最小016008尺寸MLCC电容

全球积层陶瓷电容&#xff08;MLCC&#xff09;领域的领航者——村田制作所&#xff08;Murata Mfg&#xff09;&#xff0c;再次以科技创新的璀璨光芒照亮了电子元器件的微小世界&#xff0c;震撼发布了其全球范围内前所未有的“016008”尺寸MLCC产品。这款产品的问世&#xf…

FOC代码详解介绍(转载)

1、SimpleFOC&#xff08;八&#xff09;—— 理论实践 深度分析SVPWM_svpwm的原理及法则推导和控制算法详解-CSDN博客 2、SVPWM算法原理及详解-CSDN博客 3、FOC和SVPWM的C语言代码实现_svpwm代码-CSDN博客 4、[FOC-Stm32]设置PWM占空比&#xff08;比较值&#xff09;的几种方…

【PG备份恢复】基于时间点的恢复(踩坑指南)

目录 1 设置基于时间点恢复所需的配置 1.1 修改配置文件 postgresql.conf 1.2 生效配置 2 进行一次全备 3 模拟增量数据插入 4 查看当前时间点&#xff0c;LSN号&#xff0c;XID 事务ID&#xff0c;当前的WAL 文件等 5 进行一次WAL 日志的切换 6 模拟故障发生 7 进行…

18-pg内核之日志管理器(六)checkpoint

概念 数据库中除了实际存储的数据之外&#xff0c;还存在许多事务相关的日志&#xff0c;如WAL日志&#xff0c;CLOG日志。MultiXact日志等&#xff0c;每次包含DML操作的事务都会产生这些日志&#xff0c;随着时间的推移&#xff0c;如果不进行清理&#xff0c;日志会一直增大…

react crash course 2024(7) react router dom

安装 npm i react-router-dom 引入 import {Route,createBrowserRouter,createRoutesFromElements,RouterProvider} from react-router-dom 在app.jsx const router createBrowserRouter(createRoutesFromElements(<Route index element {<h1>My App</h1>…