Skip to content

Conversation

Copy link

Copilot AI commented Nov 23, 2025

Application failed on startup with NoClassDefFoundError: Could not initialize class dev.slne.surf.chat.core.common.util.SyncValues caused by missing UUID serializer in kotlinx.serialization. Error occurred during PreLoginChatTask when IgnoreListRepository.cacheIgnorelist attempted class initialization.

Changes

Created /surf-chat-core/src/main/kotlin/dev/slne/surf/chat/core/common/util/SyncValues.kt:

  • UUIDSerializer: Custom KSerializer<UUID> that serializes UUIDs as strings. Includes error handling that wraps IllegalArgumentException in SerializationException with format expectations.

  • SyncValues object: Provides serializersModule with contextual UUID serialization and pre-configured json instance for immediate use.

object UUIDSerializer : KSerializer<UUID> {
    override val descriptor = PrimitiveSerialDescriptor("UUID", PrimitiveKind.STRING)
    
    override fun serialize(encoder: Encoder, value: UUID) {
        encoder.encodeString(value.toString())
    }
    
    override fun deserialize(decoder: Decoder): UUID {
        val uuidString = decoder.decodeString()
        return try {
            UUID.fromString(uuidString)
        } catch (e: IllegalArgumentException) {
            throw SerializationException("Invalid UUID format: '$uuidString'", e)
        }
    }
}

Usage: Use SyncValues.json for serializing data with UUID fields, or include SyncValues.serializersModule in custom Json configurations.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • repo.slne.dev
    • Triggering command: /usr/lib/jvm/temurin-17-jdk-amd64/bin/java /usr/lib/jvm/temurin-17-jdk-amd64/bin/java --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED --add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.xml/javax.xml.namespace=ALL-UNNAMED -XX:MaxMetaspaceSize=384m -XX:&#43;HeapDumpOnOutOfMemoryError -Xms256m -Xmx512m -Dfile.encoding=UTF-8 -Duser.country -Duser.language=en (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

can you fix this

