Re: Kotlin 1.5.0 : NotSerializableException: Non-serializable lambda
follow this workaround solves the problem (temporarily) Workaround: use -Xsam-conversions=class https://youtrack.jetbrains.com/issue/KT-46359#focus=Comments-27-4862857.0-0 org.jetbrains.kotlin kotlin-maven-plugin ${kotlin.version} -Xsam-conversions=class Bas Gooren 於 2021年5月3日 週一 下午4:22寫道: > Hi! > > Probably related to this: > > https://youtrack.jetbrains.com/issue/KT-46373 > > "Since 1.5, SAM-converted lambdas are generated using invokedynamic with > bootstrap method from java.lang.invoke.LambdaMetafactory. > Resulting proxy classes are not Serializable by default.” > > So your lambda’s in WizardPage are no longer serializable by default due > to your upgrade to kotlin 1.5.0. > > So I’d recommend downgrading your Kotlin for now. > > (I’m not an active user of kotlin, so I found this information with 10 > minutes of Googling) > > Met vriendelijke groet, > Kind regards, > > Bas Gooren > > Op 30 april 2021 bij 07:06:45, smallufo (small...@gmail.com) schreef: > > more detail log : > > 2021-04-30 12:43:44.076 [http-nio-8080-exec-2] WARN > o.a.w.c.u.o.c.CheckingObjectOutputStream.internalCheck - error delegating > to writeObject : Non-serializable lambda, path: /children/[write:1]/data > 2021-04-30 12:43:44.078 [http-nio-8080-exec-2] WARN > o.a.w.c.u.o.c.CheckingObjectOutputStream.internalCheck - error delegating > to writeObject : Non-serializable lambda, path: /children/[write:2] > 2021-04-30 12:43:44.079 [http-nio-8080-exec-2] WARN > o.a.w.c.u.o.c.CheckingObjectOutputStream.internalCheck - error delegating > to writeObject : Non-serializable lambda, path: /children > 2021-04-30 12:43:44.099 [http-nio-8080-exec-2] ERROR > o.a.w.s.j.JavaSerializer.serialize - Error serializing object class > destiny.WizardPage [object=[Page class = destiny.WizardPage, id = 1, > render > count = 1]] > org.apache.wicket.WicketRuntimeException: A problem occurred while trying > to collect debug information about not serializable object > at > org.apache.wicket.serialize.java.JavaSerializer$SerializationCheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:390) > > at > java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349) > > at > org.apache.wicket.serialize.java.JavaSerializer.serialize(JavaSerializer.java:82) > > at > org.apache.wicket.pageStore.AbstractPageStore.serializePage(AbstractPageStore.java:133) > > at > org.apache.wicket.pageStore.DefaultPageStore.createSerializedPage(DefaultPageStore.java:281) > > at > org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:61) > > at > org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:482) > > at > org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:214) > > > smallufo 於 2021年4月30日 週五 下午12:52寫道: > > > I was using Kotlin 1.4.32 with wicket 8.11 > > but after upgrading to Kotlin 1.5.0 , it throws : > > > > Caused by: java.io.NotSerializableException: Non-serializable lambda > > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > > Method) > > at > > > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) > > > at > > > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > > > at java.base/java.lang.reflect.Method.invoke(Method.java:564) > > at > > > java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1196) > > > at > > > java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1523) > > > at > > > java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444) > > > at > > > java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187) > > > at > > > java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579) > > > > > > > what may go wrong here ? > > > > The wicket mode is DEPLOYMENT > > > > > > wicket > > > org.apache.wicket.protocol.http.WicketFilter > > > > applicationClassName > > foo.bar.MyApplication > > > > > > configuration > > DEPLOYMENT > > > > > > > > wicket > > /app/* > > > > > > > > @MacMiniM1 ~ java -version > > openjdk version "15.0.2" 2021-01-19 > > OpenJDK Runtime Environment Zulu15.29+15-CA (build 15.0.2+7) > > OpenJDK 64-Bit Server VM Zulu15.29+15-CA (build 15.0.2+7, mixed mode) > > > > > > > > Thanks > > > > > >
Re: Kotlin 1.5.0 : NotSerializableException: Non-serializable lambda
Hi! Probably related to this: https://youtrack.jetbrains.com/issue/KT-46373 "Since 1.5, SAM-converted lambdas are generated using invokedynamic with bootstrap method from java.lang.invoke.LambdaMetafactory. Resulting proxy classes are not Serializable by default.” So your lambda’s in WizardPage are no longer serializable by default due to your upgrade to kotlin 1.5.0. So I’d recommend downgrading your Kotlin for now. (I’m not an active user of kotlin, so I found this information with 10 minutes of Googling) Met vriendelijke groet, Kind regards, Bas Gooren Op 30 april 2021 bij 07:06:45, smallufo (small...@gmail.com) schreef: more detail log : 2021-04-30 12:43:44.076 [http-nio-8080-exec-2] WARN o.a.w.c.u.o.c.CheckingObjectOutputStream.internalCheck - error delegating to writeObject : Non-serializable lambda, path: /children/[write:1]/data 2021-04-30 12:43:44.078 [http-nio-8080-exec-2] WARN o.a.w.c.u.o.c.CheckingObjectOutputStream.internalCheck - error delegating to writeObject : Non-serializable lambda, path: /children/[write:2] 2021-04-30 12:43:44.079 [http-nio-8080-exec-2] WARN o.a.w.c.u.o.c.CheckingObjectOutputStream.internalCheck - error delegating to writeObject : Non-serializable lambda, path: /children 2021-04-30 12:43:44.099 [http-nio-8080-exec-2] ERROR o.a.w.s.j.JavaSerializer.serialize - Error serializing object class destiny.WizardPage [object=[Page class = destiny.WizardPage, id = 1, render count = 1]] org.apache.wicket.WicketRuntimeException: A problem occurred while trying to collect debug information about not serializable object at org.apache.wicket.serialize.java.JavaSerializer$SerializationCheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:390) at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349) at org.apache.wicket.serialize.java.JavaSerializer.serialize(JavaSerializer.java:82) at org.apache.wicket.pageStore.AbstractPageStore.serializePage(AbstractPageStore.java:133) at org.apache.wicket.pageStore.DefaultPageStore.createSerializedPage(DefaultPageStore.java:281) at org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:61) at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:482) at org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:214) smallufo 於 2021年4月30日 週五 下午12:52寫道: > I was using Kotlin 1.4.32 with wicket 8.11 > but after upgrading to Kotlin 1.5.0 , it throws : > > Caused by: java.io.NotSerializableException: Non-serializable lambda > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) > at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:564) > at > java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1196) > at > java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1523) > at > java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444) > at > java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187) > at > java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579) > > > what may go wrong here ? > > The wicket mode is DEPLOYMENT > > > wicket > org.apache.wicket.protocol.http.WicketFilter > > applicationClassName > foo.bar.MyApplication > > > configuration > DEPLOYMENT > > > > wicket > /app/* > > > > @MacMiniM1 ~ java -version > openjdk version "15.0.2" 2021-01-19 > OpenJDK Runtime Environment Zulu15.29+15-CA (build 15.0.2+7) > OpenJDK 64-Bit Server VM Zulu15.29+15-CA (build 15.0.2+7, mixed mode) > > > > Thanks > >
Re: Kotlin 1.5.0 : NotSerializableException: Non-serializable lambda
more detail log : 2021-04-30 12:43:44.076 [http-nio-8080-exec-2] WARN o.a.w.c.u.o.c.CheckingObjectOutputStream.internalCheck - error delegating to writeObject : Non-serializable lambda, path: /children/[write:1]/data 2021-04-30 12:43:44.078 [http-nio-8080-exec-2] WARN o.a.w.c.u.o.c.CheckingObjectOutputStream.internalCheck - error delegating to writeObject : Non-serializable lambda, path: /children/[write:2] 2021-04-30 12:43:44.079 [http-nio-8080-exec-2] WARN o.a.w.c.u.o.c.CheckingObjectOutputStream.internalCheck - error delegating to writeObject : Non-serializable lambda, path: /children 2021-04-30 12:43:44.099 [http-nio-8080-exec-2] ERROR o.a.w.s.j.JavaSerializer.serialize - Error serializing object class destiny.WizardPage [object=[Page class = destiny.WizardPage, id = 1, render count = 1]] org.apache.wicket.WicketRuntimeException: A problem occurred while trying to collect debug information about not serializable object at org.apache.wicket.serialize.java.JavaSerializer$SerializationCheckerObjectOutputStream.writeObjectOverride(JavaSerializer.java:390) at java.base/java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:349) at org.apache.wicket.serialize.java.JavaSerializer.serialize(JavaSerializer.java:82) at org.apache.wicket.pageStore.AbstractPageStore.serializePage(AbstractPageStore.java:133) at org.apache.wicket.pageStore.DefaultPageStore.createSerializedPage(DefaultPageStore.java:281) at org.apache.wicket.pageStore.DefaultPageStore.storePage(DefaultPageStore.java:61) at org.apache.wicket.page.PageStoreManager$PersistentRequestAdapter.storeTouchedPages(PageStoreManager.java:482) at org.apache.wicket.page.RequestAdapter.commitRequest(RequestAdapter.java:214) smallufo 於 2021年4月30日 週五 下午12:52寫道: > I was using Kotlin 1.4.32 with wicket 8.11 > but after upgrading to Kotlin 1.5.0 , it throws : > > Caused by: java.io.NotSerializableException: Non-serializable lambda > at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native > Method) > at > java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) > at > java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) > at java.base/java.lang.reflect.Method.invoke(Method.java:564) > at > java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1196) > at > java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1523) > at > java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444) > at > java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187) > at > java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579) > > > what may go wrong here ? > > The wicket mode is DEPLOYMENT > > > wicket > org.apache.wicket.protocol.http.WicketFilter > > applicationClassName > foo.bar.MyApplication > > > configuration > DEPLOYMENT > > > > wicket > /app/* > > > > @MacMiniM1 ~ java -version > openjdk version "15.0.2" 2021-01-19 > OpenJDK Runtime Environment Zulu15.29+15-CA (build 15.0.2+7) > OpenJDK 64-Bit Server VM Zulu15.29+15-CA (build 15.0.2+7, mixed mode) > > > > Thanks > >
Kotlin 1.5.0 : NotSerializableException: Non-serializable lambda
I was using Kotlin 1.4.32 with wicket 8.11 but after upgrading to Kotlin 1.5.0 , it throws : Caused by: java.io.NotSerializableException: Non-serializable lambda at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at java.base/java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:1196) at java.base/java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1523) at java.base/java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1444) at java.base/java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1187) at java.base/java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1579) what may go wrong here ? The wicket mode is DEPLOYMENT wicket org.apache.wicket.protocol.http.WicketFilter applicationClassName foo.bar.MyApplication configuration DEPLOYMENT wicket /app/* @MacMiniM1 ~ java -version openjdk version "15.0.2" 2021-01-19 OpenJDK Runtime Environment Zulu15.29+15-CA (build 15.0.2+7) OpenJDK 64-Bit Server VM Zulu15.29+15-CA (build 15.0.2+7, mixed mode) Thanks