Title: NullPointerException at SessionMap.

Hi,
We are trying to integrate WebWork 2 into our web application.
Incoming HTTP request are served by another framework (AbaXX). The integration occurs in a JSP through webwork:include tag. And there we get the following exception:

[Do Nov 27 15:32:04 CET] Error: payback: java.lang.NullPointerException
        at com.opensymphony.webwork.dispatcher.SessionMap.entrySet(SessionMap.java:52)
        at java.util.AbstractMap.containsKey(AbstractMap.java:131)
        at com.loyaltypartner.lm.cms.ui.interceptor.PageflowInterceptor.before(PageflowInterceptor.java:33)
        at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:36)
        at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:169)
        at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116)
        at com.opensymphony.webwork.dispatcher.ServletDispatcher.serviceAction(ServletDispatcher.java:181)
        at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:161)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
        at com.caucho.server.http.FilterChainServlet.doFilter(FilterChainServlet.java:96)
        at com.caucho.server.http.Invocation.service(Invocation.java:315)
        at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
        at com.caucho.server.http.QRequestDispatcher.include(QRequestDispatcher.java:363)
        at com.caucho.server.http.QRequestDispatcher.include(QRequestDispatcher.java:274)
        at com.opensymphony.webwork.views.jsp.IncludeTag.include(IncludeTag.java:121)
        at com.opensymphony.webwork.views.jsp.IncludeTag.doEndTag(IncludeTag.java:234)
        at _templates._Funktion._render__jsp._jspService(_render__jsp.java:277)
        at com.caucho.jsp.JavaPage.service(JavaPage.java:75)
        at com.caucho.jsp.Page.subservice(Page.java:506)
        at com.caucho.server.http.FilterChainPage.doFilter(FilterChainPage.java:182)
        at com.caucho.server.http.Invocation.service(Invocation.java:315)
        at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:135)
        at com.caucho.server.http.QRequestDispatcher.include(QRequestDispatcher.java:363)
        at com.caucho.server.http.QRequestDispatcher.include(QRequestDispatcher.java:274)
        at com.caucho.jsp.QPageContext.include(QPageContext.java:546)
        at _templates._Funktion._renderTeaser__jsp._jspService(_renderTeaser__jsp.java:57)
        at com.caucho.jsp.JavaPage.service(JavaPage.java:75)

What could it be? Is it because of the fact, that initial request processing does not go through WebWork Dispatcher?
If it could help I attach PageflowInterceptor.before method source code.
   
   protected void before(ActionInvocation actionInvocation) throws Exception {
        String ptoken = null;
        Map pageflowContext = null;
        Map requestParams = actionInvocation.getInvocationContext().getParameters();
        Map sessionParams = actionInvocation.getInvocationContext().getSession();
        if (!requestParams.containsKey("ptoken")) {
            ptoken = GUID.generateGUID();
        } else {
            ptoken = requestParams.get("ptoken").toString();
        }
        if (!sessionParams.containsKey("pageflow" + ptoken)) {  // <-------------------------------- here the exception occurs

            pageflowContext = new HashMap();
            sessionParams.put("pageflow" + ptoken, pageflowContext);
        } else {
            pageflowContext = (Map) sessionParams.get("pageflow" + ptoken);
        }
        Map p = new HashMap(2);
        p.put("ptoken", ptoken);
        p.put("pageflowContext", pageflowContext);
        OgnlUtil.setProperties(p, actionInvocation.getAction(), ActionContext.getContext().getContextMap());
   }

The idea of this interceptor is to have some Map where actions participating in a pageflow can share data. It is not acceptible to share that data through HTTP Session, because other actions from other pageflows can overwrite this data.

Viele Gruesse,
Sergiy

Reply via email to