Chapter 4. Migration from 2.2 to 2.3
This migration guide assumes that you are migrating from Seam 2.2 to Seam 2.3. If you are migrating from Seam 1.2 or 2.0, see the
jboss-seam-x.y.z.Final/seam2migration.txt and jboss-seam-x.y.z.Final/seam21migration.txt guides also.
Important
Seam 2.3 has been re-architected to support features of Java EE6 on Red Hat JBoss Enterprise Application Platform 6. jBPM3 is deemed unsuitable for EE6 and JBoss Enterprise Application Platform 6. Features depending on jBPM3 (pageflows and business processes) are removed from Seam 2.3.
4.1. Migration of XML Schemas
4.1.1. Seam schema migration
Update the XML schemas for validation files that use Seam 2.2 XSDs to refer to 2.3 XSDs; notice the version change. The current namespace pattern is
www.jboss.org/schema/seam/* and the schemaLocation URL is www.jboss.org/schema/seam/*_-2.3.xsd, where * is a Seam module.
Warning
The old XML namespace
http://jboss.com/products/seam/* is invalid now. You must update the components.xml file with the new namespace.
The following snippet is an example of component declaration for Seam 2.2:
Example 4.1. Before migration of Seam 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:persistence="http://jboss.com/products/seam/persistence" xmlns:security="http://jboss.com/products/seam/security" xmlns:theme="http://jboss.com/products/seam/theme" xmlns:cache="http://jboss.com/products/seam/cache" 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/security http://jboss.com/products/seam/security-2.2.xsd http://jboss.com/products/seam/theme http://jboss.com/products/seam/theme-2.2.xsd http://jboss.com/products/seam/cache http://jboss.com/products/seam/cache-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">
Migrated declaration of
components.xml for version 2.3:
Example 4.2. Migrated components.xml
<?xml version="1.0" encoding="UTF-8"?> <components xmlns="http://jboss.org/schema/seam/components" xmlns:core="http://jboss.org/schema/seam/core" xmlns:persistence="http://jboss.org/schema/seam/persistence" xmlns:security="http://jboss.org/schema/seam/security" xmlns:theme="http://jboss.org/schema/seam/theme" xmlns:cache="http://jboss.org/schema/seam/cache" xmlns:web="http://jboss.org/schema/seam/web" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/schema/seam/core http://jboss.org/schema/seam/core-2.3.xsd http://jboss.org/schema/seam/persistence http://jboss.org/schema/seam/persistence-2.3.xsd http://jboss.org/schema/seam/security http://jboss.org/schema/seam/security-2.3.xsd http://jboss.org/schema/seam/theme http://jboss.org/schema/seam/theme-2.3.xsd http://jboss.org/schema/seam/cache http://jboss.org/schema/seam/cache-2.3.xsd http://jboss.org/schema/seam/web http://jboss.org/schema/seam/web-2.3.xsd http://jboss.org/schema/seam/components http://jboss.org/schema/seam/components-2.3.xsd">
Update
pages.xml files and schemas.
Example 4.3. Before migration of Seam pages.xml
<?xml version="1.0" encoding="UTF-8"?> <pages xmlns="http://jboss.com/products/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.2.xsd"> ... </pages>
Example 4.4. After migration of Seam pages.xml
<?xml version="1.0" encoding="UTF-8"?> <pages xmlns="http://jboss.org/schema/seam/pages" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/schema/seam/pages http://jboss.org/schema/seam/pages-2.3.xsd"> ... </pages>
4.1.2. Java EE 6 schema changes
Seam 2.3 technology upgrade includes an update to Java EE 6. Update the following descriptors:
persistence.xmlfor using JPA 2.web.xmlfor using Servlet 3.0 and Web application.application.xmlfor using Enterprise Java 6 application.faces-config.xmlto specify advanced configuration for JSF 2 (this descriptor file is optional).
Following are examples of changed headers with correct versions:
Example 4.5. persistence.xml
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"version="2.0">
Example 4.6. application.xml
<application 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/application_6.xsd" version="6">
Example 4.7. web.xml
<web-app 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_3_0.xsd" version="3.0">
Example 4.8. faces-config.xml
<?xml version="1.0" encoding="UTF-8"?> <faces-config version="2.1" 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_2_1.xsd">