Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SNOW-1008792: since 3.13.19 , I can not package the snowflake-jdbc into my fat jar #1606

Closed
sunscorch opened this issue Jan 14, 2024 · 2 comments
Labels

Comments

@sunscorch
Copy link

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of JDBC driver are you using?
    3.13.18 working, after that version , I fails

  2. What operating system and processor architecture are you using?
    I use window to complies this.

  3. What version of Java are you using?
    I use zulu-1.8 (1.9.0_392)

  4. What did you do?
    I this below pom to package snowflake jdbc in to a fat jar, it throw me the error Unsupported class file major version 59

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 <modelVersion>4.0.0</modelVersion>

 <groupId>com.uprr.azure</groupId>
 <artifactId>snowflake-streaming</artifactId>
 <version>1.0.0</version>

 <properties>
   <jdk.version>1.8</jdk.version>
 </properties>

 <dependencies>
   <dependency>
     <groupId>net.snowflake</groupId>
     <artifactId>snowflake-ingest-sdk</artifactId>
     <version>2.0.3</version>
     <exclusions>
       <exclusion>
       <groupId>net.snowflake</groupId>
       <artifactId>snowflake-jdbc</artifactId>
       </exclusion>
     </exclusions>
   </dependency>
   <dependency>
     <groupId>net.snowflake</groupId>
     <artifactId>snowflake-jdbc</artifactId>
     <version>3.14.4</version>
   </dependency>
   <dependency>
     <groupId>org.apache.spark</groupId>
     <artifactId>spark-sql_2.12</artifactId>
     <scope>provided</scope>
     <version>3.4.1</version>
   </dependency>
 </dependencies>

 <build>
 <plugins>
   <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-compiler-plugin</artifactId>
       <version>3.11.0</version>
       <configuration>
         <source>${jdk.version}</source>
         <target>${jdk.version}</target>
       </configuration>
     </plugin>
   <plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-shade-plugin</artifactId>
     <version>3.2.1</version>
     <executions>
       <execution>
         <phase>package</phase>
         <goals>
           <goal>shade</goal>
         </goals>
         <configuration>
           <filters>
             <filter>
               <artifact>*:*</artifact>
               <excludes>
                 <exclude>META-INF/*.SF</exclude>
                 <exclude>META-INF/*.DSA</exclude>
                 <exclude>META-INF/*.RSA</exclude>
               </excludes>
             </filter>
           </filters>
           <relocations>
             <relocation>
               <pattern>net.snowflake.ingest</pattern>
               <shadedPattern>shade.com.net.snowflake.ingest</shadedPattern>
             </relocation>
           </relocations>
         </configuration>
       </execution>
     </executions>
   </plugin>
 </plugins>
 </build>
</project>	

After I remove it works fine,

<dependency>
      <groupId>net.snowflake</groupId>
      <artifactId>snowflake-jdbc</artifactId>
      <version>3.14.4</version>
    </dependency>
  1. What did you expect to see?
    if you change the snowflake-jdbc to 3.13.18, it works fine,
<dependency>
      <groupId>net.snowflake</groupId>
      <artifactId>snowflake-jdbc</artifactId>
      <version>3.13.18</version>
    </dependency>

when we use 3.13.19 or later, we get Unsupported class file major version 59

@sunscorch sunscorch added the bug label Jan 14, 2024
@github-actions github-actions bot changed the title since 3.13.19 , I can not package the snowflake-jdbc into my fat jar SNOW-1008792: since 3.13.19 , I can not package the snowflake-jdbc into my fat jar Jan 14, 2024
@sfc-gh-dprzybysz
Copy link
Collaborator

Hi @sunscorch
I tried to build using your pom.xml - indeed it causes the problem and it's because of Java 15 classes (or higher) from META-INF/versions:

META-INF/versions/15/org/bouncycastle/jcajce/provider/asymmetric/edec/SignatureSpi$Ed25519.class: java.lang.IllegalArgumentException: Unsupported class file major version 59

I found that to solve that you can use higher version of shade-maven-plugin e.g. 3.4.1 (as it is used in snowflake-jdbc)
It's not a bug in snowflake-jdbc

@sunscorch
Copy link
Author

thanks a lot for your information, great help from your side

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants