[jboss-user] [JBoss Seam] - My Upgrade Guide (1.2.1 to 1.3.0 CVS) for Glassfish users

ylazzari do-not-reply at jboss.com
Wed Jun 27 08:31:05 EDT 2007


Hi all,

I thought I'd share with the other Glassfish users the steps I had to perform to upgrade from 1.2.1 to the latest 1.3.0 CVS version (20070625).  It might be useful for others and also will help me insure that what I've done is correct (even though things seem to be working just fine).  Note that this was written assuming you use Ajax4jsf and RichFaces.

1. Changes in the classpath
- 2 new jars are needed, jboss-common.jar and jboss-el.jar.  You can get them from the lib folder of the Seam download.  
- Also for those who hadn't switched to Ajax4jsf 1.1.1 and RichFaces 3.0.1 yet, it probably is a requirement as well (can't confirm that, I already had upgraded).

2. Changes in the web.xml
- The context-param org.ajax4jsf.VIEW_HANDLERS should be changed from org.jboss.seam.ui.facelet.SeamFaceletViewHandler to com.sun.facelets.FaceletViewHandler.
- The ajax4jsf filter should be removed.
- I personally had to add the following:

  |     <listener>        
  |         <listener-class>com.sun.faces.config.ConfigureListener</listener-class>    
  |     </listener>        
  | 
I read someone else's post saying that this bit could be removed (I didn't have it before) but without this, I had a weird exception.  This might be due to the fact that I'm using version v2-b41d of Glassfish.  Could someone confirm the behaviour on the latest version of Glassfish?

3. Changes in the faces-config.xml
- Remove the org.jboss.seam.jsf.SeamELResolver el-resolver from the application section.
- Remove the org.jboss.seam.jsf.SeamPhaseListener phase-listener from the lifecycle section.

4. Changes in the components.xml
- Remove the conversation-is-long-running-parameter attribute from the core:manager element.
- I also tried to update the xsd to the 1.3 version, but I had 404 for all of them.  In the meantime, I did what was necessary in NetBeans to be able to use them (manually added the schemas to the User Catalog).  The xsd files can be found in the src/main/org/jboss/seam folder of the Seam download.

I think that's it.  I picked up these changes by reading the posts in this forum and by looking that the jee5 example packaged in the Seam download (it used to be the glassfish example).

If anyone sees something wrong or wants to add anything, please feel free to do so.

For simplicity's sake, here's a version of all my config files.

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">   
  |     
  |     <!-- JSF and Facelets -->        
  |     <context-param>        
  |         <param-name>javax.faces.STATE_SAVING_METHOD</param-name>        
  |         <param-value>client</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>    
  |     
  |     <!-- 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>com.sun.facelets.FaceletViewHandler</param-value>	
  |     </context-param>        
  |         
  |     <!-- Seam Filter -->
  |     <filter>
  |         <filter-name>Seam Filter</filter-name>
  |         <filter-class>org.jboss.seam.web.SeamFilter</filter-class>
  |     </filter>  
  |     <filter-mapping>
  |         <filter-name>Seam Filter</filter-name>
  |         <url-pattern>/*</url-pattern>
  |     </filter-mapping>
  |     
  |     <!-- Seam Listener -->       
  |     <listener>        
  |         <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>    
  |     </listener>        
  |     
  |     <!-- JSF RI --> 
  |     <listener>        
  |         <listener-class>com.sun.faces.config.ConfigureListener</listener-class>    
  |     </listener>        
  |     
  |     
  |     <!-- Seam Resource Servlet -->
  |     <servlet>
  |         <servlet-name>Seam Resource Servlet</servlet-name>
  |         <servlet-class>org.jboss.seam.servlet.ResourceServlet</servlet-class>
  |     </servlet>    
  |     <servlet-mapping>
  |         <servlet-name>Seam Resource Servlet</servlet-name>
  |         <url-pattern>/seam/resource/*</url-pattern>
  |     </servlet-mapping>   
  |     
  |     
  |     <!-- Faces Servlet -->
  |     <servlet>        
  |         <servlet-name>Faces Servlet</servlet-name>        
  |         <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>        
  |         <load-on-startup>1</load-on-startup>    
  |     </servlet>        
  |     <servlet-mapping>        
  |         <servlet-name>Faces Servlet</servlet-name>        
  |         <url-pattern>*.seam</url-pattern>    
  |     </servlet-mapping>          
  |     
  |     <!-- Controllers -->
  |     <ejb-local-ref>              
  |         <ejb-ref-name>moxxi/TestControllerBean/local</ejb-ref-name>
  |         <ejb-ref-type>Session</ejb-ref-type>
  |         <local>org.irisquebec.moxxi.controller.test.TestController</local>
  |         <ejb-link>TestControllerBean</ejb-link>        
  |     </ejb-local-ref>	   
  |     
  |     <session-config>
  |         <session-timeout>10</session-timeout> 
  |     </session-config>       
  |     
  | </web-app>
  | 

faces-config.xml

  | <?xml version="1.0" encoding="UTF-8"?>
  | <faces-config version="1.2"
  |    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">
  |        
  |     <application>
  |         <message-bundle>messages</message-bundle>
  |     </application>
  |     
  | </faces-config>
  | 


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:security="http://jboss.com/products/seam/security"
  |             xmlns:transaction="http://jboss.com/products/seam/transaction"
  |             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  |             xsi:schemaLocation=
  |                 "http://jboss.com/products/seam/core http://jboss.com/products/seam/core-1.3.xsd 
  |                  http://jboss.com/products/seam/security http://jboss.com/products/seam/security-1.3.xsd
  |                  http://jboss.com/products/seam/transaction http://jboss.com/products/seam/transaction-1.3.xsd
  |                  http://jboss.com/products/seam/components http://jboss.com/products/seam/components-1.3.xsd">
  |     
  |     <core:init jndi-pattern="java:comp/env/moxxi/#{ejbName}/local" debug="true"/>    
  |     
  |     <core:manager conversation-timeout="120000" 
  |                   concurrent-request-timeout="500"
  |                   conversation-id-parameter="cid"/>
  |                   
  |     <security:identity authenticate-method="#{authenticationController.login}"/>         
  |     
  |     <event type="org.jboss.seam.notLoggedIn">
  |         <action expression="#{redirect.captureCurrentView}"/>
  |     </event>
  |     
  |     <event type="org.jboss.seam.postAuthenticate">
  |         <action expression="#{redirect.returnToCapturedView}"/>
  |     </event>   
  | </components>
  | 

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

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



More information about the jboss-user mailing list