You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This example tries to marshal a simple Groovy object, but it raises the following exception
Caused by: java.lang.IllegalAccessException: Class org.eclipse.yasson.internal.model.GetFromGetter can not access a member of class sun.reflect.annotation.AnnotatedTypeFactory$AnnotatedTypeBaseImpl with modifiers "public final"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
Maybe it's better to limit the reflection to symbols added in GroovyObject subclasses...in many cases it's what we expect to marshal.
I tried to use your provided code to reproduce the issue, and I had to change Square so it was a public static inner class of the main class like this:
From here Yasson actually attempted to serialize the object, but ran into an infinite loop that resulted in either a StackOverflowException or an OOM.
After inspecting the resulting Groovy class I see that Groovy adds in a public MetaClass getMetaClass() method which seems to be the culprit for the infinite loop. I added a special case in PR #302 to automatically ignore this method and then the code worked for me.
This example tries to marshal a simple Groovy object, but it raises the following exception
Caused by: java.lang.IllegalAccessException: Class org.eclipse.yasson.internal.model.GetFromGetter can not access a member of class sun.reflect.annotation.AnnotatedTypeFactory$AnnotatedTypeBaseImpl with modifiers "public final"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
Maybe it's better to limit the reflection to symbols added in GroovyObject subclasses...in many cases it's what we expect to marshal.
The text was updated successfully, but these errors were encountered: