5 Replies Latest reply on Apr 21, 2007 2:04 PM by christian.bauer

    Integrating Tomahawk with Seam

    aront54

      We want to use some of the Tomahawk extensions to MyFaces. We followed the instruction here to get the Tomahawk jar loaded with JBoss:

      http://wiki.jboss.org/wiki/Wiki.jsp?page=JBossWithIntegratedMyFaces

      The problem is, since we are using Seam we are using Facelets not jsp's. So we followed the instructions here:

      http://wiki.apache.org/myfaces/Use_Facelets_with_Tomahawk

      creating a tomahawk.taglib.xml file and adding the parameter to web.xml

      <context-param>
      <param-name>facelets.LIBRARIES</param-name>
      <param-value>/WEB-INF/tomahawk.taglib.xml</param-value>
      </context-param>

      When we do this, our page with the tomahawk tag gets this error:

      Error Rendering View[/postworkshoplist.xhtml]
      java.lang.IllegalStateException: ExtensionsFilter not correctly configured. JSF mapping missing. JSF pages not covered. Please see: http://myfaces.apache.org/tomahawk/extensionsFilter.html

      So we went to that page and tried to add the filter to our web.xml and our application crashes on startup.

      I was thinking perhaps we need to add the configuration to JBoss not our app, since the MyFaces stuff is in JBoss but I couldnt find anything on the JBoss site except in some forums people say they do have this configured.

      Any help on the configuration would be appreciated.

        • 1. Re: Integrating Tomahawk with Seam
          atao

           


          I was thinking perhaps we need to add the configuration to JBoss not our app, since the MyFaces stuff is in JBoss but I couldnt find anything on the JBoss site except in some forums people say they do have this configured.


          Tomahawk works fine with application configuration. I put this in web.xml:

           <!-- MyFaces : Tomahawk extension -->
          
           <filter>
           <filter-name>MyFacesExtensionsFilter</filter-name>
           <filter-class>org.apache.myfaces.webapp.filter.ExtensionsFilter</filter-class>
           <init-param>
           <param-name>maxFileSize</param-name>
           <param-value>20m</param-value>
           </init-param>
           </filter>
          
           <!-- extension mapping for adding <script/>, <link/>, and other resource tags to JSF-pages -->
          <!-- keep only the mappingwith url-pattern
           <filter-mapping>
           <filter-name>MyFacesExtensionsFilter</filter-name>
           <servlet-name>Faces Servlet</servlet-name>
           </filter-mapping>
          -->
          
           <filter-mapping>
           <filter-name>MyFacesExtensionsFilter</filter-name>
           <url-pattern>*.seam</url-pattern>
           </filter-mapping>
          
           <!-- extension mapping for serving page-independent resources (javascript, stylesheets, images, etc.) -->
           <filter-mapping>
           <filter-name>MyFacesExtensionsFilter</filter-name>
           <url-pattern>/faces/*</url-pattern>
           </filter-mapping>
          
          


          • 2. Re: Integrating Tomahawk with Seam
            aront54

            As noted in my post, I added the mappings to my web.xml and that just made my application crash. I tried both the "servlet-name" alternative and the "url-pattern" one. Does the tomahawk,jar have to be in the web-inf/lib director or is it sufficient that its in the server-->jbossas-tomcat--> lib directory?

            • 3. Re: Integrating Tomahawk with Seam
              atao

               

              As noted in my post, I added the mappings to my web.xml and that just made my application crash.

              yes but your error message states that
              ExtensionsFilter not correctly configured

              so...

              And about
              tomahawk,jar have to be in the web-inf/lib


              I think it's ok in the war/WEB-INF/lib directory.

              In my configuration, I put it in the root of the ear archive and I add its reference in the classpath of war/META-INF/MANIFEST.MF

              • 4. Re: Integrating Tomahawk with Seam
                aront54

                Thanks atao for your comments. However, the error message you note is BEFORE we added the filter. That's how we knew we needed a filter. After we added the filter the app crashes at startup and the exception we get is:

                13:41:08,379 ERROR [ExceptionFilter] exception root cause
                java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileUpload

                Perhaps we are missing some jar?

                • 5. Re: Integrating Tomahawk with Seam
                  christian.bauer

                  Well yes, you missing some commons-*.jar. Check the dependencies of Tomahawk.