ant - java.lang.SecurityException: no manifiest section for signature file( RSA, SF, DSA files and MANIFEST.MF excluded) -


below ant build jar target :

<target name="build jar" depends="compile">          <mkdir dir="${dist.home}" />          <jar destfile="${dist.home}/${app.name}.jar" basedir="${build.home}/classes">             <zipgroupfileset dir="${lib.home}" includes="*.jar" excludes="*.rsa, *.sf, *.dsa, meta-inf/manifest.mf" />                <manifest>                 <attribute name = "main-class" value = "com.karthik.publisher"/>             </manifest>         </jar>      </target> 

when run/execute jar command prompt, below error

error: jni error has occurred, please check installation , try again exception in thread "main" java.lang.securityexception: no manifiest section signature file entry javax/mail/securitysupport.class         @ sun.security.util.signaturefileverifier.verifysection(unknown source)         @ sun.security.util.signaturefileverifier.processimpl(unknown source)         @ sun.security.util.signaturefileverifier.process(unknown source) 

as can see excluded rsa, sf , dsa files , manifest.mf each jar still getting exception.
may know causing issue , how resolve error.

the excludes definition in build jar task covers .rsa .sf , .dsa files in root of jar file. located in meta-inf subdirectory.

  • *.rsa-> covers rsa files in root of zip/jar file merged
  • **/*.rsa-> covers rsa files everywhere in zip/jar file merged
  • meta-inf/*.* -> covers files in meta-inf directory

i recommend use third alternative, don't see reason jar place file in meta-inf directory of merged jar.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -