2 Replies Latest reply on Mar 7, 2007 6:17 AM by saschaqs

    Strange behaviour after updating to ajax4jsf 1.1.0

    saschaqs

      Hi,

      today I updated from 1.0.6 to 1.1.0 because we want to use richfaces, but now I have a strange problem: the login page renders correctly, but after submit I get an "No FacesContext found" Exception from ajax4jsf.

      We changed nothing on the portal config, except removing the old ajax4jsf jar and adding the new one (+richfaces jar).
      We are using MyFaces 1.1.1, Tomahawk and Facelets. After changing back to ajax4jsf 1.0.6 everything goes fine again.

      Any hints?

      TIA
      Sascha

        • 1. Re: Strange behaviour after updating to ajax4jsf 1.1.0
          alexsmirnov

          Please, provide full Exception stack trace.
          P.S. Portlet support in not ready for both 1.0.6/1.1.0 branches :-)

          • 2. Re: Strange behaviour after updating to ajax4jsf 1.1.0
            saschaqs

            Hi,

            this is the stacktrace. OwnViewHandler is derived from FaceletViewHandler, we are doing directory protection with it. The exception shows up at a point after calling super.renderView(). After that the only following code calculates the time the view needs for rendering and logs it into Debug. And in this debug statement we do a viewToRender.getViewId(). And this throws the Exception, what it never had done before 1.1.0 :-)

            java.lang.NullPointerException: FacesContext is null
            org.ajax4jsf.framework.ajax.AjaxContext.getCurrentInstance(AjaxContext.java:148)
            org.ajax4jsf.framework.ajax.AjaxContext.getCurrentInstance(AjaxContext.java:134)
            org.ajax4jsf.framework.ajax.AjaxViewRoot.getViewId(AjaxViewRoot.java:422)
            com.company.project.web.OwnViewHandler.renderView(OwnViewHandler.java:356)
            org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
            org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
            org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:352)
            javax.faces.webapp.FacesServlet.service(FacesServlet.java:107)
            org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
            org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
            com.company.project.web.OwnNavFlowFilter.doFilter(OwnNavFlowFilter.java:34)
            org.apache.myfaces.component.html.util.ExtensionsFilter.doFilter(ExtensionsFilter.java:122)