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

Server Tap Plugin Incompatibility with EcoSkills #203

Closed
fendyk opened this issue Apr 7, 2023 · 6 comments
Closed

Server Tap Plugin Incompatibility with EcoSkills #203

fendyk opened this issue Apr 7, 2023 · 6 comments

Comments

@fendyk
Copy link

fendyk commented Apr 7, 2023

New Issue Report: Server Tap Plugin Incompatibility with EcoSkills

Description

The 'Server Tap' plugin is incompatible with the 'EcoSkills' plugin, causing a java.lang.LinkageError related to the kotlin.Lazy interface. This issue might be resolved by updating the 'Server Tap' plugin to avoid shading Kotlin.

Error

[00:20:43] [Server thread/ERROR]: Error occurred while enabling EcoSkills v1.116.6 (Is it up to date?)
java.lang.LinkageError: loader constraint violation: loader 'EcoSkills v1.116.6.jar' @30474815 wants to load interface kotlin.Lazy. A different interface with the same name was previously loaded by 'ServerTap-0.4.0.jar' @1d582808. (kotlin.Lazy is in unnamed module of loader 'ServerTap-0.4.0.jar' @1d582808, parent loader java.net.URLClassLoader @7aec35a)
at com.willfp.ecoskills.libreforge.LibReforgePlugin.getLrcdbYml(LibReforge.kt:75) ~[EcoSkills v1.116.6.jar:?]
at com.willfp.ecoskills.libreforge.LibReforgePlugin.fetchConfigs(LibReforge.kt:164) ~[EcoSkills v1.116.6.jar:?]
at com.willfp.ecoskills.skills.CustomSkills.update(CustomSkills.java:40) ~[EcoSkills v1.116.6.jar:?]
at com.willfp.ecoskills.skills.Skills.update(Skills.java:77) ~[EcoSkills v1.116.6.jar:?]
at com.willfp.ecoskills.skills.Skills.<clinit>(Skills.java:85) ~[EcoSkills v1.116.6.jar:?]
at com.willfp.ecoskills.EcoSkillsPlugin.handleEnableAdditional(EcoSkillsPlugin.java:70) ~[EcoSkills v1.116.6.jar:?]

Possible Solution

Update the 'Server Tap' plugin to avoid shading Kotlin. Here's an example using Gradle:

plugins {
    id 'com.github.johnrengelman.shadow' version '7.1.2'
    id("org.jetbrains.kotlin.jvm") version "1.8.20-RC"
    id 'java'
}

sourceSets {
    main {
        kotlin {
            srcDirs += 'src/main/java'
            srcDirs += 'src/main/kotlin'
            srcDirs += 'src/main/kotlin/nameofpackage' // Add the new package here
        }
    }
}

shadowJar {
    archiveBaseName.set('Plugin name')
    archiveVersion.set('1.0.0')
    archiveClassifier.set('all')
    dependencies {
        exclude(dependency('org.jetbrains.kotlin:kotlin-stdlib')) // Exclude kotlin here
    }
}
@phybros
Copy link
Collaborator

phybros commented Apr 14, 2023

@fendyk are you able to test the latest version? I'm sure it's still an issue but it would be nice to be sure

@phybros
Copy link
Collaborator

phybros commented Apr 14, 2023

For reference, the error in ServerTap when excluding kotlin-stdlib is

[15:26:31 ERROR]: Error occurred while enabling ServerTap v0.5.2-SNAPSHOT (Is it up to date?)
java.lang.NoClassDefFoundError: kotlin/NoWhenBranchMatchedException
	at io.javalin.config.PrivateConfig.<init>(PrivateConfig.kt:22) ~[ServerTap-0.5.2-SNAPSHOT.jar:?]
	at io.javalin.config.JavalinConfig.<init>(JavalinConfig.kt:26) ~[ServerTap-0.5.2-SNAPSHOT.jar:?]
	at io.javalin.Javalin.<init>(Javalin.java:55) ~[ServerTap-0.5.2-SNAPSHOT.jar:?]
	at io.javalin.Javalin.create(Javalin.java:92) ~[ServerTap-0.5.2-SNAPSHOT.jar:?]
	at io.servertap.PluginEntrypoint.onEnable(PluginEntrypoint.java:98) ~[ServerTap-0.5.2-SNAPSHOT.jar:?]
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:279) ~[paper-api-1.19.4-R0.1-SNAPSHOT.jar:?]

Seems that javalin relies on that functionality

@fendyk
Copy link
Author

fendyk commented Apr 14, 2023

I can confirm that the current issues have resolved by using the latest version of your plugin. thank you!

@phybros
Copy link
Collaborator

phybros commented Apr 14, 2023

I'm honestly very surprised @fendyk!

I was sure it would still conflict with Eco.

Out of curiosity, which Java version are you using?

@fendyk
Copy link
Author

fendyk commented Apr 15, 2023

I use OpenJDK 19.0.2 @phybros.

@phybros
Copy link
Collaborator

phybros commented Apr 16, 2023

Thanks for the info! I'll close this issue out then

@phybros phybros closed this as completed Apr 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants