rikusen0335
11/25/2019, 11:00 AMjava.lang.NoClassDefFoundError: org/jetbrains/exposed/sql/Database
.
Does anyone know how this happen and a solution for this? Thanks.
This project using Gradle, JVM.marstran
11/25/2019, 11:02 AMrikusen0335
11/25/2019, 11:05 AMbuild.gradle
,
repositories {
jcenter()
}
dependencies {
compile "org.jetbrains.exposed:exposed:0.17.7"
compile "org.xerial:sqlite-jdbc:3.21.0.1"
}
marstran
11/25/2019, 11:13 AMrikusen0335
11/25/2019, 11:16 AMrepositories {
jcenter()
}
dependencies {
compile 'org.jetbrains.exposed:exposed-core:0.18.1'
compile 'org.jetbrains.exposed:exposed-dao:0.18.1'
compile 'org.jetbrains.exposed:exposed-jdbc:0.18.1'
compile "org.xerial:sqlite-jdbc:3.21.0.1"
}
Database.connect("jdbc:sqlite:file:test?mode=memory&cache=shared", "org.sqlite.JDBC")
Douglas KN
11/25/2019, 11:33 AM"jdbc:sqlite:test.sqlite"
marstran
11/25/2019, 11:38 AMDatabase
doesn't exist.gradle dependencies
do view your dependency tree.rikusen0335
11/25/2019, 11:58 AMtestRuntimeClasspath - Runtime classpath of compilation 'test' (target (jvm)).
+--- org.jetbrains.exposed:exposed-core:0.18.1
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.3.60
| | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.60
| | \--- org.jetbrains:annotations:13.0
| +--- org.jetbrains.kotlin:kotlin-reflect:1.3.50
| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.3.60 (*)
| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0-M1
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.31 -> 1.3.60 (*)
| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.31 -> 1.3.60
| \--- org.slf4j:slf4j-api:1.7.25
+--- org.jetbrains.exposed:exposed-dao:0.18.1
| \--- org.jetbrains.exposed:exposed-core:0.18.1 (*)
+--- org.jetbrains.exposed:exposed-jdbc:0.18.1
| \--- org.jetbrains.exposed:exposed-core:0.18.1 (*)
+--- org.xerial:sqlite-jdbc:3.21.0.1
+--- org.jetbrains.kotlin:kotlin-stdlib:1.3.60 (*)
\--- junit:junit:4.12
\--- org.hamcrest:hamcrest-core:1.3
Douglas KN
11/25/2019, 12:31 PMIgor Dzichkovskii
11/25/2019, 12:39 PMrikusen0335
11/25/2019, 1:28 PMimplementation - Implementation only dependencies for compilation 'main' (target (jvm)). (n)
\--- org.jetbrains.kotlin:kotlin-stdlib:1.3.60 (n)
implementationDependenciesMetadata
+--- org.jetbrains.exposed:exposed-core:0.18.1
| +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.3.60
| | +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.60
| | \--- org.jetbrains:annotations:13.0
| +--- org.jetbrains.kotlin:kotlin-reflect:1.3.50
| | \--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.3.60 (*)
| +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0-M1
| | +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.31 -> 1.3.60 (*)
| | \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.3.31 -> 1.3.60
| \--- org.slf4j:slf4j-api:1.7.25
+--- org.jetbrains.exposed:exposed-dao:0.18.1
| \--- org.jetbrains.exposed:exposed-core:0.18.1 (*)
+--- org.jetbrains.exposed:exposed-jdbc:0.18.1
| \--- org.jetbrains.exposed:exposed-core:0.18.1 (*)
+--- org.xerial:sqlite-jdbc:3.21.0.1
\--- org.jetbrains.kotlin:kotlin-stdlib:1.3.60 (*)
Igor Dzichkovskii
11/25/2019, 1:35 PMrikusen0335
11/25/2019, 1:38 PMbuild.gradle
, I have only 1Igor Dzichkovskii
11/25/2019, 1:40 PMrikusen0335
11/25/2019, 1:40 PMIgor Dzichkovskii
11/25/2019, 1:57 PMrikusen0335
11/25/2019, 2:00 PMbuild.gradle
:
apply plugin: 'java'
apply plugin: 'kotlin'
group = pluginGroup
version = pluginVersion
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
repositories {
mavenCentral()
jcenter()
maven {
name = 'papermc-repo'
url = '<https://papermc.io/repo/repository/maven-public/>'
}
maven {
name = 'sonatype'
url = '<https://oss.sonatype.org/content/groups/public/>'
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compileOnly 'org.spigotmc:spigot-api:1.14.4-R0.1-SNAPSHOT'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'org.jetbrains.exposed:exposed-core:0.18.1'
compile 'org.jetbrains.exposed:exposed-dao:0.18.1'
compile 'org.jetbrains.exposed:exposed-jdbc:0.18.1'
compile 'org.xerial:sqlite-jdbc:3.21.0.1'
}
import org.apache.tools.ant.filters.ReplaceTokens
processResources {
from(sourceSets.main.resources.srcDirs) {
filter ReplaceTokens, tokens: [version: version]
}
}
buildscript {
ext {
kotlin_version = '1.3.60'
junit_version = '4.12'
spigot_version = '1.14.1-R0.1-SNAPSHOT'
}
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Igor Dzichkovskii
11/25/2019, 2:09 PMrikusen0335
11/25/2019, 2:10 PMIgor Dzichkovskii
11/25/2019, 2:12 PMKotlin-reflect
as a dependency. You can try to do it this way: https://stackoverflow.com/questions/48742377/kotlin-gradle-make-sure-you-have-kotlin-reflect-jar-in-the-classpathrikusen0335
11/25/2019, 2:35 PMIgor Dzichkovskii
11/25/2019, 2:36 PMrikusen0335
11/25/2019, 2:46 PMdependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compileOnly 'org.spigotmc:spigot-api:1.14.4-R0.1-SNAPSHOT'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
compile 'org.jetbrains.exposed:exposed-core:0.18.1'
compile 'org.jetbrains.exposed:exposed-dao:0.18.1'
compile 'org.jetbrains.exposed:exposed-jdbc:0.18.1'
compile 'org.xerial:sqlite-jdbc:3.21.0.1'
}
Igor Dzichkovskii
11/25/2019, 3:21 PMrikusen0335
11/25/2019, 3:44 PMIgor Dzichkovskii
11/25/2019, 5:12 PMrikusen0335
11/25/2019, 5:17 PM