Andrew Gein

03/21/2018, 5:43 PM
Hello, my kotlin application (built with ktor and run with netty) works perfectly by
./gradlew run
. But when I run
./gradlew build
and try to start unpacked distr, I receive
Copy code
Caused by: java.lang.LinkageError: loader constraint violation: when resolving method ";Lkotlin/jvm/functions/Function1;)Lkotlin/sequences/Sequence;" the class loader (instance of io/ktor/server/engine/OverridingClassLoader$ChildURLClassLoader) of the current class, org/jetbrains/squash/drivers/JDBCDatabaseSchema, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, kotlin/sequences/SequencesKt___SequencesKt, have different Class objects for the type kotlin/jvm/functions/Function1 used in the signature
        at org.jetbrains.squash.drivers.JDBCDatabaseSchema.tables(JDBCDatabaseSchema.kt:13)
        at org.jetbrains.squash.schema.DatabaseSchemaBase.createStatements(DatabaseSchemaBase.kt:24)
        at org.jetbrains.squash.schema.DatabaseSchemaBase.create(DatabaseSchemaBase.kt:11)
        at org.jetbrains.squash.schema.DatabaseSchemaKt.create(DatabaseSchema.kt:30)
As you can see, I use H2 database as squash as ORM. Have you ever seen this error? Where I may be wrong?