Using SQLJDBC to connect the MSSQL database, the MAVEN generated jar is run and reported "Exception in thread" main "java.lang.SecurityException" error

Source: Internet
Author: User
Tags mssql sha1

The error message is as follows:

Exception in thread "main" Java.lang.SecurityException:Invalid signature file Digest for Manifest main attributes

On the internet, said to need to re-hit SQLJDBC http://blog.chinaunix.net/uid-26706281-id-3210704.html

Copy the contents of the blog:

Plug-in into the jar package run this exception, exception handling methods

1. Extract the source Sqljdbc.jar drive to the SQLJDBC directory

2. Delete files outside Mainfest.mf,zigbert.rsa in the sqljdbc\meta-inf\ directory.

3, modify the MAINFEST.MF in the sqljdbc\meta-inf\ directory, keep the first row, the rest of the deletion

4, RePack: Enter the SQLJDBC directory, execute: Jar CVF Sqljdbc.jar. Note that the last point number cannot be dropped (with a space)

5. Add the newly packaged documents to project projects.

RePack Run, OK

Then I repackaged it because of Maven, so I needed to put the package back into Maven, and my path was

D:\maven\work\com\microsoft\sqlserver\sqljdbc4\4.0

Name must be consistent, my name here is Sqljdbc4-4.0.jar

At the same time, you need to modify the content in Sqljdbc4-4.0.jar.md5 and SQLJDBC4-4.0.JAR.SHA1.

I am using hashmyfiles this software to get the MDT and SHA1, as follows

Http://www.crsky.com/soft/12505.html

Once the above is complete, let eclipse re-reference the SQLJDBC

Ok

Using SQLJDBC to connect the MSSQL database, the MAVEN generated jar is run and reported "Exception in thread" main "java.lang.SecurityException" error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.