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

Ktor Sessions is missing @Serializable annotation #130

Open
bjhham opened this issue Aug 28, 2024 · 1 comment
Open

Ktor Sessions is missing @Serializable annotation #130

bjhham opened this issue Aug 28, 2024 · 1 comment

Comments

@bjhham
Copy link
Collaborator

bjhham commented Aug 28, 2024

Exception in thread "main" kotlinx.serialization.SerializationException: Serializer for class 'MySession' is not found.
Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied.

	at kotlinx.serialization.internal.Platform_commonKt.serializerNotRegistered(Platform.common.kt:91)
	at kotlinx.serialization.internal.PlatformKt.platformSpecificSerializerNotRegistered(Platform.kt:28)
	at kotlinx.serialization.SerializersKt__SerializersKt.serializer(Serializers.kt:134)
	at kotlinx.serialization.SerializersKt.serializer(Unknown Source)
	at kotlinx.serialization.SerializersKt__SerializersKt.serializer(Serializers.kt:72)
	at kotlinx.serialization.SerializersKt.serializer(Unknown Source)
	at io.ktor.server.sessions.SessionSerializerKt.defaultSessionSerializer(SessionSerializer.kt:40)
	at io.ktor.server.sessions.CookieSessionBuilder.<init>(SessionsBuilder.kt:323)
	at io.ktor.server.sessions.SessionsBuilderKt.cookie(SessionsBuilder.kt:212)
	at com.re.ka.ku.plugins.SecurityKt.configureSecurity$lambda$1(Security.kt:25)
	at io.ktor.server.application.CreatePluginUtilsKt.createRouteScopedPluginInstance(CreatePluginUtils.kt:283)
	at io.ktor.server.application.CreatePluginUtilsKt.access$createRouteScopedPluginInstance(CreatePluginUtils.kt:1)
	at io.ktor.server.application.CreatePluginUtilsKt$createRouteScopedPlugin$1.install(CreatePluginUtils.kt:137)
	at io.ktor.server.application.CreatePluginUtilsKt$createRouteScopedPlugin$1.install(CreatePluginUtils.kt:123)
	at io.ktor.server.application.ApplicationPluginKt.install(ApplicationPlugin.kt:100)
	at com.re.ka.ku.plugins.SecurityKt.configureSecurity(Security.kt:11)
@github-staff github-staff deleted a comment from ViniciusSCG Oct 1, 2024
@aretii
Copy link

aretii commented Oct 22, 2024

any solution on this?

Exception in thread "main" kotlinx.serialization.SerializationException: Serializer for class 'MySession' is not found.
Please ensure that class is marked as '@Serializable' and that the serialization compiler plugin is applied.

	at kotlinx.serialization.internal.Platform_commonKt.serializerNotRegistered(Platform.common.kt:91)
	at kotlinx.serialization.internal.PlatformKt.platformSpecificSerializerNotRegistered(Platform.kt:28)
	at kotlinx.serialization.SerializersKt__SerializersKt.serializer(Serializers.kt:134)
	at kotlinx.serialization.SerializersKt.serializer(Unknown Source)
	at kotlinx.serialization.SerializersKt__SerializersKt.serializer(Serializers.kt:72)
	at kotlinx.serialization.SerializersKt.serializer(Unknown Source)
	at io.ktor.server.sessions.SessionSerializerKt.defaultSessionSerializer(SessionSerializer.kt:40)
	at io.ktor.server.sessions.CookieSessionBuilder.<init>(SessionsBuilder.kt:323)
	at io.ktor.server.sessions.SessionsBuilderKt.cookie(SessionsBuilder.kt:212)
	at com.re.ka.ku.plugins.SecurityKt.configureSecurity$lambda$1(Security.kt:25)
	at io.ktor.server.application.CreatePluginUtilsKt.createRouteScopedPluginInstance(CreatePluginUtils.kt:283)
	at io.ktor.server.application.CreatePluginUtilsKt.access$createRouteScopedPluginInstance(CreatePluginUtils.kt:1)
	at io.ktor.server.application.CreatePluginUtilsKt$createRouteScopedPlugin$1.install(CreatePluginUtils.kt:137)
	at io.ktor.server.application.CreatePluginUtilsKt$createRouteScopedPlugin$1.install(CreatePluginUtils.kt:123)
	at io.ktor.server.application.ApplicationPluginKt.install(ApplicationPlugin.kt:100)
	at com.re.ka.ku.plugins.SecurityKt.configureSecurity(Security.kt:11)

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

3 participants
@aretii @bjhham and others