4 Replies Latest reply on Mar 8, 2007 12:17 PM by Sergey Smirnov

    Error: Resources framework is not initialised

    Michael Schuetz Newbie

      Hey,
      i am using Seam 1.2, Facelets 1.1.11, and latest A4J and Richfaces and get following exception when after starting my application:

      09:43:32,798 ERROR [InternetResourceBuilder] Error building query string for store data
      javax.faces.FacesException: Error encode resource data
       at org.ajax4jsf.framework.resource.ResourceBuilderImpl.encrypt(ResourceBuilderImpl.java:547)
       at org.ajax4jsf.framework.resource.ResourceBuilderImpl.getUri(ResourceBuilderImpl.java:296)
       at org.ajax4jsf.framework.resource.InternetResourceBase.getUri(InternetResourceBase.java:211)
       at org.ajax4jsf.framework.resource.BaseResourceRenderer.encodeBegin(BaseResourceRenderer.java:62)
       at org.ajax4jsf.framework.resource.OneTimeRenderer.encodeBegin(OneTimeRenderer.java:48)
       at org.ajax4jsf.framework.resource.BaseResourceRenderer.encode(BaseResourceRenderer.java:45)
       at org.ajax4jsf.framework.resource.InternetResourceBase.encode(InternetResourceBase.java:306)
       at org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.encodeResourcesArray(HeaderResourcesRendererBase.java:131)
       at org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.preEncodeBegin(HeaderResourcesRendererBase.java:118)
       at org.ajax4jsf.framework.renderer.RendererBase.encodeBegin(RendererBase.java:94)
       at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:515)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
       at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:315)
       at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: java.lang.NullPointerException
       at org.ajax4jsf.framework.resource.ResourceBuilderImpl.encrypt(ResourceBuilderImpl.java:545)
       ... 37 more
      09:43:32,798 ERROR [STDERR] Mar 8, 2007 9:43:32 AM com.sun.facelets.FaceletViewHandler handleRenderException
      SEVERE: Error Rendering View[/login.xhtml]
      javax.faces.FacesException: Resources framework is not initialised, check web.xml for Filter configuration
       at org.ajax4jsf.framework.resource.ResourceBuilderImpl.getWebXml(ResourceBuilderImpl.java:107)
       at org.ajax4jsf.framework.resource.ResourceBuilderImpl.getUri(ResourceBuilderImpl.java:309)
       at org.ajax4jsf.framework.resource.InternetResourceBase.getUri(InternetResourceBase.java:211)
       at org.ajax4jsf.framework.resource.BaseResourceRenderer.encodeBegin(BaseResourceRenderer.java:62)
       at org.ajax4jsf.framework.resource.OneTimeRenderer.encodeBegin(OneTimeRenderer.java:48)
       at org.ajax4jsf.framework.resource.BaseResourceRenderer.encode(BaseResourceRenderer.java:45)
       at org.ajax4jsf.framework.resource.InternetResourceBase.encode(InternetResourceBase.java:306)
       at org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.encodeResourcesArray(HeaderResourcesRendererBase.java:131)
       at org.ajax4jsf.framework.renderer.HeaderResourcesRendererBase.preEncodeBegin(HeaderResourcesRendererBase.java:118)
       at org.ajax4jsf.framework.renderer.RendererBase.encodeBegin(RendererBase.java:94)
       at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:515)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:232)
       at com.sun.facelets.tag.jsf.ComponentSupport.encodeRecursive(ComponentSupport.java:239)
       at com.sun.facelets.FaceletViewHandler.renderView(FaceletViewHandler.java:580)
       at org.ajax4jsf.framework.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
       at org.ajax4jsf.framework.ajax.AjaxViewHandler.renderView(AjaxViewHandler.java:229)
       at org.apache.myfaces.lifecycle.RenderResponseExecutor.execute(RenderResponseExecutor.java:41)
       at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:132)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:140)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
       at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
       at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
       at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
       at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
       at org.apache.catalina.authenticator.FormAuthenticator.forwardToLoginPage(FormAuthenticator.java:315)
       at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:243)
       at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
       at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
       at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
       at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
       at java.lang.Thread.run(Thread.java:619)
      


      web.xml:
      <!-- Ajax4jsf -->
       <context-param>
       <param-name>org.ajax4jsf.SKIN</param-name>
       <param-value>blueSky</param-value>
       </context-param>
       <context-param>
       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
       <param-value>org.jboss.seam.ui.facelet.SeamFaceletViewHandler</param-value>
       </context-param>
       <filter>
       <display-name>Ajax4jsf Filter</display-name>
       <filter-name>ajax4jsf</filter-name>
       <filter-class>org.ajax4jsf.Filter</filter-class>
       </filter>
       <filter-mapping>
       <filter-name>ajax4jsf</filter-name>
       <url-pattern>*.jsf</url-pattern>
       </filter-mapping>


      The crazy thing is, that when I try to access a page directly, all works fine with richfaces.
      Might there be a problem with JAAS? Without a4j and richfaces everything works fine.

      Thanks for any helps.
      Michael

        • 1. Re: Error: Resources framework is not initialised
          Michael Schuetz Newbie

          BTW,
          when I use

          <filter-mapping>
           <filter-name>ajax4jsf</filter-name>
           <servlet-name>Faces Servlet</servlet-name>
           <dispatcher>REQUEST</dispatcher>
           <dispatcher>FORWARD</dispatcher>
           <dispatcher>INCLUDE</dispatcher>
           </filter-mapping>


          instead of
          <filter-mapping>
           <filter-name>ajax4jsf</filter-name>
           <url-pattern>*.jsf</url-pattern>
           </filter-mapping>


          the application starts fine, but then I get problems when trying to access my SFSB (it alyways become null)

          • 2. Re: Error: Resources framework is not initialised
            Michael Schuetz Newbie

            Update:
            The Problem isn't the SFSB - the problem occurs when using the enhanced el:

            <h:dataTable value="#{assignedLocations}" var="aLocation"
             rendered="#{assignedLocations.rowCount != 0}">
             <h:column>
             <f:facet name="header">
             Standorte
             </f:facet>
             <s:link value="#{aLocation.displayName}"
             action="#{location.openLocation(aLocation)}" />
             </h:column>
             <h:column>
             <s:button value="Löschen"
             action="#{company.removeLocation(aLocation)}" />
             </h:column>
             </h:dataTable>


            I think there must be a problem with the filters .

            Here is my complete web.xml:
            <?xml version="1.0" encoding="UTF-8"?>
            <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
            
             <context-param>
             <param-name>javax.faces.CONFIG_FILES</param-name>
             <param-value>
             /WEB-INF/navigation.xml, /WEB-INF/converter.xml
             </param-value>
             </context-param>
            
             <!-- welcome file -->
             <welcome-file-list>
             <welcome-file>index.html</welcome-file>
             </welcome-file-list>
            
             <!-- error handling -->
             <error-page>
             <error-code>404</error-code>
             <location>/error/404.jsf</location>
             </error-page>
            
             <!-- Ajax4JSF -->
             <context-param>
             <param-name>org.ajax4jsf.SKIN</param-name>
             <param-value>blueSky</param-value>
             </context-param>
             <filter>
             <display-name>Ajax4jsf Filter</display-name>
             <filter-name>ajax4jsf</filter-name>
             <filter-class>org.ajax4jsf.Filter</filter-class>
             </filter>
             <filter-mapping>
             <filter-name>ajax4jsf</filter-name>
             <servlet-name>Faces Servlet</servlet-name>
             <dispatcher>REQUEST</dispatcher>
             <dispatcher>FORWARD</dispatcher>
             <dispatcher>INCLUDE</dispatcher>
             </filter-mapping>
            
             <!-- Seam -->
            
             <listener>
             <listener-class>
             org.jboss.seam.servlet.SeamListener
             </listener-class>
             </listener>
            
             <!-- when true, seam will catch exceptions and shows debug page -->
             <context-param>
             <param-name>org.jboss.seam.core.init.debug</param-name>
             <param-value>false</param-value>
             </context-param>
            
             <!-- Propagate conversations across redirects -->
             <filter>
             <filter-name>Seam Redirect Filter</filter-name>
             <filter-class>
             org.jboss.seam.servlet.SeamRedirectFilter
             </filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>Seam Redirect Filter</filter-name>
             <url-pattern>*.jsf</url-pattern>
             </filter-mapping>
            
             <filter>
             <filter-name>Seam Exception Filter</filter-name>
             <filter-class>
             org.jboss.seam.servlet.SeamExceptionFilter
             </filter-class>
             </filter>
            
             <filter-mapping>
             <filter-name>Seam Exception Filter</filter-name>
             <url-pattern>*.jsf</url-pattern>
             </filter-mapping>
            
            
            
             <!-- JSF -->
            
             <context-param>
             <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
             <param-value>server</param-value>
             </context-param>
            
             <context-param>
             <param-name>
             org.apache.myfaces.COMPRESS_STATE_IN_SESSION
             </param-name>
             <param-value>false</param-value>
             </context-param>
            
             <context-param>
             <param-name>
             org.apache.myfaces.SERIALIZE_STATE_IN_SESSION
             </param-name>
             <param-value>false</param-value>
             </context-param>
            
             <!-- only applicable if state saving method = "server" -->
             <context-param>
             <param-name>
             org.apache.myfaces.NUMBER_OF_VIEWS_IN_SESSION
             </param-name>
             <param-value>20</param-value>
             </context-param>
            
             <context-param>
             <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
             <param-value>.xhtml</param-value>
             </context-param>
            
             <context-param>
             <param-name>facelets.DEVELOPMENT</param-name>
             <param-value>true</param-value>
             </context-param>
            
             <servlet>
             <servlet-name>Faces Servlet</servlet-name>
             <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
             <load-on-startup>1</load-on-startup>
             </servlet>
            
             <!-- Faces Servlet Mapping -->
             <servlet-mapping>
             <servlet-name>Faces Servlet</servlet-name>
             <url-pattern>*.jsf</url-pattern>
             </servlet-mapping>
            
             <!-- MyFaces -->
             <listener>
             <listener-class>
             org.apache.myfaces.webapp.StartupServletContextListener
             </listener-class>
             </listener>
            
             <security-constraint>
             <web-resource-collection>
             <web-resource-name>
             Secured XX Pages
             </web-resource-name>
             <url-pattern>/user/*</url-pattern>
             <http-method>POST</http-method>
             <http-method>GET</http-method>
             </web-resource-collection>
             <auth-constraint>
             <role-name>USER</role-name>
             </auth-constraint>
             </security-constraint>
            
             <login-config>
             <auth-method>FORM</auth-method>
             <form-login-config>
             <form-login-page>/login.jsf</form-login-page>
             <form-error-page>/loginFailed.jsf</form-error-page>
             </form-login-config>
             </login-config>
            
             <security-role>
             <description>user role</description>
             <role-name>USER</role-name>
             </security-role>
            
            </web-app>
            


            • 3. Re: Error: Resources framework is not initialised
              Michael Schuetz Newbie

              I solved the problem:

              <filter-mapping>
               <filter-name>ajax4jsf</filter-name>
               <url-pattern>*.jsf</url-pattern>
               <dispatcher>REQUEST</dispatcher>
               <dispatcher>FORWARD</dispatcher>
               <dispatcher>INCLUDE</dispatcher>
               </filter-mapping>


              I do not understand why, but everything works absolutely fine now!

              • 4. Re: Error: Resources framework is not initialised
                Sergey Smirnov Master




                ....
                <filter-mapping>
                 <filter-name>ajax4jsf</filter-name>
                 <url-pattern>*.jsf</url-pattern>
                 <dispatcher>REQUEST</dispatcher>
                 <dispatcher>FORWARD</dispatcher>
                 <dispatcher>INCLUDE</dispatcher>
                 </filter-mapping>
                .....
                <filter>
                 <filter-name>Seam Redirect Filter</filter-name>
                 <filter-class>
                 org.jboss.seam.servlet.SeamRedirectFilter
                 </filter-class>
                 </filter>
                
                 <filter-mapping>
                 <filter-name>Seam Redirect Filter</filter-name>
                 <url-pattern>*.jsf</url-pattern>
                 </filter-mapping>
                
                 <filter>
                 <filter-name>Seam Exception Filter</filter-name>
                 <filter-class>
                 org.jboss.seam.servlet.SeamExceptionFilter
                 </filter-class>
                 </filter>
                
                 <filter-mapping>
                 <filter-name>Seam Exception Filter</filter-name>
                 <url-pattern>*.jsf</url-pattern>
                 </filter-mapping>
                ....
                


                Pay attention that you have the same method of filter mapping now for both seam and ajax4jsf stuff. I.e. <url-pattern>*.jsf</url-pattern>

                We was reported some day that having the same method of filter mapping makes the configuration working. It looks like it is a key moment.