Spark & Scala
GCP Exception - Invalid signature file
구티맨
2020. 2. 17. 14:08
META-INF 폴더에 있는 서명파일이 유효하지 않아 아래와 같은 runtime Exception 이 발생하는 경우가 있다.
Exception in thread "main" [java.lang.SecurityException:](java.lang.SecurityException:) Invalid signature file digest for Manifest main attributes
이때는, uber Jar 에 포함되어 있는 서명파일을 제거 해줘야 한다.
filters를 사용하여 Jar에 포함되지 않도록 한다.
<configuration>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass><!-- YOUR_APPLICATION_MAIN_CLASS --></mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/maven/**</exclude>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
참조
https://cloud.google.com/dataproc/docs/guides/manage-spark-dependencies?hl=ko