Skip to content

Fix Kotlin classloader conflict with SyntaxDB on Paper - #31

Merged
WieszczY85 merged 1 commit into
mainfrom
fix/kotlin-runtime-classloader
Oct 15, 2026
Merged

WieszczY85 merged 1 commit into
mainfrom
fix/kotlin-runtime-classloader

Conversation

@WieszczY85

Copy link
Copy Markdown
Member

PlotsX 1.0.0-profile.1 fails during enable on Paper 26.2 with a loader constraint violation in Database.Companion.connect(DatabaseType, Function1). The shaded plugin JAR supplies Kotlin to the plugin classloader, while externally resolved SyntaxDB sees another Kotlin copy in Paper's library classloader. Their Function1 types are incompatible.

This makes the bootstrap loader Java, explicitly resolves compiler-matching kotlin-stdlib through paper-libraries.yml, and excludes Kotlin dependencies from the shaded JAR. PlotsX and SyntaxDB then share Kotlin from the library classloader. Repository assignments and manifest validation remain supported. Version: 1.0.0-profile.2; profile APIs, configuration and database schema are unchanged.

A new verifyRuntimePackaging task is part of check/build: it rejects bundled Kotlin classes, a missing runtime coordinate and Kotlin references in the bootstrap loader. Four loader unit tests cover manifest parsing and repository routing. The Paper acceptance harness now checks real Function1 class identity and uses SyntaxDB's scoped connection lifecycle instead of the removed getConnection() helper.

Validation:

  • Java 21: ./gradlew test buildAll liveTestJar foliaLiveTestJar --console=plain — 221 tests, no failures/errors/skips; packaging verification passed.
  • Disposable localhost Paper 26.2-134, Java 25, empty SQLite database: acceptance result PASS. Verified plugin enable/migrations, shared Kotlin Function1, both plot geometries, owner/visitor protection, piston/fluid boundaries, publication failure/recovery, claim/delete and async reload.
  • The local runtime test used build 134, not the reported build 129. No production game files or database were touched.

Deployment: stop the server, replace the previous PlotsX JAR with PlotsX-Paper-1.0.0-profile.2.jar (remove the old duplicate), keep configuration/database, then start fully. No /reload or database reset is required.

@WieszczY85
WieszczY85 merged commit 579c029 into main Oct 15, 2026
1 check passed
@WieszczY85
WieszczY85 deleted the fix/kotlin-runtime-classloader branch October 15, 2026 18:37
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

Successfully merging this pull request may close these issues.

1 participant