Hi, we're trying to use Tomcat Session serialization into Redis. The de/serialization process is failing because we save into Session some of our config classes that are part of our Wicket web module. The problem is that part of the data is SpringBean annotated field in one of the classes. Wicket uses it's own component injector that handles de/serialization process for those beans bean into proxy by calling the Spring code in org/springframework/core/SerializableTypeWrapper.java:126. Wicket @SpringBean annotation allows de/serialization of the fields by using the mentioned code.

I can see that it creates a proxy that implements following classes

Class<?>[] interfaces = new Class<?>[] {type, SerializableTypeProxy.class, Serializable.class};

But when the session is deserialized we get following exception. We debugged the code and found the problematic non-public interface is SerializableTypeProxy. I'd like ask if the class could be made public to fix the issues we have?

``` Caused by: java.lang.IllegalArgumentException: non-public interface is not defined by the given loader at java.base/java.lang.reflect.Proxy$ProxyBuilder.mapToModule(Proxy.java:818) at java.base/java.lang.reflect.Proxy$ProxyBuilder.(Proxy.java:651) at java.base/java.lang.reflect.Proxy.lambda$getProxyConstructor$1(Proxy.java:440) at java.base/jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329) at java.base/jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205) at java.base/java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:438) at java.base/java.lang.reflect.Proxy.getProxyClass(Proxy.java:398) at org.redisson.codec.CustomObjectInputStream.resolveProxyClass(CustomObjectInputStream.java:59) at java.base/java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1956) at java.base/java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1897) at java.base/java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2224) at java.base/java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1733) at java.base/java.io.ObjectInputStream$FieldValues.(ObjectInputStream.java:2606) at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2457)

Comment From: oliverhenlich

Seems similar to this issue https://github.com/spring-projects/spring-data-redis/issues/2016

Comment From: jhoeller

What's the actual ClassLoader this is getting deserialized into? In that target ClassLoader arrangement, where are the Spring classes defined - in a parent ClassLoader, I assume?

Declaring SerializableTypeProxy is not entirely simple since it and its TypeProvider delegate are nested interfaces in the non-public SerializableTypeWrapper. We'd have to move it to a top-level public type itself which we are rather reluctant to do.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.