我正在使用带有 EJB 3 的 Wicket,当我调用我的页面时,日志显示错误
Error serializing object class com.mk.view.page.CountryList [object=[Page class = com.mk.view.page.CountryList, id = 91, render count = 1]]
org.apache.wicket.core.util.objects.checker.CheckingObjectOutputStream$ObjectCheckException: The object type is not Serializable!
A problem occurred while checking object with type: javax.naming.InitialContext
Field hierarchy is:
91 [class=com.mk.view.page.CountryList, path=91]
private javax.naming.Context com.mk.view.page.CountryList.ctx [class=javax.naming.InitialContext] <----- field that is causing the problem
我的代码是
public class CountryList extends Layout {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
*
*/
private javax.naming.Context ctx;
private GenericCrudService sf;
private CountryList(){
try {
ctx = new javax.naming.InitialContext();
sf = (GenericCrudService) ctx
.lookup("java:global/mkEar/mkEJB/CrudService!com.mk.business.common.GenericCrudService");
} catch (NamingException e) {
e.printStackTrace();
}
addModelModule();
addSearchModule();
}
我的应用程序没有崩溃,我还没有找到解决方案,所以我想知道这些是否会比日志更糟糕?有谁知道解决这个问题?