[richfaces-planning-issues] [JBoss JIRA] (RFPL-2200) Port Photoalbum to JBoss 7.1

Ján Jamrich (JIRA) jira-events at lists.jboss.org
Wed May 2 08:10:18 EDT 2012


     [ https://issues.jboss.org/browse/RFPL-2200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ján Jamrich resolved RFPL-2200.
-------------------------------

        Labels: as7  (was: )
    Resolution: Done


Howto port photoalbum application to run on JBoss AS 7.1

Photoalbum is RichFaces 3.x application [1]
To port RichFaces 3.x application are necessary some steps since JBoss AS 7.x differs from AS 6.x on provided JSF implementation.
It is important since RichFaces 3.x are JSF 1.2 based.

For more basic informations and tips for port RichFaces 3.x applications see [2] [3] and [4] too.

1. missing javax.faces.FacesException (CLasssNotFoundException)
	First required step is add jboss-deployment-structure.xml into ${ear}/META-INF to led JBoss AS 7.1 use JSF 1.2 impl instead of 2
	Since photoalbum is delivered in EAR, there is small difference between jboss-deployment-structure.xml known from porting richfaces-demo.war
	First difference is place ${EAR}/META-INF instead of ${WAR}/WEB-INF and second is file content:
	<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
	  <deployment>
	      <dependencies>
		  <module name="javax.faces.api" slot="1.2" export="true"/>
		  <!--module name="com.sun.jsf-impl" slot="1.2" export="true"/-->
		  <module name="org.apache.commons.logging" export="true"/>
		  <module name="org.dom4j" export="true"/>
		</dependencies>
	  </deployment>
	  <sub-deployment name="photoalbum-web-3.3.4-SNAPSHOT.war">
	    <exclusions>
		  <module name="javax.faces.api" slot="main"/>
		  <module name="com.sun.jsf-impl" slot="main"/>
		</exclusions>
		<dependencies>
		  <module name="javax.faces.api" slot="1.2"/>
		  <module name="com.sun.jsf-impl" slot="1.2"/>
		</dependencies>
	  </sub-deployment>
	</jboss-deployment-structure>

2. Missing dependency:
	hibernate-validator.jar (4.1.0.Final)
	hibernate-core (3.3.2.GA)
	hibernate-entitymanager (3.4.0.GA)
	hibernate-common-annotations (3.3.0.GA)
	hibernate-annotations (3.4.0.GA)
        ejb3-persistence (1.0.2.GA)
 
3. Fix missing dependency for Google GWT servler
   and google gwt-servlet (1.5.2 from maven repo: com/google/gwt)

4. Fix missing dependency for antlr
	antlr.jar (2.7.7 from maven repo: antlrantlr/antlr )

4. Fix DS definition
	Since exampleDS is no longer valid on JBAS 7, have to define new DS or change reference in {EJB}.jar/META-INF/persistence.xml file to another one - existing.
	In my case, I wanted to prepare EAR to be able run on JBoss AS 7.1 without unnecessary changes to AS, so I changed DS JNDI name in persistence.xml to existing one: 
	<!--jta-data-source>java:/photoalbumDatasource</jta-data-source-->
      <jta-data-source>java:/jboss/datasources/ExampleDS</jta-data-source>
	According to preference, it is possible to create new datasource as described in Marek Novotny's article (see [4])

5. Not just add dependencies is requred in case of JBoss AS 7.1. Remove some dependencies are required as well:
	Remove jboss-seam-jul.jar from ${EAR}/${WAR} as need in richfaces-demo.war.
	This step is specific for JBoss AS 7.1 and higher.

6. fix paths to JNDI names:
	JNDI bindings in ${EAR}/${EJB}/component.properties (notice that there is difference in file name where are these settings stored in compare to Marek Novotny's article [4])

     - this is what is bound on AS on deploy: java:app/photoalbum-ejb-3.3.4-SNAPSHOT/UserAction
     - and this is what is requested from app: "photoalbum-ear-3.3.4-SNAPSHOT".UserAction" because of 
     - this is in components.properties: java:/photoalbum-ear-3.3.4-SNAPSHOT/#{ejbName}

   So, replace jndiPattern=java:/photoalbum-ear-3.3.4-SNAPSHOT/#{ejbName} by:
   jndiPattern=java:app/photoalbum-ejb-3.3.4-SNAPSHOT/#{ejbName}

	Notice that there is not just change in prefix from "java:/photoalbum" to "java:app/photoalbum", that in object name as well:
	From "photoalbum-ear" to "photoalbum-ejb"
----------------------------------------------------


[1] http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/examples/photoalbum/
[2] https://docs.jboss.org/author/display/AS71/Seam+2+Booking+EAR+Migration+of+Binaries+-+Step+by+Step
[3] https://issues.jboss.org/browse/RFPL-1493
[4] https://community.jboss.org/blogs/marek-novotny/2011/07/15/seam-2-jpa-example-on-jboss-as7
                
> Port Photoalbum to JBoss 7.1
> ----------------------------
>
>                 Key: RFPL-2200
>                 URL: https://issues.jboss.org/browse/RFPL-2200
>             Project: RichFaces Planning
>          Issue Type: Task
>      Security Level: Public(Everyone can see) 
>          Components: examples
>            Reporter: Pavol Pitonak
>            Assignee: Ján Jamrich
>              Labels: as7
>
> Port RichFaces sample application Photoalbum [1] to JBoss AS 7.1.1.Final. Have a look on [2] for more information about how to port application from AS5 to AS7.
> [1] http://anonsvn.jboss.org/repos/richfaces/branches/community/3.3.X/examples/photoalbum/
> [2] https://docs.jboss.org/author/display/AS71/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the richfaces-planning-issues mailing list