[23.11.2025 10:25:18 ERROR]: Failed to run pre player join task: PreLoginChatTask for player: 1c779cb1-3860-4e23-9cac-7f160b2acc61
java.lang.NoClassDefFoundError: Could not initialize class dev.slne.surf.chat.core.common.util.SyncValues
at surf-chat-server-1.21.10-4.1.5-SNAPSHOT-all.jar/dev.slne.surf.chat.server.database.repository.IgnoreListRepository.cacheIgnorelist$suspendImpl(IgnoreListRepository.kt:17) ~[?:?]
at surf-chat-server-1.21.10-4.1.5-SNAPSHOT-all.jar/dev.slne.surf.chat.server.database.repository.IgnoreListRepository.cacheIgnorelist(IgnoreListRepository.kt) ~[?:?]
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104) ~[?:?]
at java.base/java.lang.reflect.Method.invoke(Method.java:565) ~[?:?]
at kotlin.reflect.jvm.internal.calls.CallerImpl$Method.callMethod(CallerImpl.kt:97) ~[kotlin-reflect-2.2.20.jar!/:2.2.20-release-333]
at kotlin.reflect.jvm.internal.calls.CallerImpl$Method$Instance.call(CallerImpl.kt:113) ~[kotlin-reflect-2.2.20.jar!/:2.2.20-release-333]
at kotlin.reflect.jvm.internal.KCallableImpl.callDefaultMethod$kotlin_reflection(KCallableImpl.kt:250) ~[kotlin-reflect-2.2.20.jar!/:2.2.20-release-333]
at kotlin.reflect.full.KCallables.callSuspendBy(KCallables.kt:81) ~[kotlin-reflect-2.2.20.jar!/:2.2.20-release-333]
at org.springframework.core.CoroutinesUtils.lambda$invokeSuspendingFunction$3(CoroutinesUtils.java:143) ~[spring-core-6.2.11.jar!/:6.2.11]
at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$4.invokeSuspend(IntrinsicsJvm.kt:270) ~[kotlin-stdlib-2.2.20.jar!/:2.2.20-release-333]
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:34) [kotlin-stdlib-2.2.20.jar!/:2.2.20-release-333]
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:100) [kotlinx-coroutines-core-jvm-1.10.2.jar!/:?]
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:124) [kotlinx-coroutines-core-jvm-1.10.2.jar!/:?]
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:89) [kotlinx-coroutines-core-jvm-1.10.2.jar!/:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:586) [kotlinx-coroutines-core-jvm-1.10.2.jar!/:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:820) [kotlinx-coroutines-core-jvm-1.10.2.jar!/:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:717) [kotlinx-coroutines-core-jvm-1.10.2.jar!/:?]
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:704) [kotlinx-coroutines-core-jvm-1.10.2.jar!/:?]
Caused by: java.lang.ExceptionInInitializerError: Exception kotlinx.serialization.SerializationException: Serializer for class 'java.util.UUID' is not found.
Please ensure that class is marked as '@serializable' and that the serialization compiler plugin is applied.
[in thread "StandaloneMain"]
at kotlinx.serialization.SerializersKt__SerializersKt.noCompiledSerializer(Serializers.kt:408) ~[kotlinx-serialization-core-jvm-1.9.0.jar!/:1.9.0]
at kotlinx.serialization.SerializersKt.noCompiledSerializer(Unknown Source) ~[kotlinx-serialization-core-jvm-1.9.0.jar!/:1.9.0]
at surf-chat-server-1.21.10-4.1.5-SNAPSHOT-all.jar/dev.slne.surf.chat.core.common.util.SyncValues.(SyncValues.kt:69) ~[?:?]
at surf-chat-server-1.21.10-4.1.5-SNAPSHOT-all.jar/dev.slne.surf.chat.server.ServerMain.(ServerMain.kt:15) ~[?:?]
at java.base/jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:62) ~[?:?]
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:483) ~[?:?]
at dev.slne.surf.cloud.api.server.plugin.provider.ProviderLoader.loadClass(ProviderLoader.kt:21) ~[surf-cloud-api-server-1.21.10-1.0.0-SNAPSHOT.jar!/:?]
at dev.slne.surf.cloud.api.server.plugin.provider.ProviderLoader.loadClass$default(ProviderLoader.kt:7) ~[surf-cloud-api-server-1.21.10-1.0.0-SNAPSHOT.jar!/:?]
at dev.slne.surf.cloud.api.server.plugin.bootstrap.StandalonePluginBootstrap.createPlugin$suspendImpl(StandalonePluginBootstrap.kt:11) ~[surf-cloud-api-server-1.21.10-1.0.0-SNAPSHOT.jar!/:?]
at dev.slne.surf.cloud.api.server.plugin.bootstrap.StandalonePluginBootstrap.createPlugin(StandalonePluginBootstrap.kt) ~[surf-cloud-api-server-1.21.10-1.0.0-SNAPSHOT.jar!/:?]
at surf-chat-server-1.21.10-4.1.5-SNAPSHOT-all.jar/dev.slne.surf.chat.server.ServerBootstrap.createPlugin(ServerBootstrap.kt:10) ~[?:?]
at dev.slne.surf.cloud.standalone.plugin.provider.impl....


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 5 commits November 23, 2025 09:40
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Co-authored-by: TheBjoRedCraft <143264463+TheBjoRedCraft@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix error in pre player join task initialization Add missing SyncValues class with UUID serializer Nov 23, 2025
Copilot AI requested a review from TheBjoRedCraft November 23, 2025 09:48
@TheBjoRedCraft
Copy link
Member

@copilot open a pr to implement those changes directly into the codebase

Copy link
Author

Copilot AI commented Nov 23, 2025

@copilot open a pr to implement those changes directly into the codebase

The PR is already open on this branch (copilot/fix-pre-login-chat-task) with all changes implemented and pushed. The SyncValues class with UUID serialization support has been created at /surf-chat-core/src/main/kotlin/dev/slne/surf/chat/core/common/util/SyncValues.kt (commit c788b0c). All code reviews and security checks have passed. The PR is ready for your review and merge.

@TheBjoRedCraft TheBjoRedCraft deleted the copilot/fix-pre-login-chat-task branch November 23, 2025 09:54
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.

2 participants