[英]What might cause a page expired error with Apache Wicket, any versions
我們在點擊時間歇性地收到頁面過期異常,這可能是導致此錯誤的原因。
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 session 是否已過期。 如果有,session 的頁面將從頁面存儲中刪除。 ((HttpServletRequest)getRequestCycle().getRequest().getContainerRequest()).getSession().getMaxInactiveInterval()
最后,它可能是在將頁面保存到頁面存儲的過程中發生的錯誤。 如果是這種情況,您完全有可能因為這個原因而無法從頁面存儲中接收到該頁面。
另外,請記住 Apache Wicket 1.5 不久前已停產,因此與此相關的一切都非常古老。 版本可能不匹配或出現新問題。 這里最好的辦法是盡快遷移到更新的版本,以避免其他不明顯的錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.