使用fat jar打包后抛出异常(sqljdbc签名引起)

本文介绍了解决使用Microsoft SQL Server JDBC驱动时遇到的SecurityException问题的方法。通过修改META-INF文件夹中的MANIFEST.MF文件以及其他相关文件,可以有效解决因不匹配的签名导致的应用程序错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题:

Exception in thread "main" java.lang.SecurityException: invalid SHA1 signature file digest for com/microsoft/sqlserver/jdbc/SQLServerException.class

解决方法:

Mircosoft had signed the jar file thru their own tools. So when you try to use the jar file directly or signing by your own tool and using on your JNLP will give this problem.

To solve this problem steps to be followed.

1. Extract the sqljdbc.jar or sqljdbc4.jar file

(解压缩sqljdbc4.jar)
2. Goto META-INF Folder

(进入META-INF文件夹)
3. Open MANIFEST.MF and delete all the lines other than first line and save it

(打开MANIFEST.MF文件,删除第一行之外的所有内容并保存)
4. Delete other files which exist in the same folder

(删除该目录内其他所有文件及文件夹)
5. Finally once again make a new jar file including *com* and *META-INF* folder as sqljdbc.jar or sqljdbc4.jar

(重新将com目录和META-INF目录打包为 sqljdbc.jar或sqljdbc4.jar)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值