Skip to content

SerializableTypeProxy cannot be deserialized #30165

Closed as not planned
Closed as not planned
@mira-silhavy

Description

@mira-silhavy

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.<init>(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.<init>(ObjectInputStream.java:2606)
	at java.base/java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:2457)

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions