wicket deserealization异常:java.lang.IllegalArgumentException

时间:2018-04-24 12:22:40

标签: java spring wicket

我在我的webapp中使用Wicket和Spring上下文。 我有字段的BasePage类:

@SpringBean(name="epfc")
protected ExternalPropertiesFileConfig externalPropertiesFileConfig;

和所有其他页面都从此页面扩展。

我也在我的检票口使用KryoSerializer:

KryoSerializer ser = new KryoSerializer(Bytes.megabytes(1L));
getFrameworkSettings().setSerializer(ser);

和AnnotationConfigWebApplicationContext作为Wicket App中的rootContext

     AnnotationConfigWebApplicationContext rootContext = new AnnotationConfigWebApplicationContext();
    //Beans definitions (annotations)
    rootContext.register(ApplicationConfig.class);
    //install Spring Context for spring dependency injection
    getServletContext().setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, rootContext);
    SpringComponentInjector springComponentInjector = new SpringComponentInjector(this , rootContext, true);
    getComponentInstantiationListeners().add(springComponentInjector);

以下是我的ExternalPropertiesFileConfig类的一些信息:

public class ExternalPropertiesFileConfig {

private Properties prop;
private IResource logo;
//constructor
public ExternalPropertiesFileConfig() {
    Plugin plugin = Bukkit.getPluginManager().getPlugin("MinecraftWebService");
    File pluginDir = plugin.getDataFolder();
    loadFileToPropertiesObject(pluginDir);
    loadImgFile(pluginDir);
}
}

一切都很好。但这里有一些问题: 例如我现在在HomePage上,我点击一个链接并重定向到LoginPage。所以HomePage必须序列化。没有问题。 但当我点击我的浏览器中的BACK BUTTON时 - 有一些错误: 堆栈跟踪太大,因此存储在此处:https://hastebin.com/oduyutekiv.sql

1 个答案:

答案 0 :(得分:-1)

好的,我发现了wicketstuff-serializer-fast2 - 它运行良好。 请求@ martin-g寻求帮助。

默认Wicket JavaSerializer - 不适合我

Kryo和Kryo​​2 Serializers - 也不适合我

WicketStuff Fast 2 Serializer - 没问题,没有问题。