scalaj-http icon indicating copy to clipboard operation
scalaj-http copied to clipboard

NoSuchMethodError in runtime for scalaj-http_2.12

Open HetongWang opened this issue 4 years ago • 0 comments

It seems the scalaj-http_2.12 package is compiled with 2.11. I got the following Exception in runtime. java.lang.NoSuchMethodError: scala.Product.$init$(Lscala/Product;)

Here is the dependency

<dependency>
                <groupId>org.scalaj</groupId>
                <artifactId>scalaj-http_2.12</artifactId>
                <version>2.4.2</version>
</dependency>

Here is the decompiled source code where invoking scala/Product

  private scalaj.http.BuildInfo$();
    Code:
       0: aload_0
       1: invokespecial #69                 // Method java/lang/Object."<init>":()V
       4: aload_0
       5: putstatic     #68                 // Field MODULE$:Lscalaj/http/BuildInfo$;
       8: aload_0
       9: invokestatic  #73                 // InterfaceMethod scala/Product.$init$:(Lscala/Product;)V
      12: aload_0
      13: ldc           #75                 // String 2.4.2
      15: putfield      #22                 // Field version:Ljava/lang/String;
      18: aload_0
      19: new           #77                 // class scala/collection/immutable/StringOps

HetongWang avatar Mar 08 '21 04:03 HetongWang