Author: pete.muir(a)jboss.org
Date: 2008-10-06 14:08:39 -0400 (Mon, 06 Oct 2008)
New Revision: 9210
Modified:
trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
Log:
And fix the formating
Modified: trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml
===================================================================
--- trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-10-06 17:12:04 UTC (rev 9209)
+++ trunk/doc/Seam_Reference_Guide/en-US/Glassfish.xml 2008-10-06 18:08:39 UTC (rev 9210)
@@ -35,8 +35,7 @@
<para>
<ulink
url="https://glassfish.dev.java.net/downloads/v2ur2-b04.html">
- Glassfish v2 UR2 - download page
- </ulink>
+ Glassfish v2 UR2 - download page</ulink>
</para>
</listitem>
</itemizedlist>
@@ -45,28 +44,36 @@
<para>
After downloading suitable jar file with Glassfish, install it by
writing on command line in case of linux version:
- <programlisting>
- java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar
- </programlisting>
</para>
+
+ <programlisting>$ java -Xmx256m -jar
glassfish-installer-v2ur2-b04-linux.jar</programlisting>
<para>
After installing, setup glassfish, the following command creates
Glassfish server domain:
- <programlisting>cd glassfish; ant -f setup.xml</programlisting>
+ </para>
+
+ <programlisting>$ cd glassfish; ant -f setup.xml</programlisting>
+
+ <para>
The created domain name is domain1.
</para>
<para>
Start the embedded JavaDB server:
- <programlisting>bin/asadmin start-database</programlisting>
+ </para>
+
+ <programlisting>$ bin/asadmin start-database</programlisting>
+
+ <para>
This is default embedded database server in Glassfish.
</para>
<para>
Start the Glassfish server domain1:
- <programlisting>bin/asadmin start-domain
domain1</programlisting>
</para>
+
+ <programlisting>$ bin/asadmin start-domain domain1</programlisting>
<para>
The deployment and configuration is available at the Web
@@ -80,28 +87,20 @@
<para>
Stopping the server and database can be done by the following
command:
- <programlisting>
- bin/asadmin stop-domain domain1; bin/asadmin stop-database
- </programlisting>
</para>
+
+ <programlisting>$ bin/asadmin stop-domain domain1; bin/asadmin
stop-database</programlisting>
</section>
</section>
<section id="jee5-glassfish-section">
- <title>
- The
- <literal>jee5/booking</literal>
- example
- </title>
+ <title>The <literal>jee5/booking</literal> example</title>
<para>
- The
- <literal>jee5/booking</literal>
- example is based on the Hotel Booking example (which runs on JBoss AS).
- Out of the box it is also designed to run on Glassfish. It is located
- in the
- <literal>$SEAM_DIST/examples/jee5/booking</literal>
- directory.
+ The <literal>jee5/booking</literal> example is based on the Hotel
+ Booking example (which runs on JBoss AS). Out of the box it is also
+ designed to run on Glassfish. It is located in the
+ <literal>$SEAM_DIST/examples/jee5/booking</literal> directory.
</para>
<section id="jee5-glassfish-deploy">
@@ -111,84 +110,60 @@
We will deploy the application on Glassfish with using of
Glassfish's administration console.
</para>
-
- <para>
- The steps below are for the Glassfish version stated above.
- <orderedlist>
- <listitem>
- <para>
- Log in to the administration console
- <programlisting>http://localhost:4848</programlisting>
- </para>
- </listitem>
-
- <listitem>
- <para>
- Access the
- <literal>Enterprise Applications</literal>
- in the menu option under the
- <literal>Applications</literal>
- left side menu.
- </para>
- </listitem>
-
- <listitem>
- <para>
- At the top of the
- <literal>Enterprise Application</literal>
- table select
- <literal>Deploy</literal>
- . Below are installation wizard pages and what needs to
- done on each:
+
+ <orderedlist>
+ <listitem>
+ <para>
+ Log in to the administration console:
+ </para>
+ <programlisting>http://localhost:4848</programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Access the <literal>Enterprise Applications</literal> in
the
+ menu option under the <literal>Applications</literal> left
+ side menu.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ At the top of the <literal>Enterprise
Application</literal>
+ table select <literal>Deploy</literal>. Below are
installation
+ wizard pages and what needs to done on each:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>Preparing for the application
installation</literal>
+ </para>
<itemizedlist>
<listitem>
<para>
- <literal>
- Preparing for the application installation
- </literal>
- <itemizedlist>
- <listitem>
- <para>
- Browse to the
- <literal>
- examples/jee5/booking/dist/jboss-seam-jee5.ear
- </literal>
- file using the file upload widget.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Select the
- <literal>OK</literal>
- button.
- </para>
- </listitem>
- </itemizedlist>
+ Browse to the
<literal>examples/jee5/booking/dist/jboss-seam-jee5.ear</literal>
+ file using the file upload widget.
</para>
</listitem>
+ <listitem>
+ <para>
+ Select the <literal>OK</literal> button.
+ </para>
+ </listitem>
</itemizedlist>
- </para>
- </listitem>
-
- <listitem>
- <para>
- You can now access the application at
- <literal>http://localhost:8081/seam-jee5/</literal>
- .
- </para>
- </listitem>
- </orderedlist>
- </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ You can now access the application at
+ <literal>http://localhost:8081/seam-jee5/</literal>.
+ </para>
+ </listitem>
+ </orderedlist>
</section>
</section>
<section id="jpa-glassfish-section">
- <title>
- The
- <literal>jpa</literal>
- booking example
- </title>
+ <title>The <literal>jpa</literal> booking example</title>
<para>
This is the Hotel Booking example implemented in Seam POJOs and using
@@ -206,91 +181,69 @@
</para>
<section>
- <title>
- Building the
- <literal>jpa</literal>
- example
- </title>
+ <title>Building the <literal>jpa</literal>
example</title>
<para>
Building it only requires running the correct ant command:
- <programlisting>ant glassfish</programlisting>
+ </para>
+
+ <programlisting>$ ant glassfish</programlisting>
+
+ <para>
This will create container specific distribution and exploded
- archive directories with the
- <literal>glassfish</literal>
- suffix.
+ archive directories with the <literal>glassfish</literal>
suffix.
</para>
</section>
<section>
- <title>
- Deploying the
- <literal>jpa</literal>
- example
- </title>
+ <title>Deploying the <literal>jpa</literal>
example</title>
<para>
- This is very similar to the
- <literal>jee5</literal>
- example at
- <xref linkend="jee5-glassfish-deploy" />
- .
+ This is very similar to the <literal>jee5</literal> example at
+ <xref linkend="jee5-glassfish-deploy" />.
</para>
<itemizedlist>
<listitem>
<para>
- Log in to the administration console
- <programlisting>http://localhost:4848</programlisting>
+ Log in to the administration console:
</para>
+ <programlisting>http://localhost:4848</programlisting>
</listitem>
-
<listitem>
<para>
- Access the
- <literal>Web Applications</literal>
- in the menu option under the
- <literal>Applications</literal>
- left side menu.
- <itemizedlist>
- <listitem>
- <para>
- <literal>
- Preparing for the application installation
- </literal>
- <itemizedlist>
- <listitem>
- <para>
- Browse to the
- <literal>
- examples/jpa/dist-glassfish/jboss-seam-jpa.war
- </literal>
- file using the file upload widget.
- </para>
- </listitem>
-
- <listitem>
- <para>
- Select the
- <literal>OK</literal>
- button.
- </para>
- </listitem>
- </itemizedlist>
- </para>
- </listitem>
-
- <listitem>
- <para>
- You can now access the application at
- <literal>
-
http://localhost:8081/jboss-seam-jpa/
- </literal>
- .
- </para>
- </listitem>
- </itemizedlist>
+ Access the <literal>Web Applications</literal> in the menu
+ option under the <literal>Applications</literal> left side
+ menu.
</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>
+ Preparing for the application installation
+ </literal>
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Browse to the
<literal>examples/jpa/dist-glassfish/jboss-seam-jpa.war</literal>
+ file using the file upload widget.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Select the <literal>OK</literal> button.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ <para>
+ You can now access the application at
+
<literal>http://localhost:8081/jboss-seam-jpa/</literal>.
+ </para>
+ </listitem>
+ </itemizedlist>
</listitem>
</itemizedlist>
@@ -300,8 +253,8 @@
In order for the app to work out of the box with Glassfish, we have
used the Derby (i.e., Java DB) database in Glassfish. However, we
strongly recommend you to use a non-Derby data source (e.g., HSQL is
- a much better embeded DB) if possible. The
- examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class
+ a much better embeded DB) if possible. The
+
<literal>examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class</literal>
is a special hack to get around a Derby bug in Glassfish server. You
must use it as your Hibernate dialect if you use Derby with
Glassfish.
@@ -321,84 +274,61 @@
<listitem>
<para>
Configuration file changes
- <itemizedlist>
- <listitem>
- <para>
- <literal>META-INF/persistence.xml</literal>
- — the main changes here are for the datasource JNDI
- path, switching to the Glassfish transaction manager
- look up class, and changing the hibernate dialect to
- be
- <literal>GlassfishDerbyDialect</literal>
- .
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>
- WEB-INF/classes/GlassfishDerbyDialect.class
- </literal>
- — this class is needed for the hibernate dialect
- change to
- <literal>GlassfishDerbyDialect</literal>
- </para>
- </listitem>
-
- <listitem>
- <para>
- <literal>import.sql</literal>
- — either for the dialect or Derby DB the
- <literal>ID</literal>
- column can not be populated by this file and was
- removed.
- </para>
- </listitem>
- </itemizedlist>
</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>META-INF/persistence.xml</literal> — the
main
+ changes here are for the datasource JNDI path, switching
+ to the Glassfish transaction manager look up class, and
+ changing the hibernate dialect to be
+ <literal>GlassfishDerbyDialect</literal>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+
<literal>WEB-INF/classes/GlassfishDerbyDialect.class</literal>
+ — this class is needed for the Hibernate dialect change
+ to <literal>GlassfishDerbyDialect</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>import.sql</literal> — either for the
dialect
+ or Derby DB the <literal>ID</literal> column can not
be
+ populated by this file and was removed.
+ </para>
+ </listitem>
+ </itemizedlist>
</listitem>
</itemizedlist>
</section>
</section>
<section>
- <title>
- Deploying an application generated by
- <literal>seam-gen</literal>
- on Glassfish v2 UR2
- </title>
+ <title>Deploying an application generated by
<literal>seam-gen</literal> on Glassfish v2 UR2</title>
<para>
- <literal>seam-gen</literal>
- is a very useful tool for developers to quickly get an application up
- and running, and provides a foundation to add your own functionality.
- Out of box
- <literal>seam-gen</literal>
- will produce applications configured to run on JBoss AS. These
- instructions will show the steps needed to get it to run on Glassfish.
- As stated above in
- <xref linkend="jee5-glassfish-section" />
- there is easy to deploy on glassfish either EJB3 or Seam POJOs based
- application
+ <literal>seam-gen</literal> is a very useful tool for developers to
+ quickly get an application up and running, and provides a foundation to
+ add your own functionality. Out of box <literal>seam-gen</literal>
will
+ produce applications configured to run on JBoss AS. These instructions
+ will show the steps needed to get it to run on Glassfish. As stated
+ above in <xref linkend="jee5-glassfish-section" /> there is easy
to
+ deploy on glassfish either EJB3 or Seam POJOs based application.
</para>
<section>
- <title>
- Running
- <literal>seam-gen</literal>
- Setup
- </title>
+ <title>Running <literal>seam-gen</literal>
Setup</title>
<para>
- The first step is setting up
- <literal>seam-gen</literal>
- to construct the base project. There are several choices made below,
+ The first step is setting up <literal>seam-gen</literal> to
+ construct the base project. There are several choices made below,
specifically the datasource and hibernate values that we will adjust
once the project is created.
</para>
- <programlisting>
- ./seam setup Buildfile: build.xml
+ <programlisting>$ ./seam setup Buildfile: build.xml
init:
@@ -475,18 +405,18 @@
</programlisting>
<para>
- Type
- <literal>./seam new-project</literal>
- to create your project and
- <literal>cd /home/mnovotny/projects/seamgen_example</literal>
- to the newly created structure.
+ Type <literal>$ ./seam new-project</literal> to create your
project
+ and <literal>cd /home/mnovotny/projects/seamgen_example</literal>
to
+ the newly created structure.
</para>
</section>
<section>
<title>Changes needed for deployment to Glassfish</title>
- <para>We now need to make some changes to the generated
project.</para>
+ <para>
+ We now need to make some changes to the generated project.
+ </para>
<section>
<title>Configuration file changes</title>
@@ -501,92 +431,68 @@
<itemizedlist>
<listitem>
<para>
- Alter the
- <literal>jta-data-source</literal>
- to be
- <literal>jdbc/__default</literal>
- . We are going to be using the integrated
- Glassfish Derby DB.
+ Alter the <literal>jta-data-source</literal> to
be
+ <literal>jdbc/__default</literal>. We are going
to
+ be using the integrated Glassfish Derby DB.
</para>
</listitem>
-
<listitem>
<para>
Add or change the properties below. These are
- described in detail at
- <xref linkend="jee5-glassfish-section" />
- :
+ described in detail at
+ <xref linkend="jee5-glassfish-section" />:
</para>
-
- <programlisting role="XML">
- <property name="hibernate.dialect"
- value="GlassfishDerbyDialect"/>
<property
- name="hibernate.hbm2ddl.auto"
value="update"/>
- <property name="hibernate.show_sql"
- value="true"/> <property
- name="hibernate.format_sql"
value="true"/>
- <property
name="hibernate.cache.provider_class"
-
value="org.hibernate.cache.HashtableCacheProvider"/>
- <property
-
name="hibernate.transaction.manager_lookup_class"
-
value="org.hibernate.transaction.SunONETransactionManagerLookup"/>
- </programlisting>
+ <programlisting
role="XML"><![CDATA[<property name="hibernate.dialect"
value="GlassfishDerbyDialect"/>
+<property name="hibernate.hbm2ddl.auto" value="update"/>
+<property name="hibernate.show_sql" value="true"/>
+<property name="hibernate.format_sql" value="true"/>
+<property name="hibernate.cache.provider_class"
value="org.hibernate.cache.HashtableCacheProvider"/>
+<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.SunONETransactionManagerLookup"/>]]></programlisting>
</listitem>
-
<listitem>
<para>
- You'll need to alter
- <literal>persistence-prod.xml</literal>
- as well if you want to deploy to Glassfish using
- the prod profile.
+ You'll need to alter
+ <literal>persistence-prod.xml</literal> as well
if
+ you want to deploy to Glassfish using the prod
+ profile.
</para>
</listitem>
</itemizedlist>
</listitem>
</varlistentry>
-
<varlistentry>
<term>
<literal>resources/GlassfishDerbyDialect.class</literal>
</term>
-
<listitem>
<para>
As with other examples we need to include this class for
- DB support. It can be copied from the
- <literal>jpa</literal>
- example into the
- <literal>seamgen_example/resources</literal>
- directory.
- <programlisting>
- cp
-
$SEAM_DIST/examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class
- ./resources
- </programlisting>
+ DB support. It can be copied from the
+ <literal>jpa</literal> example into the
+ <literal>seamgen_example/resources</literal>
directory.
</para>
+ <programlisting>$ cp \
+$SEAM_DIST/examples/jpa/resources-glassfish/WEB-INF/classes/GlassfishDerbyDialect.class \
+./resources
+ </programlisting>
</listitem>
</varlistentry>
-
<varlistentry>
<term>
<literal>resources/META-INF/jboss-app.xml</literal>
</term>
-
<listitem>
<para>
You can delete this file as we aren't deploying to JBoss
- AS (
- <literal>jboss-app.xml</literal>
- is used to enable classloading isolation in JBoss AS)
+ AS (<literal>jboss-app.xml</literal> is used to
enable
+ classloading isolation in JBoss AS)
</para>
</listitem>
</varlistentry>
-
<varlistentry>
<term>
<literal>resources/*-ds.xml</literal>
</term>
-
<listitem>
<para>
You can delete these file as we aren't deploying to
@@ -595,39 +501,26 @@
</para>
</listitem>
</varlistentry>
-
<varlistentry>
<term>
<literal>resources/WEB-INF/components.xml</literal>
</term>
-
<listitem>
<itemizedlist>
<listitem>
<para>
Enable container managed transaction integration -
- add the
- <literal>
- <transaction:ejb-transaction />
- </literal>
- component, and it's namespace declaration
- <literal>
-
xmlns:transaction="http://jboss.com/products/seam/transaction"
- </literal>
+ add the
<literal><![CDATA[<transaction:ejb-transaction />]]></literal>
+ component, and it's namespace declaration
+
<
literal>xmlns:transaction="http://jboss.com/products/seam/transac...
</para>
</listitem>
-
<listitem>
<para>
- Alter the
- <literal>jndi-pattern</literal>
- to
- <literal>
- java:comp/env/seamgen_example/#{ejbName}/local
- </literal>
+ Alter the <literal>jndi-pattern</literal> to
+
<literal>java:comp/env/seamgen_example/#{ejbName}/local</literal>
</para>
</listitem>
-
</itemizedlist>
</listitem>
</varlistentry>
@@ -637,18 +530,13 @@
</term>
<listitem>
<para>
- As with the
- <literal>jee5/booking</literal>
- example we need to add EJB references to the web.xml.
- These references require the empty
- <literal>local-home</literal>
- to flag them for Glassfish to perform the proper
- binding.
+ As with the <literal>jee5/booking</literal> example
we
+ need to add EJB references to the web.xml. These
+ references require the empty
+ <literal>local-home</literal> to flag them for
Glassfish
+ to perform the proper binding.
</para>
-
-
- <programlisting role="XML"><![CDATA[
- <ejb-local-ref>
+ <programlisting
role="XML"><![CDATA[<ejb-local-ref>
<ejb-ref-name>seamgen_example/AuthenticatorAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home></local-home>
@@ -667,15 +555,10 @@
</section>
<section>
- <title>
- Creating the
- <literal>AuthenticatorAction</literal>
- EJB
- </title>
+ <title>Creating the <literal>AuthenticatorAction</literal>
EJB</title>
<para>
- We want to take the existing
- <literal>Authenticator</literal>
+ We want to take the existing <literal>Authenticator</literal>
Seam POJO component and create an EJB3 out of it.
</para>
@@ -684,54 +567,46 @@
<itemizedlist>
<listitem>
<para>
- Rename the class to
+ Rename the class to
<literal>AuthenticatorAction</literal>
</para>
</listitem>
<listitem>
<para>
- Add the
- <literal>@Stateless</literal>
- annotation to the new
- <literal>AuthenticatorAction</literal>
- class.
+ Add the <literal>@Stateless</literal> annotation
to
+ the new <literal>AuthenticatorAction</literal>
class.
</para>
</listitem>
<listitem>
<para>
- Create an interface called
- <literal>Authenticator</literal>
- which
+ Create an interface called
+ <literal>Authenticator</literal> which
<literal>AuthenticatorAction</literal>
implements (EJB3 requires session beans to have a
local interface). Annotate the interface with
- <literal>@Local</literal>
- , and add a single method with same signature as the
- <literal>authenticate</literal>
- in
- <literal>AuthenticatorAction</literal>
- .
+ <literal>@Local</literal>, and add a single method
+ with same signature as the
<literal>authenticate</literal>
+ in <literal>AuthenticatorAction</literal>.
</para>
</listitem>
</itemizedlist>
- <programlisting role="JAVA">
- @Name("authenticator") @Stateless public class
- AuthenticatorAction implements Authenticator {
- </programlisting>
+ <programlisting
role="JAVA"><![CDATA[@Name("authenticator")
+@Stateless
+public class AuthenticatorAction implements Authenticator {]]></programlisting>
- <programlisting role="JAVA">
- @Local public interface Authenticator { public boolean
- authenticate(); }
- </programlisting>
+ <programlisting role="JAVA"><![CDATA[@Local
+public interface Authenticator {
+
+ public boolean authenticate();
+}]]></programlisting>
</listitem>
<listitem>
<para>
- We've already added its reference to the
- <literal>web.xml</literal>
+ We've already added its reference to the
<literal>web.xml</literal>
file so are good to go.
</para>
</listitem>
@@ -740,280 +615,240 @@
<section>
<title>
- Extra jar dependencies and other changes to the
+ Extra jar dependencies and other changes to the
<literal>build.xml</literal>
</title>
<para>
This application has similar requirements as the
- <literal>jee5/booking</literal>
- example.
+ <literal>jee5/booking</literal> example.
</para>
<itemizedlist>
<listitem>
<para>
- Change the default target to
- <literal>archive</literal>
- (we aren't going to cover automatic deployment to
- Websphere).
+ Change the default target to <literal>archive</literal>
(we
+ aren't going to cover automatic deployment to Glassfish).
</para>
- <programlisting role="XML">
- <project name="seamgen_example"
default="archive"
- basedir=".">
- </programlisting>
+ <programlisting role="XML"><![CDATA[<project
name="seamgen_example" default="archive"
basedir=".">]]></programlisting>
</listitem>
<listitem>
<para>
- Websphere looks for the drools
- <literal>/security.drl</literal>
- file in the root of the
- <literal>war</literal>
- file instead of the root of the
- <literal>seamgen_example.jar</literal>
- so we need to have the
- <literal>build.xml</literal>
- move it to the correct location at build time. The
- following must be added at the top of the
- <literal>
- <target name="war" depends="compile"
- description="Build the distribution .war file">
- </literal>
+ Websphere looks for the drools
<literal>/security.drl</literal>
+ file in the root of the <literal>war</literal> file
instead of the root of the
+ <literal>seamgen_example.jar</literal> so we need to
have
+ the <literal>build.xml</literal> move it to the correct
+ location at build time. The following must be added at the
+ top of the <literal><![CDATA[<target
name="war" depends="compile" description="Build the distribution
.war file">]]></literal>
target.
</para>
- <programlisting role="XML">
- <copy todir="${war.dir}"> <fileset
- dir="${basedir}/resources" > <include
name="*.drl"
- /> </fileset> </copy>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<copy
todir="${war.dir}">
+ <fileset dir="${basedir}/resources">
+ <include name="*.drl" />
+ </fileset>
+</copy>]]></programlisting>
</listitem>
<listitem>
<para>
- We need to get the
- <literal>GlassfishDerbyDialect.class</literal>
- into our application jar. To do that find the
- <literal>jar</literal>
+ We need to get the
<literal>GlassfishDerbyDialect.class</literal>
+ into our application jar. To do that find the
<literal>jar</literal>
task and modify the top of it so that it looks like this:
</para>
- <programlisting role="XML">
- <target name="jar"
depends="compile,copyclasses"
- description="Build the distribution .jar file">
<copy
- todir="${jar.dir}"> <fileset
- dir="${basedir}/resources"> <include
- name="seam.properties" /> <include
name="*.drl" />
- <include name="GlassfishDerbyDialect.class"
/>
- </fileset> </copy> ...
- </programlisting>
+ <programlisting role="XML"><![CDATA[<target
name="jar" depends="compile,copyclasses" description="Build the
distribution .jar file">
+ <copy todir="${jar.dir}">
+ <fileset dir="${basedir}/resources">
+ <include name="seam.properties" />
+ <include name="*.drl" />
+ <include name="GlassfishDerbyDialect.class" />
+ </fileset>
+ </copy>
+ ...]]></programlisting>
</listitem>
<listitem>
<para>
- Next we need to get the
- <literal>jboss-seam.jar</literal>
- into the base of the
- <literal>EAR</literal>
- file. For deployment Glassfish requires this jar to be in
- both the
- <literal>/lib</literal>
- directory and at the base of the
- <literal>EAR</literal>
- . You must add the following to the
- <literal>archive</literal>
- task:
+ Next we need to get the
<literal>jboss-seam.jar</literal>
+ into the base of the <literal>EAR</literal> file. For
+ deployment Glassfish requires this jar to be in both the
+ <literal>/lib</literal> directory and at the base of
the
+ <literal>EAR</literal>. You must add the following to
the
+ <literal>archive</literal> task:
</para>
- <programlisting role="XML">
- <fileset dir="${lib.dir}"> <include
- name="jboss-seam.jar" /> </fileset>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<fileset
dir="${lib.dir}">
+ <include name="jboss-seam.jar" >
+</fileset>]]></programlisting>
<para>
- So that the whole
- <literal>archive</literal>
- task looks like:
+ So that the whole <literal>archive</literal> task looks
+ like:
</para>
- <programlisting role="XML">
- <target name="archive"
depends="jar,war,ear"
- description="Package the archives"> <jar
- jarfile="${dist.dir}/${project.name}.jar"
- basedir="${jar.dir}"/> <jar
- jarfile="${dist.dir}/${project.name}.war"
- basedir="${war.dir}"/> <jar
- jarfile="${dist.dir}/${project.name}.ear">
<fileset
- dir="${ear.dir}"/> <fileset
dir="${dist.dir}">
- <include name="${project.name}.jar"/>
<include
- name="${project.name}.war"/>
</fileset>
- <fileset dir="${lib.dir}"> <include
- name="jboss-seam.jar" /> </fileset>
</jar>
- </target>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<target
name="archive" depends="jar,war,ear" description="Package the
archives">
+ <jar jarfile="${dist.dir}/${project.name}.jar"
basedir="${jar.dir}"/>
+ <jar jarfile="${dist.dir}/${project.name}.war"
basedir="${war.dir}"/>
+ <jar jarfile="${dist.dir}/${project.name}.ear">
+ <fileset dir="${ear.dir}"/>
+ <fileset dir="${dist.dir}">
+ <include name="${project.name}.jar"/>
+ <include name="${project.name}.war"/>
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="jboss-seam.jar" />
+ </fileset>
+ </jar>
+</target>]]></programlisting>
</listitem>
<listitem>
<para>
- Now we need to get extra jars into the
- <literal>build.xml</literal>
- . Look for the
- <literal><fileset
dir="${basedir}"></literal>
+ Now we need to get extra jars into the
<literal>build.xml</literal>.
+ Look for the <literal><![CDATA[<fileset
dir="${basedir}">]]></literal>
section of the task below. Add the new includes at the
bottom of the fileset.
</para>
- <programlisting role="XML">
- <target name="ear" description="Build the
EAR">
- <copy todir="${ear.dir}"> <fileset
- dir="${basedir}/resources"> <include
name="*jpdl.xml"
- /> <include name="*hibernate.cfg.xml"
/>
- <include name="jbpm.cfg.xml" />
</fileset>
- <fileset dir="${lib.dir}"> <include
- name="jboss-seam.jar" /> </fileset>
<fileset
- dir="${basedir}"> <include
name="lib/jbpm*.jar" />
- <include name="lib/jboss-el.jar" />
<include
- name="lib/drools-*.jar"/> <include
- name="lib/core.jar"/> <include
- name="lib/janino*.jar"/> <include
- name="lib/antlr-*.jar"/> <include
- name="lib/mvel*.jar"/> <include
- name="lib/richfaces-api*.jar" />
</fileset>
- </copy> <copy
todir="${ear.dir}/META-INF">
- <fileset
dir="${basedir}/resources/META-INF">
- <include name="application.xml" />
<include
- name="jboss-app.xml" /> </fileset>
</copy>
- </target>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<target
name="ear" description="Build the EAR">
+ <copy todir="${ear.dir}">
+ <fileset dir="${basedir}/resources">
+ <include name="*jpdl.xml" />
+ <include name="*hibernate.cfg.xml" />
+ <include name="jbpm.cfg.xml" />
+ </fileset>
+ <fileset dir="${lib.dir}">
+ <include name="jboss-seam.jar" />
+ </fileset>
+ <fileset dir="${basedir}">
+ <include name="lib/jbpm*.jar" />
+ <include name="lib/jboss-el.jar" />
+ <include name="lib/drools-*.jar"/>
+ <include name="lib/core.jar"/>
+ <include name="lib/janino*.jar"/>
+ <include name="lib/antlr-*.jar"/>
+ <include name="lib/mvel*.jar"/>
+ <include name="lib/richfaces-api*.jar" />
+ </fileset>
+ </copy>
+ <copy todir="${ear.dir}/META-INF">
+ <fileset dir="${basedir}/resources/META-INF">
+ <include name="application.xml" />
+ <include name="jboss-app.xml" />
+ </fileset>
+ </copy>
+</target>]]></programlisting>
<itemizedlist>
<listitem>
<para>Add Hibernate dependencies</para>
- <programlisting role="XML">
- <!-- Hibernate and deps --> <include
- name="lib/hibernate.jar"/> <include
-
name="lib/hibernate-commons-annotations.jar"/>
- <include
name="lib/hibernate-annotations.jar"/>
- <include
- name="lib/hibernate-entitymanager.jar"/>
- <include
name="lib/hibernate-validator.jar"/>
- <include name="lib/jboss-common-core.jar"
/>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<!--
Hibernate and deps -->
+<include name="lib/hibernate.jar"/>
+<include name="lib/hibernate-commons-annotations.jar"/>
+<include name="lib/hibernate-annotations.jar"/>
+<include name="lib/hibernate-entitymanager.jar"/>
+<include name="lib/hibernate-validator.jar"/>
+<include name="lib/jboss-common-core.jar"/>]]></programlisting>
</listitem>
<listitem>
<para>
Add JSF dependencies. You will need to copy the
- <literal>el-ri.jar</literal>
- from the
- <literal>$SEAM_DIST/lib</literal>
- directory.
+ <literal>el-ri.jar</literal> from the
+ <literal>$SEAM_DIST/lib</literal> directory.
</para>
- <programlisting role="XML">
- <!-- jsf libs --> <include
- name="lib/jsf-api.jar" /> <include
- name="lib/jsf-impl.jar" /> <include
- name="lib/el-api.jar" /> <include
- name="lib/el-ri.jar"/>
- </programlisting>
+ <programlisting role="XML"><![CDATA[<!--
jsf libs -->
+<include name="lib/jsf-api.jar" />
+<include name="lib/jsf-impl.jar" />
+<include name="lib/el-api.jar" />
+<include name="lib/el-ri.jar"/>]]></programlisting>
</listitem>
<listitem>
<para>Add third party dependencies.</para>
- <programlisting role="XML">
- <!-- 3rd party and supporting jars -->
- <include name="lib/javassist.jar"/>
<include
- name="lib/dom4j.jar" /> <include
- name="lib/concurrent.jar" /> <include
- name="lib/cglib.jar"/> <include
- name="lib/asm.jar"/> <include
- name="lib/antlr.jar" /> <include
- name="lib/commons-logging.jar" />
<include
- name="lib/commons-collections.jar" />
- </programlisting>
+ <programlisting role="XML"><![CDATA[<!--
3rd party and supporting jars -->
+<include name="lib/javassist.jar"/>
+<include name="lib/dom4j.jar"/>
+<include name="lib/concurrent.jar" />
+<include name="lib/cglib.jar"/>
+<include name="lib/asm.jar"/>
+<include name="lib/antlr.jar" />
+<include name="lib/commons-logging.jar" />
+<include name="lib/commons-collections.jar"
/>]]></programlisting>
</listitem>
</itemizedlist>
<para>You should end up with something like:</para>
- <programlisting role="XML">
- <fileset dir="${basedir}">
+ <programlisting role="XML"><![CDATA[<fileset
dir="${basedir}">
+ <include name="lib/jbpm*.jar" />
+ <include name="lib/jboss-el.jar" />
+ <include name="lib/drools-*.jar"/>
+ <include name="lib/core.jar"/>
+ <include name="lib/janino*.jar"/>
+ <include name="lib/antlr-*.jar"/>
+ <include name="lib/mvel*.jar"/>
+ <include name="lib/richfaces-api*.jar" />
- <include name="lib/jbpm*.jar" />
<include
- name="lib/jboss-el.jar" /> <include
- name="lib/drools-*.jar"/> <include
- name="lib/core.jar"/> <include
- name="lib/janino*.jar"/> <include
- name="lib/antlr-*.jar"/> <include
- name="lib/mvel*.jar"/> <include
- name="lib/richfaces-api*.jar" />
+ <!-- Hibernate and deps -->
+ <include name="lib/hibernate.jar"/>
+ <include name="lib/hibernate-commons-annotations.jar"/>
+ <include name="lib/hibernate-annotations.jar"/>
+ <include name="lib/hibernate-entitymanager.jar"/>
+ <include name="lib/hibernate-validator.jar"/>
+ <include name="lib/jboss-common-core.jar" />
- <!-- Hibernate and deps --> <include
- name="lib/hibernate.jar"/> <include
- name="lib/hibernate-commons-annotations.jar"/>
- <include
name="lib/hibernate-annotations.jar"/>
- <include
name="lib/hibernate-entitymanager.jar"/>
- <include
name="lib/hibernate-validator.jar"/>
- <include name="lib/jboss-common-core.jar"
/>
+ <!-- jsf libs -->
+ <include name="lib/jsf-api.jar" />
+ <include name="lib/jsf-impl.jar" />
+ <include name="lib/el-api.jar" />
+ <include name="lib/el-ri.jar"/>
- <!-- jsf libs --> <include
name="lib/jsf-api.jar"
- /> <include name="lib/jsf-impl.jar"
/> <include
- name="lib/el-api.jar" /> <include
- name="lib/el-ri.jar"/>
+ <!-- 3rd party and supporting jars -->
+ <include name="lib/javassist.jar" />
+ <include name="lib/dom4j.jar" />
+ <include name="lib/concurrent.jar" />
+ <include name="lib/cglib.jar" />
+ <include name="lib/asm.jar" />
+ <include name="lib/antlr.jar" />
+ <include name="lib/commons-logging.jar" />
+ <include name="lib/commons-collections.jar" />
- <!-- 3rd party and supporting jars -->
<include
- name="lib/javassist.jar"/> <include
- name="lib/dom4j.jar" /> <include
- name="lib/concurrent.jar" /> <include
- name="lib/cglib.jar"/> <include
- name="lib/asm.jar"/> <include
name="lib/antlr.jar"
- /> <include name="lib/commons-logging.jar"
/>
- <include name="lib/commons-collections.jar"
/>
-
- </fileset>
- </programlisting>
+</fileset>]]></programlisting>
</listitem>
</itemizedlist>
</section>
<section>
- <title>
- Building and deploying the seam-gen'd application to Glassfish
- </title>
+ <title>Building and deploying the seam-gen'd application to
Glassfish</title>
<itemizedlist>
<listitem>
<para>
- Build your application by calling
- <literal>ant</literal>
- in the base directory of your project (ex.
- <literal>/projects/seamgen-example</literal>
- ). The target of the build will be
- <literal>dist/seamgen-example.ear</literal>
- .
+ Build your application by calling <literal>ant</literal>
in
+ the base directory of your project (for example
+ <literal>/projects/seamgen-example</literal>). The
target
+ of the build will be
<literal>dist/seamgen-example.ear</literal>.
</para>
</listitem>
<listitem>
<para>
- To deploy the application follow the instructions here :
- <xref linkend="jee5-glassfish-deploy" />
- but use references to this project
- <literal>seamgen-example</literal>
- instead of
- <literal>jboss-seam-jee5</literal>
- .
+ To deploy the application follow the instructions here
+ <xref linkend="jee5-glassfish-deploy" /> but use
references
+ to this project <literal>seamgen-example</literal>
instead
+ of <literal>jboss-seam-jee5</literal>.
</para>
</listitem>
<listitem>
<para>
- Checkout the app at:
-
<literal>http://localhost:8081/seamgen_example/</literal>
+ Checkout the app at
<literal>http://localhost:8081/seamgen_example/</literal>
</para>
</listitem>
</itemizedlist>