[jboss-user] [JBoss Seam] - Re: Run JSF RI on WebSphere 6.1

titou09 do-not-reply at jboss.com
Fri Nov 9 13:36:33 EST 2007


Hie Joe 
i plan to write a kind of bullet point list on how to make seam 1.2.1 work with was v6.1.0.11 but we are very very busy now.
We also can't migrate to seam 2.0 because of bug seam-2029 which is blocking for us
In the meantime, to anser your question:
- we use POJOs (we dind't want to try the ejb3 technology preview currently available from ibm)
- ear and war classloader have to be set to parent_last
- components.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:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |    xsi:schemaLocation="http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.2.xsd http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.2.xsd">
  | 
  |    <!-- Conversations -->
  |    <core:manager
  |       conversation-timeout="600000"
  |       concurrent-request-timeout="1000"
  |       conversation-id-parameter="cid"
  |       conversation-is-long-running-parameter="clr" />
  | 
  |    <!-- JSF Resource Bundle -->
  |    <core:resource-bundle>
  |      <core:bundle-names>
  |          <value>ressources.administrateur</value>
  | ...
  |       </core:bundle-names>
  |    </core:resource-bundle>
  | 
  |    <!-- Bootstrap Hibernate -->
  |    <core:hibernate-session-factory name="promopunchSeamSessionFactory" />
  |    <core:managed-hibernate-session
  |       name="sessionHibernate"
  |       auto-create="true"
  |       session-factory-jndi-name="promopunchSeamSessionFactory" />
  | </components>
  | 
  | 

- hibernate.cfg.xml (partial)

  | <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
  | <hibernate-configuration>
  | 	<session-factory name="promopunchSeamSessionFactory">
  |       <!-- DataSource -->
  | 		<property name="connection.datasource">java:comp/env/jdbc/promopunch2</property>
  |       <property name="dialect">com.saq.util.hibernate.dialect.DB28Dialect</property>
  |       <!-- SQL -->
  | 		<property name="default_schema">SAQPP</property>
  |       <property name="hibernate.jdbc.use_get_generated_keys">true</property>
  | 		<property name="hibernate.format_sql">true</property>
  | 		<property name="hibernate.show_sql">true</property>
  |       <!-- Session/Tx Managment -->		
  |       <property name="transaction.flush_before_completion">true</property>
  | 		<property name="connection.release_mode">after_statement</property>
  | 		<property name="transaction.manager_lookup_class">org.hibernate.transaction.WebSphereExtendedJTATransactionLookup</property>
  | 		<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
  | 		<!--  Mappings -->
  |       <mapping resource="com/saq/pp/metier/modele/valeur/Agent.hbm.xml"/>
  | ...
  | 
  | 	</session-factory>
  | </hibernate-configuration>
  | 
web.xml (partial

  | <?xml version="1.0" encoding="UTF-8"?>
  | <web-app
  |    id="WebApp_ID"
  |    version="2.4"
  |    xmlns="http://java.sun.com/xml/ns/j2ee"
  |    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
  |    <display-name>PromoPunchWeb</display-name>
  |    <!-- Configuration: JSF RI + Facelets -->
  |    <context-param>
  |       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
  |       <param-value>server</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>com.sun.faces.preferXHTML</param-name>
  |       <param-value>true</param-value>
  |    </context-param>
  |    <context-param> 
  |       <param-name>facelets.LIBRARIES</param-name> 
  |       <param-value>/WEB-INF/promopunch.taglib.xml</param-value> 
  |    </context-param>   
  | 
  |    <!-- Configuration: RichFaces -->
  |    <context-param>
  |       <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
  |       <param-value>com.sun.facelets.FaceletViewHandler</param-value>
  |    </context-param>
  |    <context-param>
  |       <param-name>org.richfaces.SKIN</param-name>
  |       <param-value>ruby</param-value>
  |    </context-param>
  | 
  |    <!-- Configuration: Debugging JSF RI et Facelets -->
  |    <context-param>
  |       <param-name>facelets.DEVELOPMENT</param-name>
  |       <param-value>true</param-value>
  |    </context-param>
  |    <context-param>
  |       <param-name>com.sun.faces.verifyObjects</param-name>
  |       <param-value>true</param-value>
  |    </context-param>
  |    <context-param>
  |       <param-name>com.sun.faces.validateXml</param-name>
  |       <param-value>true</param-value>
  |    </context-param>
  |    <context-param>
  |       <param-name>com.sun.faces.displayConfiguration</param-name>
  |       <param-value>true</param-value>
  |    </context-param>
  |    <!-- Listeners -->
  |    <listener>
  |       <description>Initialisation Promopunch (Avant Seam)</description>
  |       <listener-class>com.saq.pp.web.listener.ListenerInitPreSeam</listener-class>
  |    </listener>
  |    <listener>
  |       <description>JBoss Seam Listener</description>
  |       <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
  |    </listener>
  |    <listener>
  |       <description>JSF Listener</description>
  |       <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
  |    </listener>
  |    <listener>
  |       <description>Initialisation Promopunch (Apres Seam)</description>
  |       <listener-class>com.saq.pp.web.listener.ListenerInitPostSeam</listener-class>
  |    </listener>
  |  
  |    <!-- Filters -->
  |    <filter>
  |       <description>Empeche l'appel direct à la page de login</description>
  |       <filter-name>Filtre Page Login</filter-name>
  |       <filter-class>com.saq.pp.web.filter.FiltrePageLogin</filter-class>
  |    </filter>
  | 
  |    <filter>
  |       <filter-name>Filtre Seam</filter-name>
  |       <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
  |    </filter>
  |    <filter>
  |       <filter-name>RichFaces</filter-name>
  |       <filter-class>org.ajax4jsf.Filter</filter-class>
  |    </filter>
  |    <filter>
  |       <description>Verifie que l'application a bien ete initialisee</description>
  |       <filter-name>Filtre Application Initialisee</filter-name>
  |       <filter-class>com.saq.pp.web.filter.FiltreApplicationInitialisee</filter-class>
  |    </filter>
  |    <filter>
  |       <description>Gestion des objets de session Promopunch</description>
  |       <filter-name>Filtre Gestion Session</filter-name>
  |       <filter-class>com.saq.pp.web.filter.FiltreGestionSession</filter-class>
  |    </filter>
  |    
  |    
  |    <filter-mapping>
  |       <filter-name>Filtre Page Login</filter-name>
  |       <url-pattern>/login/login.jsp</url-pattern>
  |    </filter-mapping>
  | 
  |    <filter-mapping>
  |       <filter-name>Filtre Seam</filter-name>
  |       <url-pattern>/*</url-pattern>
  |    </filter-mapping>
  |    <filter-mapping>
  |      <filter-name>RichFaces</filter-name>
  |       <url-pattern>*.jsf</url-pattern>
  |    </filter-mapping>
  |    <filter-mapping>
  |       <filter-name>Filtre Application Initialisee</filter-name>
  |       <url-pattern>*.jsf</url-pattern>
  |    </filter-mapping>
  |    <filter-mapping>
  |       <filter-name>Filtre Gestion Session</filter-name>
  |       <url-pattern>*.jsf</url-pattern>
  |    </filter-mapping>
  |    
  |    <!-- Servlets -->
  |    <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.ResourceServlet</servlet-class>
  |       <load-on-startup>2</load-on-startup>
  |    </servlet>
  |    
  |    <servlet-mapping>
  |       <servlet-name>Faces Servlet</servlet-name>
  |       <url-pattern>*.jsf</url-pattern>
  |    </servlet-mapping>
  |    <servlet-mapping>
  |       <servlet-name>Seam Resource Servlet</servlet-name>
  |       <url-pattern>/seam/resource/*</url-pattern>
  |    </servlet-mapping>
  | 
  |    <error-page>
  |       <error-code>403</error-code>
  |       <location>/pages/erreurs/erreur_403.jsf</location>
  |    </error-page>
  | 	<error-page>
  | 		<error-code>404</error-code>
  | 		<location>/pages/erreurs/erreur_404.jsf</location>
  | 	</error-page>
  |    <error-page>
  |       <error-code>500</error-code>
  |       <location>/erreur.jsp</location>
  |    </error-page>
  | 	<error-page>
  |       <exception-type>java.lang.Throwable</exception-type>
  |       <location>/erreur.jsp</location>
  | 	</error-page>
  |    
  |    <welcome-file-list>
  |       <welcome-file>index.html</welcome-file>
  |    </welcome-file-list>
  | 
  |    <security-constraint>
  |       <display-name>login</display-name>
  |       <web-resource-collection>
  |          <web-resource-name>HTTPS</web-resource-name>
  |          <url-pattern>/login/login.jsp</url-pattern>
  |          <http-method>GET</http-method>
  |          <http-method>POST</http-method>
  |       </web-resource-collection>
  |       <auth-constraint>
  |          <description>ToutLeMonde</description>
  |          <role-name>ToutleMonde</role-name>
  |       </auth-constraint>
  |       <user-data-constraint>
  |          <transport-guarantee>CONFIDENTIAL</transport-guarantee>
  |       </user-data-constraint>
  |    </security-constraint>
  | 
  | ...
  |    <resource-ref id="ResourceRef_1179232024878">
  |       <description></description>
  |       <res-ref-name>jdbc/promopunch2</res-ref-name>
  |       <res-type>javax.sql.DataSource</res-type>
  |       <res-auth>Container</res-auth>
  |       <res-sharing-scope>Shareable</res-sharing-scope>
  |    </resource-ref>
  | 
  |    </web-app>
  | 
  | 

- copy the following libs into web-inf/lib of the web project
el-api.jar
el-ri.jar
jboss-seam.jar
jsf-api.jar
jsf-impl.jar
jsf-facelets.jar
richfaces-api-3.1.2.GA.jar
richfaces-impl-3.1.2.GA.jar
richfaces-ui-3.1.2.GA.jar
- also extract all the *.taglib.xml of seam and richfaces in META_INF of the web project (this bis a webspehre bug corrected in version 6.1.0.13)
 
- put the remaining libs into the ear. references thoses lib in the manifgest.mf file of the web project
- we had to change one hibernate class org.hibernate.transaction.JTATransactionFactory (comment from line 76 to 97) because of an hibernate bug (don't have the ref in hand now...but searh on : JTATransactionFacytory and websphere in jira hibernate )

When i'll have time, i'll try to write some kind of how-to in the wiki
hope that helps
Denis Forveille


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4103342#4103342

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4103342




More information about the jboss-user mailing list