In this tutorial, we'll assume that you are using JBoss AS 4.2 with Seam, as in the case of JBoss Enterprise Application Platform.
The directory structure of each example in Seam follows this pattern:
-
Web pages, images and stylesheets may be found in examples/
registration
/view
-
Resources such as deployment descriptors and data import scripts may be found in examples/
registration
/resources
-
Java source code may be found in examples/
registration
/src
-
The Ant build script is examples/
registration
/build.xml
2.1.1. Running the examples on JBoss AS
First, make sure you have Ant correctly installed, with $ANT_HOME
and $JAVA_HOME
set correctly. Next, make sure you set the location of your JBoss AS installation in the build.properties
file in the root folder of your Seam installation. If you haven't already done so, start JBoss AS now by typing bin/run.sh
or bin/run.bat
in the root directory of your JBoss installation.
By default the examples will deploy to the default configuration of the server. These examples should be deployed to the production configuration if they are to be used with JBoss Enterprise Application Platform 4.2, and the example build.xml
file should be modified to reflect this before building and deploying. Two lines should be changed in this file:
<property name="deploy.dir" value="${jboss.home}/server/production/deploy"/>
<property name="webroot.dir"
value="${deploy.dir}/jboss-web.deployer/ROOT.war"/>
Now, build and deploy the example by typing ant deploy
in the examples/
registration
directory.
2.1.2. Running the examples on Tomcat
First, make sure you have Ant correctly installed, with $ANT_HOME
and $JAVA_HOME
set correctly. Next, make sure you set the location of your Tomcat installation in the build.properties
file in the root folder of your Seam installation.
Now, build and deploy the example by typing ant deploy.tomcat
in the examples/
registration
directory.
Finally, start Tomcat.
When you deploy the example to Tomcat, any EJB3 components will run inside the JBoss Embeddable EJB3 container, a complete standalone EJB3 container environment.
2.1.3. Running the example tests
Most of the examples come with a suite of TestNG integration tests. The easiest way to run the tests is to run ant testexample
inside the examples/
registration
directory. It is also possible to run the tests inside your IDE using the TestNG plugin.