解压修改jar包后运行报错:Unable to open nested entry ‘BOOT-INF/lib/**.jar‘. It has been compressed

背景

打部署jar包后,使用winwar解压工具,修改了里面的配置文件,和lib里面的一个引用包的配置文件,报这个错:

Unable to open nested entry 'BOOT-INF/lib/**.jar'. It has been compressed

错误原因

这是说这个jar包访问失败,错误原因是,使用winrar或者7zip解压工具,点开后修改lib内的第二层jar包,修改后重新保存的时候,对lib内的jar包进行了重复压缩,所以访问不到。

解决方案

windows:

Windows有2种解决方案:

解决方案一

使用WinRAR打开,将刚刚修改,被重复压缩报错的那个lib内的jar包挪出来,使用 WinRAR的功能添加-》文件-》不压缩直接存储的文件,填写lib包的本地路径,把lib包重新添加进去,

解决方案二

将jar包文件后缀手动改成rar,解压,然后重新压缩成rar,将结尾后缀改成jar,重新运行。

linux:

linux的思路和windows的方案2一样,都是解压之后重新打包。

linux解压:

jar -xf xxx.jar

解压jar包之后,找到里面的lib包,找到那个有问题的jar包,把那个jar包再解压一次,然后再压缩回去。

linux重新压缩:

jar -cfM0 ./

后面的 ./ 是要压缩的文件夹路径

WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by com.alipay.sofa.jraft.util.internal.UnsafeUtil (jar:file:/E:/service/nacos-server-2.2.3/nacos/target/nacos-server.jar!/BOOT-INF/lib/jraft-core-1.3.12.jar!/) to field java.nio.Buffer.address WARNING: Please consider reporting this to the maintainers of com.alipay.sofa.jraft.util.internal.UnsafeUtil WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release 2023-07-15 22:58:51,129 WARN Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'instanceOperatorClientImpl' defined in URL [jar:file:/E:/service/nacos-server-2.2.3/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.3.jar!/com/alibaba/nacos/naming/core/InstanceOperatorClientImpl.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'clientOperationServiceProxy' defined in URL [jar:file:/E:/service/nacos-server-2.2.3/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.3.jar!/com/alibaba/nacos/naming/core/v2/service/ClientOperationServiceProxy.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'persistentClientOperationServiceImpl' defined in URL [jar:file:/E:/service/nacos-server-2.2.3/nacos/target/nacos-server.jar!/BOOT-INF/lib/nacos-naming-2.2.3.jar!/com/alibaba/nacos/naming/core/v2/service/impl/PersistentClientOperationServiceImpl.class]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.alibaba.nacos.naming.core.v2.service.impl.PersistentClientOperationServiceImpl]: Constructor threw exception; nested exception is java.lang.UnsatisfiedLinkError: C:\Users\Administrator\AppData\Local\Temp\librocksdbjni15037951375079649142.dll: %
07-16
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值