简体   繁体   中英

What might cause a page expired error with Apache Wicket, any versions

We are getting page expired exception intermittently when clicking around, what might cause this error.

Apache Wicket, older versions 5.

Also this might be some cause of it with second level cache:

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;
    }

And here is the error.

[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]]

Some immediate things that could be causing this error are as follows:

First, it may be worth checking to make sure that the page store size hasn't been exceeded. If it has, it's possible that some pages from the store have been erased. getSession().getApplication().getStoreSettings().getMaxSizePerSession()

Second, I would advise checking whether or not the http session has expired. If it has, the pages of the session would've been erased from the page store. ((HttpServletRequest)getRequestCycle().getRequest().getContainerRequest()).getSession().getMaxInactiveInterval()

Finally, it could be an error which occurred during the process of saving the page to the page store. If that's the case, it's entirely possible that you cannot receive the page from the page store for that reason.

Also, keep in mind that Apache Wicket 1.5 was discontinued a while ago so everything regarding this is very old. It's possible that versions are mismatched or there are issues coming from something new. The best bet here would be to migrate to newer versions as soon as possible to avoid other obscure errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM