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

来源:互联网 发布:耐思尼克域名 编辑:程序博客网 时间:2024/05/13 21:53

问题:

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)

原创粉丝点击