sqljdbc problem in artifact

Dear Friends,
I am using Idea 10.5.2 for my projects. I used to compile my app as single jar file which include all required files like jar files.
I am using artifact to make my single jar file.
I always do steps as "Project structure">artifacts>New>Jar>From Modules and Dependencies>
  "select MainClass" and Tick "Extract to target Jar"> tick "Build on Make" and make the project
in my recent project I do same and A single jar file is created. but it gets "A java Exception has occured"!!!!!!
I noticed and found it is related to "sqljdbc v2"!! I replaced with v3 but same problem. I deleted sqljdbs from lib and jar worked properly
What happens when I adding sqljdbs to lib and "extractDirectory" with it.
In shell, I run and found that adding sqljdbc create bellow exception.

Exception in thread "main" java.lang.SecurityException: Invalid signature file
digest for Manifest main attributes
        at sun.security.util.SignatureFileVerifier.processImpl(Unknown Source)
        at sun.security.util.SignatureFileVerifier.process(Unknown Source)
I attached simple sample,
please advise me
Thanks
Tarvirdi



Attachment(s):
JdbcTest.rar.zip
3 comments

Dear friends,
Please answer my question.
Thanks

0

sqljdbc.jar contain digital signatures for its classes in META-INF/ directory. When you extract it into your own jars that MANIFEST.MF file is
replaced by your MANIFEST.MF, so validation fails. Looks like you need to put sqljdbc.jar outside of you jar and link it via Class-Path attribute in
MANIFEST.MF.

--
Nikolay Chashnikov
Software Developer
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

1

I have the same problem. If I compile the same project with eclipse everything is fine. Only in IntelliJ I get problems. Is putting the library outside of the jar the only way or is it possible to compile it like in eclipse? 

0

Please sign in to leave a comment.