Author: denis.forveille
Date: 2009-08-03 16:59:44 -0400 (Mon, 03 Aug 2009)
New Revision: 11336
Added:
branches/community/Seam_2_2/examples/jee5/booking/build-websphere7.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ejb-jar.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-bnd.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-ext.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/persistence.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/import.sql
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/log4j.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/seam.properties
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/application.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/components.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/faces-config.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/pages.xml
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/web.xml
branches/community/Seam_2_2/examples/jee5/booking/src/GlassfishDerbyDialect.java
Modified:
branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Author_Group.xml
branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xml
branches/community/Seam_2_2/examples/jee5/booking/resources/WEB-INF/web.xml
branches/community/Seam_2_2/examples/jee5/readme.txt
Log:
WebSpehre v7 jee5/booking sample rework + WebSphere v7 documentation chapter rework
JBSEAM-4324
Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Author_Group.xml
===================================================================
--- branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Author_Group.xml 2009-08-03
13:45:14 UTC (rev 11335)
+++ branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Author_Group.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -64,6 +64,10 @@
<surname>Orshalick</surname>
</author>
<author>
+ <firstname>Denis</firstname>
+ <surname>Forveille</surname>
+ </author>
+ <author>
<firstname>Marek</firstname>
<surname>Novotny</surname>
</author>
Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xml
===================================================================
--- branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xml 2009-08-03
13:45:14 UTC (rev 11335)
+++ branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -1,782 +1,638 @@
<chapter id="websphere">
- <title>Seam on IBM's Websphere AS</title>
+ <title>Seam on IBM's WebSphere AS v7</title>
+
+ <section>
+ <title>WebSphere AS environment and version recommendation</title>
+
+ <para>
+ WebSphere Application Server v7 is IBM's application server offering.
+ This release is fully Java EE 5 certified.
+ </para>
+
+ <para>
+ WebSphere AS being a commercial product, we will not discuss the
+ details of its installation. At best, we will instruct you to follow the directions
+ provided by your particular installation type and license.
+ </para>
+
+ <para>
+ First, we will go over some basic considerations on how to run Seam applications
under WebSphere AS v7.
+ We will go over the details of these steps using the JEE5 booking example.
+ We will also deploy the JPA (non-EJB3) example application.
+ </para>
+
+ <para>
+ All of the examples and information in this chapter are based on
+ WebSphere AS v7. A trial version can be downloaded here :
+ <ulink
url="http://www.ibm.com/developerworks/downloads/ws/was">
WebSphere Application Server V7</ulink>
+ </para>
+ <para>
+ WebSphere v7.0.0.3 is the minimal recommended version of WebSphere v7 to use
+ with Seam. Earlier versions of WebSphere have bugs in the EJB container that will
+ cause various exceptions to occur at runtime.
+ </para>
+
+ <para>
+ The following sections in this chapter assume that WebSphere is correctly
installed and is
+ functional, and a profile has been successfully created.
+ </para>
+
+ <para>
+ This chapter explain how to compile, deploy and run some sample applications in
WebSphere. These sample applications require
+ a database. WebSphere comes by default with a set of sample applications called
"Default Application". This set of sample applications
+ use a Derby database running on the Derby instance installed with WebSphere. In
order to keep this simple we'll use this Derby database created
+ for the "Default Applications". However, to run the sample application
with the Derby database "as-is", a patched Hibernate
+ dialect must be used (The patch changes the default "auto" key
generation strategy) as explained in <xref linkend="glassfish" />.
+ If you want to use another database, it's just a matter of creating a
connection pool in WebSphere pointing to this database,
+ declare the correct Hibernate dialect and set the correct JNDI name in
<literal>persistence.xml</literal>.
+ </para>
+ </section>
- <para>Websphere AS V7 is IBM's application server offering. This release is
- fully Java EE 5 certified.</para>
-
- <para>First we will go over some basic information about the Websphere AS
- environment that we used for these examples. We will
- go over the details of those steps with the JEE5 booking example. We will also
deploy
- the JPA example application. </para>
-
+
<section>
- <title>Websphere AS environment and deployment information</title>
+ <title>Configuring the WebSphere Web Container</title>
+ <para>
+ This step is mandatory in order to have Seam applications run with WebSphere v7.
+ Two extra properties must be added to the Web Container. Please refer to the IBM
WebSphere Information Center for further explanations on those properties.
+ </para>
+ <para>
+ To add the extra properties:
+ <itemizedlist>
+ <listitem>
+ Open the WebSphere administration console
+ </listitem>
+ <listitem>
+ Select the <literal>Servers/Server Types/WebSphere Application
Servers</literal> in the left navigation menu
+ </listitem>
+ <listitem>
+ Click on the server name (<literal>server1</literal>)
+ </listitem>
+ <listitem>
+ On the right navigation menu, select <literal>Web Container Settings/Web
container</literal>)
+ </listitem>
+ <listitem>
+ On the right navigation menu, select <literal>custom
properties</literal>) and add the following properties:
+ <itemizedlist>
+ <listitem>
+ <literal>prependSlashToResource = true</literal>
+ </listitem>
+ <listitem>
+ <literal>com.ibm.ws.webcontainer.invokefilterscompatibility =
true</literal>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ <listitem>
+ Save and restart the server
+ </listitem>
+ </itemizedlist>
+ </para>
+ </section>
+
+ <section id="websphere-jndi-section">
+ <title>Seam and the WebSphere JNDI name space</title>
+ <para>
+ In order to use component injection, Seam needs to know how to lookup for session
beans bound to the JNDI name space.
+ Seam provides two mechanisms to configure the way it will search for such
resources:
+ <itemizedlist>
+ <listitem>
+ The global <literal>jndi-pattern</literal> switch on the
<literal><core:init></literal>. in
<literal>components.xml</literal>.
+ The switch can use a special placeholder
"<literal>#{ejbName}</literal>" that resolves to the unqualified
name of the EJB
+ </listitem>
+ <listitem>
+ <para>
+ The <literal>@JndiName</literal> annotation
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ <xref linkend="config.integration.ejb.container"/> gives detailed
explanations on how those mechanisms work.
+ </para>
- <para>Websphere AS is a commercial product and so we will not discuss the
- details of its installation other than to say follow the directions
- provided by your particular installation type and license. This
- section will detail the exact server versions used, installation tips,
- and some custom properties that are needed for all of the
- examples.</para>
-
+ <para>
+ By default, WebSphere will bind the session bean in
+ its local JNDI name space under a "short" binding name that adheres to the
following pattern
+
<literal>ejblocal:<package.qualified.local.interface.name></literal>.
+ </para>
+ <para>
+ For a detailed description on how WebSphere v7 organizes and binds EJBs in its
JNDI name spaces, please refer to the WebSphere Information Center.
+ </para>
+ <para>
+ As explained before, Seam needs to lookup for session bean as they appear in
JNDI.
+ Basically, there are three strategies, in order of complexity:
+ <itemizedlist>
+ <listitem>
+ Specify which JNDI name Seam must use for each session bean using the
<literal>@JndiName</literal> annotation in the java source file
+ </listitem>
+ <listitem>
+ Override the default session bean names generated by WebSphere to conform to the
<literal>jndi-pattern</literal> attribute
+ </listitem>
+ <listitem>
+ Use EJB references
+ </listitem>
+ </itemizedlist>
+ </para>
+
+ <section id="was.strategy1">
+ <title>Strategy 1: Specify which JNDI name Seam must use for each Session
Bean</title>
+ <para>
+ This strategy is the simplest and fastest one regarding development. It uses the
WebSphere v7 default binding mechanism. To use this strategy:
+ <itemizedlist>
+ <listitem>
+ Add a
<literal>@JndiName("ejblocal:<package.qualified.local.interface.name>)</literal>
annotation to each session bean that is a Seam component.
+ </listitem>
+ <listitem>
+ <para>
+ In <literal>components.xml</literal>, add the following
line:
+ <programlisting role="XML"><![CDATA[<core:init
jndi-name="java:comp/env/#{ejbName}" />]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para >
+ Add a file named
<literal>WEB-INF/classes/seam-jndi.properties</literal> in the web module with
the following content:
+
<programlisting>com.ibm.websphere.naming.hostname.normalizer=com.ibm.ws.naming.util.DefaultHostnameNormalizer
+java.naming.factory.initial=com.ibm.websphere.naming.WsnInitialContextFactory
+com.ibm.websphere.naming.name.syntax=jndi
+com.ibm.websphere.naming.namespace.connection=lazy
+com.ibm.ws.naming.ldap.ldapinitctxfactory=com.sun.jndi.ldap.LdapCtxFactory
+com.ibm.websphere.naming.jndicache.cacheobject=populated
+com.ibm.websphere.naming.namespaceroot=defaultroot
+com.ibm.ws.naming.wsn.factory.initial=com.ibm.ws.naming.util.WsnInitCtxFactory
+com.ibm.websphere.naming.jndicache.maxcachelife=0
+com.ibm.websphere.naming.jndicache.maxentrylife=0
+com.ibm.websphere.naming.jndicache.cachename=providerURL
+java.naming.provider.url=corbaloc:rir:/NameServiceServerRoot
+java.naming.factory.url.pkgs=com.ibm.ws.runtime:com.ibm.ws.naming</programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ At the end of <literal>web.xml</literal>, add the following
lines:
+ <programlisting
role="XML"><![CDATA[<ejb-local-ref>
+ <ejb-ref-name>EjbSynchronizations</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <local-home></local-home>
+ <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
+ </ejb-local-ref>]]></programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ That's all folks! No need to update any file during the development, nor to
define any EJB to EJB or web to EJB reference!
+ </para>
+ <para>
+ Compared to the other strategies, this strategy has the advantage not to have to
manage any EJBs reference and also not to have to maintain extra files.
+ The only drawback is one extra line in the java source code with the
<literal>@JndiName</literal> annotation
+ </para>
+ </section>
+
<section>
- <title>Installation versions</title>
- <para>All of the examples and information in this chapter are based on
- the version V7 of Websphere AS at the time of this writing.
- <itemizedlist>
- <listitem>
- <para><ulink
-
url="http://www.ibm.com/developerworks/downloads/ws/was">
- Websphere Application Server V7</ulink></para>
- </listitem>
- </itemizedlist> </para>
-
- <para>After installing Websphere AS, create server profile with Profile
Management Tool, if you
- didn't create profile in installation process.
- </para>
+ <title>Strategy 2: Override the default names generated by
WebSphere</title>
+ There is no simple way to globally override the default naming strategy for session
beans in WebSphere.
+ However, WebSphere provides a way to override the name of each bean.
+ <para>
+ To use this strategy:
+ <itemizedlist>
+ <listitem>
+ <para>
+ Add a file named
<literal>META-INF/ibm-ejb-jar-ext.xml</literal> in the EJB module and add an
entry for each session bean like this:
+ <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
+<ejb-jar-bnd
+
xmlns="http://websphere.ibm.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee
+
http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd"
+ version="1.0">
+
+ <session name="AuthenticatorAction"
simple-binding-name="AuthenticatorAction" />
+ <session name="BookingListAction"
simple-binding-name="BookingListAction" />
+
+</ejb-jar-bnd>]]></programlisting>
+ WebSphere will then bind the
<literal>AuthenticatorAction</literal> EJB to the
<literal>ejblocal:AuthenticatorAction</literal> JNDI name
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ In <literal>components.xml</literal>, add the following
line:
+ <programlisting role="XML"><![CDATA[<core:init
jndi-name="ejblocal:#{ejbName}" />]]></programlisting>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add a file named
<literal>WEB-INF/classes/seam-jndi.properties</literal> as described in
strategy 1
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ In <literal>web.xml</literal>, add the following lines (Note
the different <literal>ejb-ref-name</literal> value):
+ <programlisting
role="XML"><![CDATA[<ejb-local-ref>
+ <ejb-ref-name>ejblocal:EjbSynchronizations</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <local-home></local-home>
+ <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
+ </ejb-local-ref>]]></programlisting>
+ </para>
+ </listitem>
+ </itemizedlist>
+ </para>
+ <para>
+ Compared to the first strategy, this strategy requires to maintain an extra
file
+ (<literal>META-INF/ibm-ejb-jar-ext.xml</literal>),
+ where a line must be added each time a new session bean is added to the
application),
+ but still does not require to maintain EJB reference between beans.
+ </para>
</section>
-
- </section>
-
- <section id="jee5-websphere-section">
- <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 designed
- to run on Glassfish, but with the steps below it can be deployed to
- Websphere. It is located in the
- <literal>$SEAM_DIST/examples/jee5/booking</literal> directory.
- </para>
-
- <section>
- <title>Configuration file changes</title>
-
- <para>Below are the configuration file changes that are need to the base
- example.</para>
-
- <variablelist>
- <varlistentry>
- <term>
- <literal>resources/WEB-INF/components.xml</literal>
- </term>
- <listitem>
- <para>We need to change the way that we look up EJBs for
- WAS. We need to remove the
- <literal>/local</literal> from the end of the
- <literal>jndi-pattern</literal> attribute. It should
- look like this: </para>
-
-
- <programlisting role="XML"><![CDATA[
-<core:init jndi-pattern="java:comp/env/jboss-seam-jee5/#{ejbName}"
debug="true"/>
- ]]></programlisting>
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term>
- <literal>resources/META-INF/ejb-jar.xml</literal>
- </term>
- <listitem>
- <para>We need to replace the /local string from
<literal>ejb-ref-name</literal>.
- See at the following final code:</para>
-
- <programlisting role="XML"><![CDATA[
- <enterprise-beans>
- <!-- EJB reference required when one Seam EJB component references another Seam
EJB component using @In -->
- <!-- Not required if you inject using @EJB, but then you lose state management
and client-side interceptors (e.g., security) -->
- <session>
- <ejb-name>RegisterAction</ejb-name>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/AuthenticatorAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.Authenticator</local>
- </ejb-local-ref>
- </session>
- </enterprise-beans>]]></programlisting>
-
- </listitem>
- </varlistentry>
-
- <varlistentry>
- <term> <literal>resources/WEB-INF/web.xml</literal>
- </term>
- <listitem>
- <para>We have to make some changes to the EJB references
- in the <literal>web.xml</literal>. These changes are
- what will allow WAS to bind automatically the EJB3 references in
- the web module to the the actual EJB3 beans in the EAR
- module. Replace all of the /local strings in
- <literal>ejb-local-refs</literal> when the values
- below.</para>
-
-
- <programlisting role="XML"><![CDATA[
- <!-- JEE5 EJB3 names -->
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/AuthenticatorAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.Authenticator</local>
- </ejb-local-ref>
+ <section>
+ <title>Strategy 3: Use EJB references</title>
+ This strategy is based on the usage of EJB references, from EJB to EJB and
from the web module to EJB. To use it:
+ <itemizedlist>
+ <listitem>
+ In <literal>components.xml</literal>, add the following
line:
+ <programlisting role="XML"><![CDATA[<core:init
jndi-name="java:comp/env/#{ejbName}" />]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>
+ Follow the instructions in <xref
linkend="config.integration.ejb.container"/> to declare the references from
web to EJB and from EJB to EJB
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ This is the most tedious strategy as each session bean referenced by another
session bean (i.e. "injected") as to be declared in
+ <literal>ejb-jar.xml</literal> file.
+ Also, each new session bean has to be added to the list of referenced bean in
<literal>web.xml</literal>
+ </para>
+
+ </section>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/BookingListAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.BookingList</local>
- </ejb-local-ref>
+ </section>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/RegisterAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.Register</local>
- </ejb-local-ref>
+ <section id="websphere-timeout-section">
+ <title>Configuring timeouts for Stateful Session Beans</title>
+ <para>
+ A timeout value has to be set for each stateful session bean used in the
application because stateful bean must not expire in WebSphere while Seam
+ might still need thenm.
+ At the time of writing this document, WebSphere does not provide a way to
configure a global timeout at neither the cluster,
+ server, application nor ejb-jar level. It has to be done for each stateful bean
individually.
+ This is done by adding a file named
<literal>META-INF/ibm-ejb-jar-ext.xml</literal> in the EJB module, and declare
the timeout value for each bean:
+ <programlisting role="XML"><![CDATA[<?xml
version="1.0" encoding="UTF-8"?>
+<ejb-jar-ext
+
xmlns="http://websphere.ibm.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee
+
http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-ext_1_0.xsd"
+ version="1.0">
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/ChangePasswordAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.ChangePassword</local>
- </ejb-local-ref>
+ <session name="BookingListAction"><time-out
value="605"/></session>
+ <session name="ChangePasswordAction"><time-out
value="605"/></session>
+
+</ejb-jar-ext>]]></programlisting>
+ </para>
+ <para>
+ The <literal>time-out</literal> is expressed in seconds and must be
higher than the Seam conversation expiration timeout
+ and a few minutes higher than the user's HTTP session timeout (The session
expiration timeout can trigger a few minutes
+ after the number of minutes declared to expire s for the HTTP session
expiration).
+ </para>
+ </section>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/HotelBookingAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.HotelBooking</local>
- </ejb-local-ref>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/HotelSearchingAction</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.example.booking.HotelSearching</local>
- </ejb-local-ref>
+ <section id="jee5-websphere-section">
+ <title>The <literal>jee5/booking</literal> example</title>
- <ejb-local-ref>
- <ejb-ref-name>jboss-seam-jee5/EjbSynchronizations</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
- </ejb-local-ref>]]></programlisting>
-
- <para>Note also that
<literal>EjbSynchronizations</literal> is
- a built-in Seam EJB and not part of the Hotel Booking example. This
- means that if your application's
<literal>components.xml</literal>
- specifies <literal>transaction:ejb-transaction</literal>,
- then you must include:</para>
- <programlisting role="XML"><![CDATA[
- <ejb-local-ref>
- <ejb-ref-name>myapp/EjbSynchronizations</ejb-ref-name>
- <ejb-ref-type>Session</ejb-ref-type>
- <local-home></local-home>
- <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
- </ejb-local-ref>]]></programlisting>
- <para>in your web.xml. If you don't include it, you'll
get the following error:</para>
- <programlisting>Name comp/env/myapp/EjbSynchronizations not found
in context java:</programlisting>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>resources/META-INF/persistence.xml</literal>
- </term>
- <listitem>
- <para>For this example we will be using the default
- datasource that comes with WAS. To do this change the
- <literal>jta-data-source</literal>
element:</para>
- <programlisting role="XML"><![CDATA[
-<jta-data-source>DefaultDatasource</jta-data-source>
- ]]></programlisting>
- <para>Then we need to adjust some of the hibernate
- properties. First comment out the Glassfish properties.
- Next you need to add/change the properties:</para>
-
-
- <programlisting role="XML"><![CDATA[
-<!--<property name="hibernate.transaction.flush_before_completion"
value="true"/>-->
-<property name="hibernate.cache.provider_class"
- value="org.hibernate.cache.HashtableCacheProvider"/>
-<property name="hibernate.dialect"
value="GlassfishDerbyDialect"/>
-<property name="hibernate.transaction.manager_lookup_class"
-
value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
- ]]></programlisting>
- <para>
- <itemizedlist>
- <listitem>
- <para>
-
<literal>hibernate.transaction.manager_lookup_class</literal>
- — Standard Hibernate transaction
- manager property for WAS 6.X and 7</para>
- </listitem>
- <listitem>
- <para>
-
<literal>hibernate.transaction.flush_before_completion</literal>
- — This is commented out because we want
- the container to manage the transactions. Also
- if this is set to <literal>true</literal> an
- exception will be thrown by WAS when the
- EJBContext is looked up.
-
-
-
<programlisting><![CDATA[com.ibm.wsspi.injectionengine.InjectionException:
- EJBContext may only be looked up by or injected into an
EJB]]></programlisting></para>
- </listitem>
- <listitem>
- <para><literal>hibernate.dialect</literal>
- — From WAS 6.1.0.9 on the embedded DB was
- switched to the same Derby DB as is in
- Glassfish v2.</para>
- </listitem>
- </itemizedlist></para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>src/GlassfishDerbyDialect.java</literal>
- </term>
- <listitem>
- <para>You will need to get the
- <literal>GlassfishDerbyDialect.java</literal> and
- copy it into the <literal>/src</literal>
- directory. The java class exists in the JPA example source directory
and can be
- copied using the command below assuming you are in
- <literal>jee5/booking</literal> directory:</para>
-
-
- <programlisting><![CDATA[
-cp ../../jpa/src/GlassfishDerbyDialect.java
- ./src]]></programlisting>
- <para>This class will be put into the
- <literal>jboss-seam-jee5.jar</literal> file.
</para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term> <literal>resources/import.sql</literal>
- </term>
- <listitem>
- <para>This file must also be copied from the JPA example
- because either the Derby DB or the dialect does not support
- changes to the <literal>ID</literal> column. The files
- are identical except for the column difference. Use the
- following command to make the copy
-
-
- <programlisting><![CDATA[
-cp ../../jpa/resources-websphere7/import.sql ./resources]]></programlisting>
- </para>
- </listitem>
- </varlistentry>
- </variablelist>
-
- </section>
-
+ <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 designed to run on Glassfish, but with the following steps,
it can be deployed on
+ WebSphere. It is located in the
<literal>$SEAM_DIST/examples/jee5/booking</literal> directory.
+ </para>
+
+ <para>
+ For running this example, we'll use the second JNDI mapping strategy
("Override the default names generated by WebSphere")
+ as we don't want to change the java code to add the
<literal>@JndiName</literal> annotation as in the first strategy.
+ </para>
+
<section>
- <title>Building the <literal>jee5/booking</literal>
- example</title>
-
- <para>In order to get the changes we have made into our application we
- need to make some changes to the <literal>build.xml</literal>.
- There are also some additional jars that are required by our
- application in order to work with WAS. This section will cover
- what changes are needed to the
<literal>build.xml</literal>.</para>
-
- <section>
- <title>Library dependency changes</title>
- <para>We remove the <literal>log4j.jar</literal>
- so that all of the log output from our application will
- be added to the WAS log. Additional steps are
- required to fully configure log4j and those are outside
- of the scope of this document.</para>
- </section>
-
- <section>
- <title>Updating the <literal>build.xml</literal>
file</title>
-
- <para>Add the following entry to the bottom of the
- <literal>build.xml</literal> file. This overrides the
- default fileset that is used to populate the
- <literal>jboss-seam-jee5.jar</literal>.
- :
- </para>
-
-
- <programlisting role="XML"><![CDATA[
- <fileset id="jar.resources" dir="${resources.dir}">
- <include name="import.sql" />
- <include name="seam.properties" />
- <include name="META-INF/persistence.xml" />
- <include name="META-INF/ejb-jar.xml" />
- </fileset>]]></programlisting>
-
- <para>Now all that is left is to execute the <literal>ant
- archive</literal> task and the built application will be in
- the <literal>jee5/booking/dist</literal> directory.
- </para>
- </section>
-
+ <title>Building the <literal>jee5/booking</literal>
example</title>
+
+ <para>
+ Building it only requires running the correct ant command:
<programlisting>ant -f build-websphere7.xml</programlisting>
+ This will create container specific distribution and exploded archive
directories with the <literal>websphere7</literal> label.
+ </para>
</section>
-
+
<section id="jee5-websphere-deploy">
- <title>Deploying the application to Websphere</title>
-
- <para>So now we have everything we need in place. All that is left is to
- deploy it - just a few steps more.</para>
- <para> For this we will use Websphere's administration console. As
- before there are some tricks and tips that must be followed.</para>
-
- <para>The steps below are for the WAS version stated above.
- The ports are default values, if you changed them substitute your values.
- <orderedlist>
- <listitem>
- <para>Log in to the administration console
-
-
-
<programlisting><![CDATA[https://localhost:9043/admin]]></programlisting>
- or
- <programlisting><![CDATA[http://localhost:9060/admin]]></programlisting>
- </para>
- </listitem>
- <listitem>
- <para>Access the <literal>Websphere enterprise
- applications</literal> menu option under the
- <literal>Applications --> Application Type</literal>
left side menu. </para>
- </listitem>
- <listitem>
- <para>At the top of the <literal>Enterprise
- Applications</literal> table select
- <literal>Install</literal>. Below are installation
- wizard pages and what needs to done on each:
- <itemizedlist>
+ <title>Deploying the <literal>jee5/booking</literal>
example</title>
+ <para>
+ The steps below are for the WAS version stated above.The ports are default
values, if you changed them, you must substitute the values.
+ <orderedlist>
+ <listitem>
+ Log in to the administration console
+
<programlisting><![CDATA[http://localhost:9060/admin]]></programlisting>
+ Enter your userid annd/or your password if security is enabled for the
console.
+ </listitem>
+
+ <listitem>
+ <para>
+ Go to the <literal>WebSphere enterprise
applications</literal> menu option under the <literal>Applications -->
Application Type</literal>
+ left side menu.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ At the top of
the <literal>Enterprise Applications</literal> table select
<literal>Install</literal>.
+ Below are installation wizard pages and what needs to done on each:
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>Preparing for the application
installation</literal>
+ <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>Next</literal>
- button.</para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Fast Path</literal>
- button.</para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Next</literal>
- button.</para>
- </listitem>
- </itemizedlist> </para>
+ <para>
+ Browse to the
<literal>examples/jee5/booking/dist-websphere7/jboss-seam-jee5.ear</literal>
+ file using the file upload widget.
+ </para>
</listitem>
<listitem>
- <para><literal>Select installation
- options</literal>
- <itemizedlist>
- <listitem>
- <para>Select the <literal>Deploy
- enterprise beans</literal> and
- <literal>Allow EJB reference targets to
resolve automatically</literal>
- check boxes. This is needed unless you
- used a Websphere AS tool to package the
- application. </para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Next</literal>
- button.</para>
- </listitem>
-
-
- </itemizedlist> </para>
+ <para>
+ Select the <literal>Next</literal> button.
+ </para>
</listitem>
<listitem>
- <para><literal>Map modules to
- servers</literal>
- <itemizedlist>
- <listitem>
- <para>No changes needed here as we only
- have one server. Select the
- <literal>Next</literal>
- button.</para>
- </listitem>
- </itemizedlist> </para>
+ <para>
+ Select the <literal>Fast Path</literal> button.
+ </para>
</listitem>
<listitem>
- <para><literal>Summary</literal>
- <itemizedlist>
- <listitem>
- <para>No changes needed here. Select
- the <literal>Finish</literal>
- button.</para>
- </listitem>
- </itemizedlist> </para>
+ <para>
+ Select the <literal>Next</literal> button.
+ </para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Select installation options</literal>
+ <itemizedlist>
<listitem>
- <para><literal>Installation</literal>
- <itemizedlist>
- <listitem>
- <para>Now you will see it installing and
- deploying your
- application.</para>
- </listitem>
- <listitem>
- <para>When it finishes select the
- <literal>Save</literal> link and
- you will be returned to the
- <literal>Enterprise
- Applications</literal>
- table.</para>
- </listitem>
- </itemizedlist> </para>
+ <para>
+ Select the <literal>Deploy enterprise beans and Allow
EJB reference targets to resolve automatically</literal>
+ check boxes at the bottom of the page. This will let
WebSphere use its simplified JNDI reference mapping.
+ </para>
</listitem>
- </itemizedlist> </para>
- </listitem>
- <listitem id="websphere-app-adj-after-install"
xreflabel="installation adjustments for jee5 example">
- <para>Now that we have our application installed we need to
- make some adjustments to it before we can start it:</para>
- <itemizedlist>
<listitem>
- <para>Starting from the <literal>Enterprise
- Applications</literal> table select the
- <literal>Seam Booking</literal>
- link.</para>
+ <para>
+ Select the <literal>Next</literal> button.
+ </para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Map modules to servers</literal>
+ <itemizedlist>
<listitem>
- <para>Select the <literal>Manage
- Modules</literal> link.</para>
+ <para>
+ No changes needed here as we only have one server. Select the
<literal>Next</literal>button.
+ </para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Map virtual hosts for Web modules</literal>
+ <itemizedlist>
<listitem>
- <para>Select the
- <literal>jboss-seam-jee5-booking.war</literal>
- link.</para>
+ <para>
+ No changes needed here as we only have one virtual host.
Select the <literal>Next</literal>button.
+ </para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Summary</literal>
+ <itemizedlist>
<listitem>
- <para>Change the <literal>Class loader
- order</literal> combo box to
- <literal>Classes loaded with application
- class loader first (parent
last)</literal>.</para>
+ <para>No changes needed here. Select the
<literal>Finish</literal> button.</para>
</listitem>
+ </itemizedlist>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>Installation</literal>
+ <itemizedlist>
<listitem>
- <para>Select <literal>Apply</literal> and
then
- <literal>Save</literal> options.</para>
+ <para>Now you will see WebSphere installing and
deploying your application.</para>
</listitem>
<listitem>
- <para>Return to the <literal>Seam
Booking</literal> page.</para>
+ <para>
+ When done, select the <literal>Save</literal>
link and you will be returned to the
+ <literal>Enterprise Applications</literal>
table.
+ </para>
</listitem>
- <listitem>
- <para>On this page select the <literal>Class
- loading and update detection</literal>
- link.</para>
- </listitem>
- <listitem>
- <para>Select the radio button for
- <literal>Classes loaded with application
- class loader first</literal>.</para>
- </listitem>
- <listitem>
- <para>Select <literal>Apply</literal> and
then
- <literal>Save</literal> options.</para>
- </listitem>
- </itemizedlist>
- </listitem>
- <listitem>
- <para>To start the application return to the
- <literal>Enterprise Applications</literal> table and
- select our application in the list. Then choose the
- <literal>Start</literal> button at the top of the
- table.</para>
- </listitem>
- <listitem>
- <para>You can now access the application at
-
<literal>http://localhost:9080/seam-jee5-booking/index.html</literal>
- .</para>
- </listitem>
- </orderedlist>
- <!-- <note>
- <title>A note about Websphere Stateful bean timeouts</title>
- <para>The default timeout period for a Websphere 6.1 Stateful
- EJB is 10 minutes. This means that you may see some EJB timeout
- exceptions after some idle time. It is possible to adjust the
- timeout of the Stateful EJBs on an individual basis, but
- that is beyond the scope of this document. See the Websphere
- documentation for details.
- </para>
- </note> -->
- </para>
- </section>
-
- </section>
-
- <section>
- <title> The <literal>jpa</literal> booking example
</title>
- <para>Thankfully getting the <literal>jpa</literal> example to
work is
- much easier than the <literal>jee5</literal> example. This is the
- Hotel Booking example implemented in Seam POJOs and using Hibernate JPA
- with JPA transactions. It does not use EJB3.</para>
-
- <para> The example already has a breakout of configurations and build
- scripts for many of the common containers including Websphere.</para>
-
- <para>First thing we are going to do is build and deploy that example. Then
- we'll go over some key changes that we needed.</para>
-
- <section>
- <title>Building the <literal>jpa</literal>
example</title>
- <para> Building it only requires running the correct ant command:
- <programlisting>ant websphere7</programlisting>
- This will create container specific distribution and exploded
- archive directories with the <literal>websphere7</literal>
label.</para>
- </section>
- <section>
- <title>Deploying the <literal>jpa</literal>
example</title>
- <para>This is similar to the <literal>jee5</literal>
example at
- <xref linkend="jee5-websphere-deploy"/>, but without so
many steps.
- </para>
- <itemizedlist>
- <listitem>
- <para>From the <literal>Enterprise
Applications</literal> table
- select the <literal>Install</literal> button.
- <itemizedlist>
- <listitem>
- <para><literal>Preparing for the application
- installation</literal>
- <itemizedlist>
- <listitem>
- <para>Browse to the
-
<literal>examples/jpa/dist-websphere7/jboss-seam-jpa.war</literal>
- file using the file upload widget.
- </para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Fast Path</literal>
- button.</para>
- </listitem>
- <listitem>
- <para>Select the
- <literal>Next</literal>
- button.</para>
- </listitem>
- </itemizedlist> </para>
+ </itemizedlist>
+ </para>
</listitem>
<listitem>
- <para>Select the <literal>Next</literal> button
for the next
- three pages, no changes are needed.
- </para>
+ <para>
+ To start the application select our application in the list, then
click on the <literal>Start</literal>
+ button at the top of the table.
+ </para>
</listitem>
- <listitem>
- <para><literal>Map context roots for Web
modules</literal>
- <itemizedlist>
- <listitem>
- <para>In the <literal>Context root</literal>
text box
- enter <literal>jboss-seam-jpa</literal>.
- </para>
- </listitem>
- <listitem>
- <para>Select the <literal>Next</literal>
button.
- </para>
- </listitem>
- </itemizedlist></para>
- </listitem>
- <listitem>
- <para><literal>Summary</literal> page
- <itemizedlist>
- <listitem>
- <para>Review the settings if you wish and select
- the <literal>Finish</literal> button to
install
- the application. When installation finished select the
<literal>
- Save</literal> link and you will be returned to
the
- <literal>Enterprise Applications</literal>
table.
- </para>
- </listitem>
- </itemizedlist> </para>
- </listitem>
-
- </itemizedlist>
- </para>
+ </itemizedlist>
+ </para>
</listitem>
+
<listitem>
- <para>As with the <literal>jee5</literal> example there
are some
- class loader changes needed before we start the application.
- Follow the instructions at <xref
linkend="websphere-app-adj-after-install"/>
- but exchange <literal>jboss-seam-jpa_war</literal> for
<literal>Seam Booking</literal>.
- </para>
+ <para>
+ You can now access the application at
<literal>http://localhost:9080/seam-jee5-booking</literal>
+ </para>
</listitem>
- <listitem>
- <para>Finally start the application by selecting it in the
- <literal>Enterprise Applications</literal> table and
clicking
- the <literal>Start</literal> button.
- </para>
- </listitem>
- <listitem>
- <para>You can now access the application at the
-
<literal>http://localhost:9080/jboss-seam-jpa/index.html</literal>.
- </para>
- </listitem>
- </itemizedlist>
+ </orderedlist>
+ </para>
</section>
<section>
- <title>What's different for Websphere AS V7</title>
- <para>The differences between the JPA examples that deploys to JBoss
- 4.2 and Websphere AS V7 are mostly expected; library and
- configuration file changes. </para>
- <itemizedlist>
- <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 Websphere
- transaction manager look up class, and
- changing the hibernate dialect to be
- <literal>GlassfishDerbyDialect</literal>
- .</para>
- </listitem>
- <listitem>
- <para>
- <literal>WEB-INF/components.xml</literal>
- — the change here is
<literal>jndi-pattern</literal>
- without /local string.</para>
- </listitem>
- <listitem>
- <para>
- <literal>META-INF/ejb-jar.xml</literal>
- — the same change in
<literal>ejb-ref-name</literal>,
- where is replace /local string in
-
<literal>jboss-seam-jee5/AuthenticatorAction</literal>.</para>
- </listitem>
- <listitem>
- <para>
- <literal>src/GlassfishDerbyDialect.java
- </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>
- </listitem>
- <listitem>
- <para>Changes for dependent libraries</para>
- <para>The Websphere version requires several library packages
because they are
- not included as they are with JBoss AS. These are primarily for
- hibernate and their dependencies. Below are
- listed only the additional jars needed above and beyond the JBoss
- <literal>JPA</literal> example.
- <itemizedlist>
- <listitem>
- <para> To use Hibernate as your JPA provider you need
- the following jars:
- <itemizedlist>
- <listitem>
- <simpara>
- <literal>hibernate.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
-
<literal>hibernate-annotations.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
-
<literal>hibernate-commons-annotations.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
-
<literal>hibernate-entitymanager.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
-
<literal>hibernate-validator.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
-
<literal>commons-collections.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>jboss-common-core.jar</literal>
- </simpara>
- </listitem>
- </itemizedlist> </para>
- </listitem>
- <listitem>
- <para>Various third party jars that Websphere needs:
- <itemizedlist>
- <listitem>
- <simpara>
<literal>antlr.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
<literal>cglib.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara> <literal>asm.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
<literal>dom4j.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>javassist.jar</literal>
- </simpara>
- </listitem>
- <listitem>
- <simpara>
- <literal>concurrent.jar</literal>
- </simpara>
- </listitem>
- </itemizedlist> </para>
- </listitem>
- </itemizedlist> </para>
- </listitem>
- </itemizedlist>
-
+ <title>Deviation from the original base files</title>
+ Below are the differences between the base configuration files and the WebSphere
specific files held in the <literal>resources-websphere7</literal> directory.
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>META-INF/ejb-jar.xml</literal>
+ — Removed all the EJB references
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>META-INF/ibm-ejb-jar-bnd.xml</literal>
+ — This WebSphere specific file has been added as we use the
second JNDI mapping strategy.
+ It defines, for each session bean, the name WebSphere will use to bind it
its JNDI name space
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>META-INF/ibm-ejb-jar-ext.xml</literal>
+ — This WebSphere specific file defines to WebSphere, the timeout
value for each stateful bean
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>META-INF/persistence.xml</literal>
+ — The main changes here are for the datasource JNDI path,
+ switching to the WebSphere transaction manager lookup class,
+ turning off the
<literal>hibernate.transaction.flush_before_completion</literal> toggle,
+ and forcing the Hibernate dialect to be
<literal>GlassfishDerbyDialect</literal>
+ how as using the integrated Derby database
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>WEB-INF/components.xml</literal>
+ — the change here is <literal>jndi-pattern</literal>
+ to use <literal>ejblocal:#{ejbname}</literal> as using the
second
+ JNDI matching strategy
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>WEB-INF/web.xml</literal>
+ — Remove all the <literal>ejb-local ref</literal>
except the one for
+ <literal>EjbSynchronizations</literal> bean.
+ Changed the ref fo this bean to
<literal>ejblocal:EjbSynchronizations</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>import.sql</literal>
+ — due to the cutomized hibernate Derby dialect, the
<literal>ID</literal>
+ column can not be populated by this file and was removed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Also the build procedure has been changed to include the
<literal>log4j.jar</literal> file
+ and exclude the <literal>concurrent.jar</literal> and
<literal>jboss-common-core.jar</literal> files.
+ </para>
+
</section>
-
-
- </section>
-
+ </section>
+
+
+
+
<section>
- <title>Deploying an application created using
- <literal>seam-gen</literal> on Websphere V7</title>
+ <title>The <literal>jpa</literal> booking example</title>
+
+ <para>
+ This is the Hotel Booking example implemented in Seam POJOs and using Hibernate JPA
+ with JPA transactions. It does not use EJB3.
+ </para>
+
+ <para>
+ The example already has a breakout of configurations and build
+ scripts for many of the common containers including WebSphere.
+ </para>
+
+ <para>
+ First thing, we are going to do is build and deploy that example.
+ Then we'll go over some key changes that we needed.
+ </para>
+
+ <section>
+ <title>Building the <literal>jpa</literal>
example</title>
+ <para>
+ Building it only requires running the correct ant command:
+ <programlisting>ant websphere7</programlisting>
+ This will create container specific distribution and exploded archive
directories with the
+ <literal>websphere7</literal> label.
+ </para>
+ </section>
- <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 Websphere.
- As stated above in <xref linkend="jee5-websphere-section"/>
there
- are some tricky changes needed to get an EJB3 application running. This
- section will take you through the exact steps.</para>
-
+ <section>
+ <title>Deploying the <literal>jpa</literal>
example</title>
+ <para>
+ Deploying <literal>jpa</literal> application is very similar to
the <literal>jee5/booking</literal>
+ example at <xref linkend="jee5-websphere-deploy" />.
+ The main difference is, that this time, we will deploy a war file instead of
an ear file,
+ and we'll have to manually specify the context root of the application.
+ </para>
+ <para>
+ Follow the same instructions as for the
<literal>jee5/booking</literal> sample. Select the
+
<literal>examples/jpa/dist-websphere7/jboss-seam-jpa.war</literal> file on the
first page and on the
+ <literal>Map context roots for Web modules</literal> page (after
the <literal>Map virtual host for Web module</literal>),
+ enter the context root you want to use for your application in the
<literal>Contect Root</literal> input field.
+ </para>
+
+ <para>
+ When started, you can now access the application at the
<literal>http://localhost:9080/<context root></literal>.
+ </para>
+ </section>
+
<section>
- <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,
- specifically the datasource and hibernate values that we will adjust
- once the project is created.</para>
-
-
- <programlisting><![CDATA[
+ <title>Deviation from the generic base files</title>
+ Below are the configuration file differences between the base configuration files
and the files customized
+ for WebSphere held in the <literal>resources-websphere7</literal>
directory.
+ <itemizedlist>
+ <listitem>
+ <para>
+ <literal>META-INF/persistence.xml</literal>
+ — The main changes here are for the datasource JNDI path,
+ switching to the WebSphere transaction manager look up class,
+ turning off the
<literal>hibernate.transaction.flush_before_completion</literal> toggle,
+ and forcing the Hibernate dialect to be
<literal>GlassfishDerbyDialect</literal>
+ how as using the integrated Derby database
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <literal>import.sql</literal>
+ — due to the cutomized hibernate Derby dialect, the
<literal>ID</literal>
+ column can not be populated by this file and was removed.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Also the build procedure have been changed to include the
<literal>log4j.jar</literal> file
+ and exclude the <literal>concurrent.jar</literal> and
<literal>jboss-common-core.jar</literal> files.
+ </para>
+
+ </section>
+ </section>
+
+
+ <section>
+ <title>Deploying an application created using
<literal>seam-gen</literal> on WebSphere V7</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
+ WebSphere. This section will take you through the exact steps.
+ </para>
+
+ <section>
+ <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,
+ specifically the datasource and hibernate values that we will adjust
+ once the project is created.
+ </para>
+
+
+ <programlisting><![CDATA[
./seam setup
Buildfile: build.xml
@@ -848,39 +704,53 @@
BUILD SUCCESSFUL
Total time: 3 minutes 5 seconds]]></programlisting>
-
- <para> Type <literal>./seam new-project</literal> to create your
- project and <literal>cd
- /home/jbalunas/workspace/websphere_example</literal> to the
- newly created structure. </para>
-
- </section>
- <section>
- <title>Changes needed for deployment to Websphere</title>
- <para>We now need to make some changes to the generated
project.</para>
- <section>
- <title>Configuration file changes</title>
- <variablelist>
- <varlistentry>
- <term>
- <literal>resources/META-INF/persistence-dev.xml</literal>
- </term>
- <listitem>
- <itemizedlist>
- <listitem>
- <para> Alter the
- <literal>jta-data-source</literal> to be
- <literal>DefaultDatasource</literal>. We are
- going to be using the integrated Websphere
- DB.</para>
- </listitem>
- <listitem>
- <para> Add or change the properties below.
- These are described in detail at <xref
- linkend="jee5-websphere-section"/>:
- </para>
-
- <programlisting role="XML"><![CDATA[
+
+ <para>
+ Type
+ <literal>./seam new-project</literal>
+ to create your
+ project and
+ <literal>cd
+ /home/jbalunas/workspace/websphere_example</literal>
+ to the
+ newly created structure.
+ </para>
+
+ </section>
+ <section>
+ <title>Changes needed for deployment to Websphere</title>
+ <para>We now need to make some changes to the generated project.
+ </para>
+ <section>
+ <title>Configuration file changes</title>
+ <variablelist>
+ <varlistentry>
+ <term>
+ <literal>resources/META-INF/persistence-dev.xml
+ </literal>
+ </term>
+ <listitem>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Alter the
+ <literal>jta-data-source</literal>
+ to be
+ <literal>DefaultDatasource</literal>
+ . We are
+ going to be using the integrated Websphere
+ DB.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Add or change the properties below.
+ These are described in detail at
+ <xref linkend="jee5-websphere-section" />
+ :
+ </para>
+
+ <programlisting role="XML"><![CDATA[
<property name="hibernate.dialect"
value="GlassfishDerbyDialect"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
@@ -889,108 +759,138 @@
value="org.hibernate.cache.HashtableCacheProvider"/>
<property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>]]></programlisting>
- </listitem>
- <listitem>
- <para> Remove the JBoss AS specific method of exposing
- the EntityManagerFactory: </para>
-
- <programlisting
role="XML"><![CDATA[<property
+ </listitem>
+ <listitem>
+ <para> Remove the JBoss AS specific method of exposing
+ the EntityManagerFactory: </para>
+
+ <programlisting role="XML"><![CDATA[<property
name="jboss.entity.manager.factory.jndi.name"
value="java:/websphere_exampleEntityManagerFactory">]]></programlisting>
- </listitem>
- <listitem>
- <para> You'll need to alter
- <literal>persistence-prod.xml</literal> as
- well if you want to deploy to Websphere using the
- prod profile. </para>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term>
- <literal>src/GlassfishDerbyDialect.java</literal>
- </term>
- <listitem>
- <para>As with other examples we need to include this java class
for
- DB support. It can be copied from the
- <literal>jpa</literal> example into the
- <literal>websphere_example/src</literal>
- directory.
-
- <programlisting><![CDATA[
+ </listitem>
+ <listitem>
+ <para>
+ You'll need to alter
+ <literal>persistence-prod.xml</literal>
+ as
+ well if you want to deploy to Websphere using the
+ prod profile.
+ </para>
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>src/GlassfishDerbyDialect.java
+ </literal>
+ </term>
+ <listitem>
+ <para>
+ As with other examples we need to include this java class for
+ DB support. It can be copied from the
+ <literal>jpa</literal>
+ example into the
+ <literal>websphere_example/src</literal>
+ directory.
+
+ <programlisting><![CDATA[
cp $SEAM/examples/jpa/src/GlassfishDerbyDialect.java
./src]]></programlisting>
- </para>
- </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) </para>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term> <literal>resources/*-ds.xml</literal>
- </term>
- <listitem>
- <para> You can delete these file as we aren't deploying to
- JBoss AS (these files define datasources in JBoss AS, we
- are using Websphere's default datasource) </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> </para>
- </listitem>
- <listitem>
- <para> Alter the
<literal>jndi-pattern</literal>
- to <literal>
- java:comp/env/websphere_example/#{ejbName}
- </literal> </para>
- </listitem>
- <listitem>
- <para>We do not need
- <literal>managed-persistence-context</literal>
- for this example and so can delete its
- entry.</para>
-
-
- <programlisting role="XML"><![CDATA[
+ </para>
+ </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)
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>resources/*-ds.xml</literal>
+ </term>
+ <listitem>
+ <para> You can delete these file as we aren't deploying to
+ JBoss AS (these files define datasources in JBoss AS, we
+ are using Websphere's default datasource) </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>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Alter the
+ <literal>jndi-pattern</literal>
+ to
+ <literal>
+ java:comp/env/websphere_example/#{ejbName}
+ </literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ We do not need
+ <literal>managed-persistence-context
+ </literal>
+ for this example and so can delete its
+ entry.
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[
<persistence:managed-persistence-context name="entityManager"
auto-create="true"
persistence-unit-jndi-name="java:/websphere_exampleEntityManagerFactory"/>
]]></programlisting>
- </listitem>
- </itemizedlist>
- </listitem>
- </varlistentry>
- <varlistentry>
- <term> <literal>resources/WEB-INF/web.xml</literal>
- </term>
- <listitem>
- <para>As with the <literal>jee5/booking</literal>
- example we need to add EJB references to the web.xml. These
- references require replacing /local string in
- <literal>ejb-ref-name</literal> to flag them for
- Websphere to perform the proper binding.</para>
-
-
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ </itemizedlist>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
+ <term>
+ <literal>resources/WEB-INF/web.xml
+ </literal>
+ </term>
+ <listitem>
+ <para>
+ As with the
+ <literal>jee5/booking</literal>
+ example we need to add EJB references to the web.xml. These
+ references require replacing /local string in
+ <literal>ejb-ref-name</literal>
+ to flag them for
+ Websphere to perform the proper binding.
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[
<ejb-local-ref>
<ejb-ref-name>websphere_example/AuthenticatorAction</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
@@ -1002,105 +902,144 @@
<ejb-ref-type>Session</ejb-ref-type>
<local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
</ejb-local-ref>]]></programlisting>
- </listitem>
- </varlistentry>
- </variablelist>
- </section>
- <section>
- <title>Creating the <literal>AuthenticatorAction</literal>
- EJB</title>
- <para>We want to take the existing
<literal>Authenticator</literal>
- Seam POJO component and create an EJB3 out of it. </para>
- <orderedlist>
- <listitem> <para>Change the generated Authenticator
class</para>
- <itemizedlist>
- <listitem>
- <para>Rename the class to
- <literal>AuthenticatorAction</literal> </para>
- </listitem>
- <listitem>
- <para>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
- <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> .
</para>
- </listitem>
- </itemizedlist>
-
-
- <programlisting role="JAVA"><![CDATA[
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </section>
+ <section>
+ <title>
+ Creating the
+ <literal>AuthenticatorAction</literal>
+ EJB
+ </title>
+ <para>
+ We want to take the existing
+ <literal>Authenticator</literal>
+ Seam POJO component and create an EJB3 out of it.
+ </para>
+ <orderedlist>
+ <listitem>
+ <para>Change the generated Authenticator class</para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ Rename the class to
+ <literal>AuthenticatorAction</literal>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ 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
+ <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>
+ .
+ </para>
+ </listitem>
+ </itemizedlist>
+
+
+ <programlisting role="JAVA"><![CDATA[
@Name("authenticator") @Stateless public class
AuthenticatorAction implements Authenticator {]]></programlisting>
-
-
- <programlisting role="JAVA"><![CDATA[
+
+
+ <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> file so are good to go.
</para>
- </listitem>
- </orderedlist>
- </section>
- <section>
- <title>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. </para>
-
- <itemizedlist>
- <listitem>
- <para>Change the default target to
- <literal>archive</literal> (we aren't going to cover
- automatic deployment to Websphere).
- </para>
-
-
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ <listitem>
+ <para>
+ We've already added its reference to the
+ <literal>web.xml</literal>
+ file so are good to go.
+ </para>
+ </listitem>
+ </orderedlist>
+ </section>
+ <section>
+ <title>
+ 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.
+ </para>
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Change the default target to
+ <literal>archive</literal>
+ (we aren't going to cover
+ automatic deployment to Websphere).
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[
<project name="websphere_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>websphere_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> target.
- </para>
-
- <programlisting role="XML"><![CDATA[
+
+ </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>websphere_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>
+ target.
+ </para>
+
+ <programlisting role="XML"><![CDATA[
<copy todir="${war.dir}">
<fileset dir="${basedir}/resources" >
<include name="*.drl" />
</fileset>
</copy>]]></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> section
- of the task below. Add the new includes at the bottom of
- the fileset.
- </para>
-
-
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ <listitem>
+ <para>
+ Now we need to get extra jars into the
+ <literal>build.xml</literal>
+ . Look for the
+ <literal><fileset dir="${basedir}"></literal>
+ section
+ of the task below. Add the new includes at the bottom of
+ the fileset.
+ </para>
+
+
+ <programlisting role="XML"><![CDATA[
<target name="ear" description="Build the EAR">
<copy todir="${ear.dir}">
<fileset dir="${basedir}/resources">
@@ -1127,10 +1066,10 @@
</fileset>
</copy>
</target>]]></programlisting>
- <itemizedlist>
- <listitem>
- <para>Hibernate dependencies</para>
- <programlisting role="XML"><![CDATA[
+ <itemizedlist>
+ <listitem>
+ <para>Hibernate dependencies</para>
+ <programlisting role="XML"><![CDATA[
<!-- Hibernate and deps -->
<include name="lib/hibernate.jar"/>
<include name="lib/hibernate-commons-annotations.jar"/>
@@ -1138,10 +1077,10 @@
<include name="lib/hibernate-entitymanager.jar"/>
<include name="lib/hibernate-validator.jar"/>
<include name="lib/jboss-common-core.jar"
/>]]></programlisting>
- </listitem>
- <listitem>
- <para> Third party dependencies.</para>
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ <listitem>
+ <para> Third party dependencies.</para>
+ <programlisting role="XML"><![CDATA[
<!-- 3rd party and supporting jars -->
<!--<include name="lib/log4j.jar" />-->
<include name="lib/javassist.jar"/>
@@ -1152,20 +1091,25 @@
<include name="lib/antlr.jar" />
<include name="lib/commons-logging.jar" />
<include name="lib/commons-collections.jar"
/>]]></programlisting>
- </listitem>
- <listitem>
- <para><literal>jboss-seam.jar</literal> - this is
needed in
- the <literal>ear</literal> base
- directory.</para>
- <programlisting role="XML"><![CDATA[
+ </listitem>
+ <listitem>
+ <para>
+ <literal>jboss-seam.jar</literal>
+ - this is needed in
+ the
+ <literal>ear</literal>
+ base
+ directory.
+ </para>
+ <programlisting role="XML"><![CDATA[
<!-- seam jar -->
<include name="lib/jboss-seam.jar" />]]></programlisting>
- </listitem>
- </itemizedlist>
+ </listitem>
+ </itemizedlist>
+
+ <para>You should end up with something like:</para>
+ <programlisting role="XML"><![CDATA[<fileset
dir="${basedir}">
- <para>You should end up with something like:</para>
- <programlisting role="XML"><![CDATA[<fileset
dir="${basedir}">
-
<include name="lib/jbpm*.jar" />
<include name="lib/jboss-el.jar" />
<include name="lib/drools-*.jar"/>
@@ -1196,41 +1140,56 @@
<!-- seam jar -->
<include name="lib/jboss-seam.jar" />
-</fileset>]]></programlisting>
-
- </listitem>
- </itemizedlist>
-
- </section>
- <section>
- <title> Building and deploying the seam-gen'd application to
Websphere
+</fileset>]]></programlisting>
+
+ </listitem>
+ </itemizedlist>
+
+ </section>
+ <section>
+ <title> Building and deploying the seam-gen'd application to
+ Websphere
</title>
-
- <itemizedlist>
- <listitem>
- <para> Build your application by calling
- <literal>ant</literal> in the base directory of your
- project (ex.
-
<literal>/home/jbalunas/workspace/websphere_example</literal>
- ). The target of the build will be
- <literal>dist/websphere_example.ear</literal> .
</para>
- </listitem>
-
- <listitem>
- <para>To deploy the application follow the instructions here :
- <xref linkend="jee5-websphere-deploy"/> but use
references to
- this project <literal>websphere_example</literal> instead
of
- <literal>jboss-seam-jee5</literal>.</para>
- </listitem>
- <listitem>
- <para> Checkout the app at:
-
<literal>http://localhost:9080/websphere_example/index.html</literal>
- </para>
- </listitem>
- </itemizedlist>
-
- </section>
- </section>
- </section>
-
+
+ <itemizedlist>
+ <listitem>
+ <para>
+ Build your application by calling
+ <literal>ant</literal>
+ in the base directory of your
+ project (ex.
+ <literal>/home/jbalunas/workspace/websphere_example
+ </literal>
+ ). The target of the build will be
+ <literal>dist/websphere_example.ear
+ </literal>
+ .
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ To deploy the application follow the instructions here :
+ <xref linkend="jee5-websphere-deploy" />
+ but use references to
+ this project
+ <literal>websphere_example</literal>
+ instead of
+ <literal>jboss-seam-jee5</literal>
+ .
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ Checkout the app at:
+ <literal>http://localhost:9080/websphere_example/index.html
+ </literal>
+ </para>
+ </listitem>
+ </itemizedlist>
+
+ </section>
+ </section>
+ </section>
+
</chapter>
Added: branches/community/Seam_2_2/examples/jee5/booking/build-websphere7.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/build-websphere7.xml
(rev 0)
+++ branches/community/Seam_2_2/examples/jee5/booking/build-websphere7.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+
+<project name="Booking WebSphere 7" default="clean.archive"
basedir=".">
+
+ <!-- Public targets -->
+ <target name="clean.archive" depends="clean,archive" />
+
+ <!-- Naming -->
+ <property name="Name" value="Java EE 5 Booking
Example"/>
+ <property name="example.name"
value="jboss-seam-jee5-booking"/>
+
+ <!-- Define topology -->
+ <property name="resources.dir"
value="resources-websphere7" />
+ <property name="dist.dir" value="dist-websphere7"
/>
+ <property name="exploded-archives.dir"
value="exploded-archives-websphere7" />
+
+ <!-- Libraries to include in ear -->
+ <property name="seam.ui.lib" value="true" />
+ <property name="seam.debug.lib" value="true" />
+ <property name="facelets.lib" value="true" />
+ <property name="richfaces.lib" value="true" />
+ <property name="el-ri.lib" value="true" />
+
+ <!-- Common build file -->
+ <import file="../../build.xml" />
+
+ <!-- Extras files for WebSphere -->
+
+ <fileset id="ear.lib.extras" dir="${seam.dir}">
+ <!-- Seam deps -->
+ <include name="lib/javassist.jar" />
+
+ <!-- Misc -->
+ <include name="lib/commons-beanutils.jar" />
+ <include name="lib/commons-digester.jar" />
+ <include name="lib/commons-collections.jar" />
+
+ <!-- Hibernate and deps -->
+ <include name="lib/hibernate-core.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/antlr.jar" />
+ <include name="lib/dom4j.jar" />
+
+ <include name="lib/slf4j-api.jar" />
+ <include name="lib/slf4j-log4j12.jar" />
+
+ <include name="lib/log4j.jar" />
+ </fileset>
+
+ <fileset id="jar.extras" dir="${resources.dir}/JAR">
+ <include name="**/*.*" />
+ </fileset>
+
+ <fileset id="war.extras" dir="${resources.dir}">
+ <include name="WEB-INF/classes/**/*" />
+ </fileset>
+
+</project>
+
Modified: branches/community/Seam_2_2/examples/jee5/booking/resources/WEB-INF/web.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources/WEB-INF/web.xml 2009-08-03
13:45:14 UTC (rev 11335)
+++ branches/community/Seam_2_2/examples/jee5/booking/resources/WEB-INF/web.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -55,6 +55,12 @@
<url-pattern>*.seam</url-pattern>
</servlet-mapping>
+ <!-- Welcome File -->
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
<!-- JEE5 EJB3 names -->
<ejb-local-ref>
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ejb-jar.xml
===================================================================
---
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ejb-jar.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ejb-jar.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar
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/ejb-jar_3_0.xsd"
+ version="3.0">
+
+ <interceptors>
+ <interceptor>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor>
+ </interceptors>
+
+ <assembly-descriptor>
+ <interceptor-binding>
+ <ejb-name>*</ejb-name>
+
<interceptor-class>org.jboss.seam.ejb.SeamInterceptor</interceptor-class>
+ </interceptor-binding>
+ </assembly-descriptor>
+
+</ejb-jar>
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-bnd.xml
===================================================================
---
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-bnd.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-bnd.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar-bnd
+
xmlns="http://websphere.ibm.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee
http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-bnd_1_0.xsd"
+ version="1.0">
+
+ <!--
+ This file is required for this sample because:
+ - by default WAS binds the EJB with the fully qualified name of the interface
+ - in component.xml. #{ejbname} resolves to the unqualified name of the
implementation class,
+ not the name of the fully qualified interface (use by WebSphere to bind its bean
by default)
+ - a (better?) alternative to this file is using the @JndiName seam annotation in
each bean
+
+ When using thsi file, set "jndi-pattern" to
"ejblocal:#{ejbName}" in components.xml
+ -->
+
+ <session name="AuthenticatorAction"
simple-binding-name="AuthenticatorAction" />
+ <session name="BookingListAction"
simple-binding-name="BookingListAction" />
+ <session name="ChangePasswordAction"
simple-binding-name="ChangePasswordAction" />
+ <session name="HotelBookingAction"
simple-binding-name="HotelBookingAction" />
+ <session name="HotelSearchingAction"
simple-binding-name="HotelSearchingAction" />
+ <session name="RegisterAction"
simple-binding-name="RegisterAction" />
+
+</ejb-jar-bnd>
\ No newline at end of file
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-ext.xml
===================================================================
---
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-ext.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/ibm-ejb-jar-ext.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ejb-jar-ext
+
xmlns="http://websphere.ibm.com/xml/ns/javaee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee
http://websphere.ibm.com/xml/ns/javaee/ibm-ejb-jar-ext_1_0.xsd"
+ version="1.0">
+
+ <!-- Set the expiration timeout to :
+ 10 minutes : HTTP Session timeout set in web.xml
+ +5 minutes : it takes some time for WebSphere to trigger the session expiration
+ = 900 seconds
+ -->
+
+ <session name="BookingListAction"><time-out
value="900"/></session>
+ <session name="ChangePasswordAction"><time-out
value="900"/></session>
+ <session name="HotelBookingAction"><time-out
value="900"/></session>
+ <session name="HotelSearchingAction"><time-out
value="900"/></session>
+ <session name="RegisterAction"><time-out
value="900"/></session>
+
+</ejb-jar-ext>
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/persistence.xml
===================================================================
---
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/persistence.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/META-INF/persistence.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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_1_0.xsd"
+ version="1.0">
+
+ <persistence-unit name="bookingDatabase">
+
+ <provider>org.hibernate.ejb.HibernatePersistence</provider>
+
+ <jta-data-source>DefaultDatasource</jta-data-source>
+
+ <properties>
+ <property name="hibernate.hbm2ddl.auto"
value="create-drop"/>
+ <property name="hibernate.show_sql" value="true"/>
+ <property name="hibernate.transaction.manager_lookup_class"
value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
+
+ <!-- Use the "Patched" Hibernate Derby dialect that override the
default id generator strategy -->
+ <property name="hibernate.dialect"
value="GlassfishDerbyDialect"/>
+ </properties>
+
+ </persistence-unit>
+
+</persistence>
\ No newline at end of file
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/import.sql
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/import.sql
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/import.sql 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,22 @@
+insert into Customer (username, password, name) values ('gavin',
'foobar', 'Gavin King')
+insert into Customer (username, password, name) values ('demo', 'demo',
'Demo User')
+insert into Hotel (price, name, address, city, state, zip, country) values (120,
'Marriott Courtyard', 'Tower Place, Buckhead', 'Atlanta',
'GA', '30305', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (180,
'Doubletree', 'Tower Place, Buckhead', 'Atlanta', 'GA',
'30305', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (450, 'W
Hotel', 'Union Square, Manhattan', 'NY', 'NY',
'10011', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (450, 'W
Hotel', 'Lexington Ave, Manhattan', 'NY', 'NY',
'10011', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (250,
'Hotel Rouge', '1315 16th Street NW', 'Washington', 'DC',
'20036', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (300, '70
Park Avenue Hotel', '70 Park Avenue', 'NY', 'NY',
'10011', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (300,
'Conrad Miami', '1395 Brickell Ave', 'Miami', 'FL',
'33131', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (80, 'Sea
Horse Inn', '2106 N Clairemont Ave', 'Eau Claire', 'WI',
'54703', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (90,
'Super 8 Eau Claire Campus Area', '1151 W Macarthur Ave', 'Eau
Claire', 'WI', '54701', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (160,
'Marriot Downtown', '55 Fourth Street', 'San Francisco',
'CA', '94103', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (200,
'Hilton Diagonal Mar', 'Passeig del Taulat 262-264', 'Barcelona',
'Catalunya', '08019', 'Spain')
+insert into Hotel (price, name, address, city, state, zip, country) values (210,
'Hilton Tel Aviv', 'Independence Park', 'Tel Aviv', '',
'63405', 'Israel')
+insert into Hotel (price, name, address, city, state, zip, country) values (240,
'InterContinental Tokyo Bay', 'Takeshiba Pier', 'Tokyo',
'', '105', 'Japan')
+insert into Hotel (price, name, address, city, state, zip, country) values (130,
'Hotel Beaulac', ' Esplanade L�opold-Robert 2', 'Neuchatel',
'', '2000', 'Switzerland')
+insert into Hotel (price, name, address, city, state, zip, country) values (140,
'Conrad Treasury Place', 'William & George Streets',
'Brisbane', 'QLD', '4001', 'Australia')
+insert into Hotel (price, name, address, city, state, zip, country) values (230,
'Ritz Carlton', '1228 Sherbrooke St', 'West Montreal',
'Quebec', 'H3G1H6', 'Canada')
+insert into Hotel (price, name, address, city, state, zip, country) values (460,
'Ritz Carlton', 'Peachtree Rd, Buckhead', 'Atlanta', 'GA',
'30326', 'USA')
+insert into Hotel (price, name, address, city, state, zip, country) values (220,
'Swissotel', '68 Market Street', 'Sydney', 'NSW',
'2000', 'Australia')
+insert into Hotel (price, name, address, city, state, zip, country) values (250,
'Meli� White House', 'Albany Street', 'Regents Park London',
'', 'NW13UP', 'Great Britain')
+insert into Hotel (price, name, address, city, state, zip, country) values (210,
'Hotel Allegro', '171 West Randolph Street', 'Chicago',
'IL', '60601', 'USA')
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/log4j.xml
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/log4j.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/log4j.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration
xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">
+
+ <appender name="CONSOLE"
class="org.apache.log4j.ConsoleAppender">
+ <param name="Target" value="System.out"/>
+
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d %-5p %X{username}
[%-29c{2}] - %m%n"/>
+ </layout>
+ </appender>
+
+<!--
+ <category name="org.hibernate">
+ <priority value="DEBUG"/>
+ </category>
+ <category name="org.jboss.seam">
+ <priority value="DEBUG"/>
+ </category>
+-->
+
+ <root>
+ <priority value="WARN"/>
+ <appender-ref ref="CONSOLE"/>
+ </root>
+
+</log4j:configuration>
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/JAR/seam.properties
===================================================================
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/application.xml
===================================================================
---
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/application.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/META-INF/application.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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_5.xsd"
+ version="5">
+
+ <display-name>Seam Booking</display-name>
+
+ <module>
+ <web>
+ <web-uri>jboss-seam-jee5-booking.war</web-uri>
+ <context-root>/seam-jee5-booking</context-root>
+ </web>
+ </module>
+ <module>
+ <ejb>jboss-seam-jee5-booking.jar</ejb>
+ </module>
+ <module>
+ <ejb>jboss-seam.jar</ejb>
+ </module>
+</application>
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/components.xml
===================================================================
---
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/components.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/components.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,24 @@
+<?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-2.2.xsd
+
http://jboss.com/products/seam/security
http://jboss.com/products/seam/security-2.2.xsd
+
http://jboss.com/products/seam/transaction
http://jboss.com/products/seam/transaction-2.2.xsd
+
http://jboss.com/products/seam/components
http://jboss.com/products/seam/components-2.2.xsd">
+
+ <!-- works thanks to the values set in the "ibm-ejb-bnd.xml" file AND
the ref set in "web.xml" -->
+ <core:init jndi-pattern="ejblocal:#{ejbName}" debug="true"
/>
+
+ <transaction:ejb-transaction/>
+
+ <core:manager conversation-timeout="120000"
+ concurrent-request-timeout="500"
+ conversation-id-parameter="cid"/>
+
+ <security:identity
authenticate-method="#{authenticator.authenticate}"/>
+
+</components>
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/faces-config.xml
===================================================================
---
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/faces-config.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/faces-config.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,11 @@
+<?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>
+ <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
+ </application>
+
+</faces-config>
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/pages.xml
===================================================================
---
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/pages.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/pages.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,123 @@
+<?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"
+
+ no-conversation-view-id="/main.xhtml"
+ login-view-id="/home.xhtml">
+
+ <page view-id="/register.xhtml">
+
+ <action if="#{validation.failed}"
+ execute="#{register.invalid}"/>
+
+ <navigation>
+ <rule if="#{register.registered}">
+ <redirect view-id="/home.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/home.xhtml"
action="#{identity.isLoggedIn}">
+
+ <navigation from-action="#{identity.isLoggedIn}">
+ <rule if-outcome="true">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ <navigation>
+ <rule if="#{identity.loggedIn}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/password.xhtml"
+ login-required="true">
+
+ <navigation>
+ <rule if="#{identity.loggedIn and changePassword.changed}">
+ <redirect view-id="/main.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/main.xhtml"
+ login-required="true">
+
+ <navigation from-action="#{hotelBooking.selectHotel(hot)}">
+ <redirect view-id="/hotel.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{bookingList.cancel}">
+ <redirect/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/hotel.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>View hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.bookHotel}">
+ <redirect view-id="/book.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="/book.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>Book hotel: #{hotel.name}</description>
+
+ <navigation from-action="#{hotelBooking.setBookingDetails}">
+ <rule if="#{hotelBooking.bookingValid}">
+ <redirect view-id="/confirm.xhtml"/>
+ </rule>
+ </navigation>
+
+ </page>
+
+ <page view-id="/confirm.xhtml"
+ conversation-required="true"
+ login-required="true">
+
+ <description>Confirm booking: #{booking.description}</description>
+
+ <navigation from-action="#{hotelBooking.confirm}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <page view-id="*">
+ <navigation from-action="#{identity.logout}">
+ <redirect view-id="/home.xhtml"/>
+ </navigation>
+
+ <navigation from-action="#{hotelBooking.cancel}">
+ <redirect view-id="/main.xhtml"/>
+ </navigation>
+
+ </page>
+
+ <exception class="org.jboss.seam.security.NotLoggedInException">
+ <redirect view-id="/home.xhtml">
+ <message severity="warn">You must be logged in to use this
feature</message>
+ </redirect>
+ </exception>
+
+ <exception class="javax.faces.application.ViewExpiredException">
+ <redirect view-id="/home.xhtml">
+ <message severity="warn">Session expired, please log in
again</message>
+ </redirect>
+ </exception>
+
+</pages>
Added:
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/web.xml
===================================================================
---
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/web.xml
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/resources-websphere7/WEB-INF/web.xml 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,79 @@
+<?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">
+
+ <!-- Seam -->
+
+ <listener>
+ <listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
+ </listener>
+
+ <filter>
+ <filter-name>Seam Filter</filter-name>
+ <filter-class>org.jboss.seam.servlet.SeamFilter</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>Seam Filter</filter-name>
+ <url-pattern>/*</url-pattern>
+ </filter-mapping>
+
+ <servlet>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+
<servlet-class>org.jboss.seam.servlet.SeamResourceServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>Seam Resource Servlet</servlet-name>
+ <url-pattern>/seam/resource/*</url-pattern>
+ </servlet-mapping>
+
+ <!-- JSF and Facelets -->
+
+ <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>
+
+ <!-- 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>
+
+ <!-- Welcome File -->
+
+ <welcome-file-list>
+ <welcome-file>index.html</welcome-file>
+ </welcome-file-list>
+
+ <!-- JEE5 EJB3 names -->
+
+ <ejb-local-ref>
+
+ <!-- This matches the pattern set in components.xml -->
+
+ <ejb-ref-name>ejblocal:EjbSynchronizations</ejb-ref-name>
+ <ejb-ref-type>Session</ejb-ref-type>
+ <local>org.jboss.seam.transaction.LocalEjbSynchronizations</local>
+ </ejb-local-ref>
+
+ <session-config>
+ <session-timeout>10</session-timeout>
+ </session-config>
+
+</web-app>
Added: branches/community/Seam_2_2/examples/jee5/booking/src/GlassfishDerbyDialect.java
===================================================================
--- branches/community/Seam_2_2/examples/jee5/booking/src/GlassfishDerbyDialect.java
(rev 0)
+++
branches/community/Seam_2_2/examples/jee5/booking/src/GlassfishDerbyDialect.java 2009-08-03
20:59:44 UTC (rev 11336)
@@ -0,0 +1,19 @@
+import org.hibernate.dialect.DerbyDialect;
+import org.hibernate.id.IdentityGenerator;
+
+
+public class GlassfishDerbyDialect extends DerbyDialect {
+
+ public GlassfishDerbyDialect() {
+
+ }
+
+ @Override
+ public Class getNativeIdentifierGeneratorClass() {
+
+ return IdentityGenerator.class;
+ }
+
+
+
+}
Modified: branches/community/Seam_2_2/examples/jee5/readme.txt
===================================================================
--- branches/community/Seam_2_2/examples/jee5/readme.txt 2009-08-03 13:45:14 UTC (rev
11335)
+++ branches/community/Seam_2_2/examples/jee5/readme.txt 2009-08-03 20:59:44 UTC (rev
11336)
@@ -137,9 +137,9 @@
-
http://seamframework.org/Documentation
-WebSphere 6.1.0.13 with EJB3 feature pack
----------------------------
-The instructions for integration with Websphere are fairly verbose. Please
+WebSphere 7
+-----------
+The instructions for integration with WebSphere are fairly verbose. Please
refer to the Seam reference guide for additional information.
-
http://seamframework.org/Documentation