1 Reply Latest reply on Oct 5, 2012 10:16 PM by John Genoese

    Combine Seam 2.2 and Icefaces 1.8

    S Sippel Newbie

      Hi

       

      Ich have to combine Seam 2.2 and Icefaces 1.8 on Jboss 5.1, Java 1.5

      Versions cant be changed. Perhaps Seam 2.1.1 is an option.

       

      I useEclipse 3.5 with Jboss Tools and Dynamic Web Project Wizard.

       

      I took an Seam 2.2 Proect modified with Icefaces 1.8, Icefaces Facelet 1.8, Facelet 1.0, Dynamic web Module (2.5)

      auogenerate web.xml

       

      Librarys:

      Icefaces Core 1.8.2

      Icefacs Faclet 1.8.2

      Support Library 1.8.2

      JSF 1.2 Mojarra JSF API Implementation 1.2_015_b01 fcs

       

      Seam 2.2

      deploy as war

      H2 database with jdbc h2dialect

       

      and icefaces example page

       

      Notice that i could run Seam 2.2 pure and Icefaces 1.8 pure.

      But not both in one project.

       

       

      renderManager is included:

       

      component.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
                xmlns:core="http://jboss.com/products/seam/core" xmlns:persistence="http://jboss.com/products/seam/persistence"
                xmlns:drools="http://jboss.com/products/seam/drools" xmlns:bpm="http://jboss.com/products/seam/bpm"
                xmlns:security="http://jboss.com/products/seam/security" xmlns:mail="http://jboss.com/products/seam/mail"
                xmlns:web="http://jboss.com/products/seam/web" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-2.2.xsd
                       http://jboss.com/products/seam/persistence http://jboss.com/products/seam/persistence-2.2.xsd
                       http://jboss.com/products/seam/drools http://jboss.com/products/seam/drools-2.2.xsd
                       http://jboss.com/products/seam/bpm http://jboss.com/products/seam/bpm-2.2.xsd
                       http://jboss.com/products/seam/security http://jboss.com/products/seam/security-2.2.xsd
                       http://jboss.com/products/seam/mail http://jboss.com/products/seam/mail-2.2.xsd
                       http://jboss.com/products/seam/web http://jboss.com/products/seam/web-2.2.xsd
                       http://jboss.com/products/seam/components http://jboss.com/products/seam/components-2.2.xsd">
      
      
                <core:init debug="true" jndi-pattern="@jndiPattern@" />
      
      
                <component scope="APPLICATION" auto-create="true" name="renderManager"
                          class="com.icesoft.faces.async.render.RenderManager" />
      
      
                <core:manager concurrent-request-timeout="500"
                          conversation-timeout="120000" conversation-id-parameter="cid"
                          parent-conversation-id-parameter="pid" />
      
      
                <!--
                          Make sure this URL pattern is the same as that used by the Faces
                          Servlet
                -->
                <web:hot-deploy-filter url-pattern="*.seam" />
      
      
                <!--
                          If you are still using JBoss 4, uncomment this to have your PU started
                -->
                <!--
                          <persistence:entity-manager-factory name="entityManagerFactory"
                -->
                <!--
                          persistence-unit-name="frozenseamHelpedByJBOSS"/>
                -->
                <!--
                          If you are still using JBoss 4, uncomment this to have the
                          entityManagerFactory ysed
                -->
                <!--
                          <persistence:managed-persistence-context name="entityManager"
                          auto-create="true"
                -->
                <!--
                          entity-manager-factory="#{entityManagerFactory}"/>
                -->
      
      
                <persistence:managed-persistence-context
                          name="entityManager" auto-create="true"
                          persistence-unit-jndi-name="java:/frozenseamHelpedByJBOSSEntityManagerFactory" />
      
      
                <drools:rule-base name="securityRules">
                          <drools:rule-files>
                                    <value>/security.drl</value>
                          </drools:rule-files>
                </drools:rule-base>
      
      
                <security:rule-based-permission-resolver
                          security-rules="#{securityRules}" />
      
      
                <security:identity authenticate-method="#{authenticator.authenticate}"
                          remember-me="true" />
      
      
                <event type="org.jboss.seam.security.notLoggedIn">
                          <action execute="#{redirect.captureCurrentView}" />
                </event>
                <event type="org.jboss.seam.security.loginSuccessful">
                          <action execute="#{redirect.returnToCapturedView}" />
                </event>
      
      
                <mail:mail-session host="localhost" port="25" />
      
      
                <!-- For use with jBPM pageflow or process management -->
                <!--
                          <bpm:jbpm> <bpm:process-definitions></bpm:process-definitions>
                          <bpm:pageflow-definitions></bpm:pageflow-definitions> </bpm:jbpm>
                -->
      
      
      </components>
      

       

       

      web faces.xml with view icefaces handler

       

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      
      
      <faces-config
          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-facesconfig_1_2.xsd"
          version="1.2">
                <application>
                          <view-handler>com.icesoft.faces.facelets.D2DFaceletViewHandler</view-handler>
                          <locale-config>
                                    <default-locale>en</default-locale>
                                    <supported-locale>bg</supported-locale>
                                    <supported-locale>de</supported-locale>
                                    <supported-locale>en</supported-locale>
                                    <supported-locale>fr</supported-locale>
                                    <supported-locale>tr</supported-locale>
                          </locale-config>
                </application>
      
      
      </faces-config>
      
      

       

      web.xml  with com.icesoft.faces.util.event.servlet.ContextEventRepeater and and State saving method "server"

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <web-app id="WebApp_ID" 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">
       <display-name>frozenseamHelpedByJBOSS</display-name>
       <context-param>
        <param-name>com.icesoft.faces.synchronousUpdate</param-name>
        <param-value>false</param-value>
       </context-param>
       <context-param>
        <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>server</param-value>
       </context-param>
       <context-param>
        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
        <param-value>resources.application</param-value>
       </context-param>
       <context-param>
        <param-name>org.richfaces.SKIN</param-name>
        <param-value>blueSky</param-value>
       </context-param>
       <context-param>
        <param-name>facelets.DEVELOPMENT</param-name>
        <param-value>true</param-value>
       </context-param>
       <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
       </context-param>
       <context-param>
        <description>To allow multiple windows for a single application.</description>
        <param-name>com.icesoft.faces.concurrentDOMViews</param-name>
        <param-value>false</param-value>
       </context-param>
       <context-param>
        <description>Turn on/off application-wide synchronous or asynchronous updates.          </description>
        <param-name>com.icesoft.faces.synchronousUpdate</param-name>
        <param-value>false</param-value>
       </context-param>
       <context-param>
        <description>Google Maps API key is required if gMap component is used. Sign up for an API key from http://code.google.com/apis/maps/signup.html</description>
        <param-name>com.icesoft.faces.gmapKey</param-name>
        <param-value>ABQIAAAADlu0ZiSTam64EKaCQr9eTRTOTuQNzJNXRlYRLknj4cQ89tFfpxTEqxQnVWL4k55OPICgF5_SOZE06A</param-value>
       </context-param>
       <context-param>
        <param-name>com.icesoft.faces.uploadDirectory</param-name>
        <param-value>upload</param-value>
       </context-param>
       <context-param>
        <param-name>com.icesoft.faces.uploadMaxFileSize</param-name>
        <param-value>4048576</param-value>
       </context-param>
       <filter>
        <filter-name>Seam Filter</filter-name>
        <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
       </filter>
       <filter-mapping>
        <filter-name>Seam Filter</filter-name>
        <url-pattern>/*</url-pattern>
       </filter-mapping>
       <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
       </listener>
       <listener>
        <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
       </listener>
       <listener>
        <listener-class>com.icesoft.faces.util.event.servlet.ContextEventRepeater</listener-class>
       </listener>
       <servlet>
        <servlet-name>Faces Servlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet>
        <servlet-name>Seam Resource Servlet</servlet-name>
        <servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
       </servlet>
       <servlet>
        <servlet-name>Persistent Faces Servlet</servlet-name>
        <servlet-class>com.icesoft.faces.webapp.xmlhttp.PersistentFacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet>
        <servlet-name>Blocking Servlet</servlet-name>
        <servlet-class>com.icesoft.faces.webapp.xmlhttp.BlockingServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet>
        <servlet-name>uploadServlet</servlet-name>
        <servlet-class>com.icesoft.faces.component.inputfile.FileUploadServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
       </servlet>
       <servlet-mapping>
        <servlet-name>Seam Resource Servlet</servlet-name>
        <url-pattern>/seam/resource/*</url-pattern>
       </servlet-mapping>
       <servlet-mapping>
        <servlet-name>Persistent Faces Servlet</servlet-name>
        <url-pattern>*.iface</url-pattern>
       </servlet-mapping>
       <servlet-mapping>
        <servlet-name>Blocking Servlet</servlet-name>
        <url-pattern>/block/*</url-pattern>
       </servlet-mapping>
       <servlet-mapping>
        <servlet-name>uploadServlet</servlet-name>
        <url-pattern>/uploadHtml</url-pattern>
       </servlet-mapping>
       <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
       </welcome-file-list>
       <security-constraint>
        <display-name>Restrict raw XHTML Documents</display-name>
        <web-resource-collection>
         <web-resource-name>XHTML</web-resource-name>
         <url-pattern>*.xhtml</url-pattern>
        </web-resource-collection>
        <auth-constraint/>
       </security-constraint>
       <login-config>
        <auth-method>BASIC</auth-method>
       </login-config>
      </web-app>
      

       

      I know this not very good site:

      http://seamframework.org/Documentation/UsingICEFacesWithJBossToolsGeneratedProjects

       

      1. Generate a Seam Web Project in JBoss Tools (procedure should be similar for both EAR and WAR deployment)

      i do it

      1. Generate a seam-gen-icefaces project somewhere

      i do it (described above)

      1. Copy the web.xml, faces-config.xml and components.xml from the seam-gen-icefaces project to your JBoss Tools project, replacing them (OK, you actually only need the view-handler from faces-config.xml and the renderManager from components.xml)

      No Problem

      1. Remove the jsf-facelets.jar and richfaces*.jar from the JBoss Tools project library folder (OK, the richfaces jars should be pretty harmless but you might as well remove them)

      No Problem.

      1. Add the icefaces-comps.jar, icefaces-facelets.jar and icefaces.jar to the JBoss Tools project (location depends on if you generated a WAR or EAR based project)

      As Web or normal libries?

      1. Add the backport-util-concurrent.jar and commons-fileupload.jar to the JBoss Tools project (same thing about the EAR/WAR selection)
      2. Copy the home.xhtml from the seam-gen icefaces project to your JBoss Tools project for a semi-working test

       

      Why I cant make a Seam 2.2 project with Icefaces Libaries? Is that not the same?

       

       

      If I want a pure Icefaces 1.8 project I have to delete the

      jsf-api.jar, jsf-impl.jar

      https://community.jboss.org/thread/141903

       

      If I do this in the seam gen Icefaces project, i get a dependecy error (i delete in war file, because in the project there is nothing).

       

      If I do it not, I get a configuration error.

       

      for example:  Error configuring application listener of class org.apache.myfaces.webapp.StartupServletContextListener

       

      I hope someone have an idea!

       

      Dear

      hannibal