Apache Wicket的任何版本都可能导致页面过期错误



我们在点击时间歇性地收到页面过期异常,这可能是导致此错误的原因。

Apache Wicket,旧版本5。

此外,这可能是二级缓存的某些原因:

public class HttpSessionStore extends HttpSessionStore {
/**
* Logger instance.
*/
private static final Logger log = Logger.getLogger(PFSHttpSessionStore.class);

private final IPageStore pageStore;
/**
* Construct.    
*/
public PFSHttpSessionStore(final Application application, final IPageStore pageStore) {
super(application);
this.pageStore = pageStore;
Application.get().getPageSettings().setAutomaticMultiWindowSupport(false);
}

private static MetaDataKey<Map<String, IntHashMap<Page>>> USED_PAGES = new MetaDataKey<Map<String, IntHashMap<Page>>>() {
private static final long serialVersionUID = 1L;
};
public static IntHashMap<Page> getUsedPages(String pageMapName) {
Map<String, IntHashMap<Page>> usedPages = RequestCycle.get().getMetaData(USED_PAGES);
if (usedPages == null) {
usedPages = new HashMap<String, IntHashMap<Page>>();
RequestCycle.get().setMetaData(USED_PAGES, usedPages);
}
IntHashMap<Page> intHashMap = usedPages.get(pageMapName);
if (intHashMap == null) {
intHashMap = new IntHashMap<Page>();
usedPages.put(pageMapName, intHashMap);
}
return intHashMap;
}
@Override
public IPageMap createPageMap(final String name) {
final IPageMap pageMap = new SecondLevelCachePageMap(Session.get().getId(), Application.get(), name);
log.info("//SYSTEM_INFO//-SESSION STORE : " + " creating new page map, pageMap="+pageMap + " name=" + name);
return pageMap;
}

这就是错误。

[Time:2022.02.17:15:56:25:927][ThreadHashCode:-1365274941][Message:[SYSTEM_INFO] - [ContactManager] ERROR <CRITICAL_ERROR> - On Runtime Exception, Object state at time of err:|sessionId=CAc6_oHyXvRpqJhz6LpVNjN|agentId=CM773|errMsg=Request cannot be processed]
[Time:2022.02.17:15:58:38:602][ThreadHashCode:-879837006][Message:[SYSTEM_INFO] - [ContactManager] ERROR <CRITICAL_ERROR> - On Runtime Exception, Object state at time of err:|sessionId=i_LyvitDoQEKFFxfQA15i49|agentId=SFGX4|errMsg=Cannot find the rendered page in session [pagemap=null,componentPath=0:contactPanel:contact:cForm:contactLookupText,versionNumber=0]]

可能导致此错误的一些直接因素如下:

首先,可能值得检查以确保没有超过页面存储大小。如果有,则可能是商店中的某些页面已被擦除。getSession().getApplication().getStoreSettings().getMaxSizePerSession()

其次,我建议检查http会话是否已过期。如果有,会话的页面将从页面存储中删除。((HttpServletRequest)getRequestCycle().getRequest().getContainerRequest()).getSession().getMaxInactiveInterval()

最后,它可能是在将页面保存到页面存储的过程中发生的错误。如果是这种情况,那么完全有可能因为这个原因而无法从页面存储中接收页面。

此外,请记住,Apache Wicket 1.5不久前已经停产,因此与此相关的一切都非常陈旧。可能是版本不匹配,或者是新出现的问题。这里最好的办法是尽快迁移到新版本,以避免其他模糊的错误。

相关内容

最新更新