From seam-commits at lists.jboss.org Thu Aug 20 20:42:12 2009 Content-Type: multipart/mixed; boundary="===============7776788925851772908==" MIME-Version: 1.0 From: seam-commits at lists.jboss.org To: seam-commits at lists.jboss.org Subject: [seam-commits] Seam SVN: r11413 - branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US. Date: Thu, 20 Aug 2009 20:42:12 -0400 Message-ID: <200908210042.n7L0gCi4011206@svn01.web.mwc.hst.phx2.redhat.com> --===============7776788925851772908== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: denis.forveille Date: 2009-08-20 20:42:11 -0400 (Thu, 20 Aug 2009) New Revision: 11413 Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xml Log: JBSEAM-4324 Removed unusable section on seam-gen for WAS Modified: branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websph= ere.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xm= l 2009-08-21 00:18:43 UTC (rev 11412) +++ branches/community/Seam_2_2/doc/Seam_Reference_Guide/en-US/Websphere.xm= l 2009-08-21 00:42:11 UTC (rev 11413) @@ -605,591 +605,4 @@ = - -
- Deploying an application created using <literal>seam-gen</lit= eral> on WebSphere V7 - - - seam-gen - 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 - seam-gen - 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. - - -
- Running <literal>seam-gen</literal> Setup - - The first step is setting up - seam-gen - 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. - - - - - - - Type - ./seam new-project - to create your - project and - cd - /home/jbalunas/workspace/websphere_example - to the - newly created structure. - - -
-
- Changes needed for deployment to Websphere - We now need to make some changes to the generated project. - -
- Configuration file changes - - - - resources/META-INF/persistence-dev.xml - - - - - - - Alter the - jta-data-source - to be - DefaultDatasource - . We are - going to be using the integrated Websphere - DB. - - - - - Add or change the properties below. - These are described in detail at - - : - - - - - - - -]]> - - - Remove the JBoss AS specific method of exposing - the EntityManagerFactory: - - ]]> - - - - You'll need to alter - persistence-prod.xml - as - well if you want to deploy to Websphere using the - prod profile. - - - - - - - - src/GlassfishDerbyDialect.java - - - - - As with other examples we need to include this java class for - DB support. It can be copied from the - jpa - example into the - websphere_example/src - directory. - - - - - - - - resources/META-INF/jboss-app.xml - - - - - You can delete this file as we aren't deploying to JBoss - AS ( - jboss-app.xml - is used to enable - classloading isolation in JBoss AS) - - - - - - resources/*-ds.xml - - - 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) - - - - - resources/WEB-INF/components.xml - - - - - - - Enable container managed transaction - integration - add the - - <transaction:ejb-transaction /> - component, and it's namespace - declaration - - xmlns:transaction=3D"http://jboss.com/products/seam/transaction" - - - - - - Alter the - jndi-pattern - to - - java:comp/env/websphere_example/#{ejbName} - - - - - - We do not need - managed-persistence-context - - for this example and so can delete its - entry. - - - - ]]> - - - - - - - resources/WEB-INF/web.xml - - - - - As with the - jee5/booking - example we need to add EJB references to the web.xml. These - references require replacing /local string in - ejb-ref-name - to flag them for - Websphere to perform the proper binding. - - - - - websphere_example/AuthenticatorAction - Session - org.jboss.seam.tutorial.websphere.action.Authenticator - = - = - - websphere_example/EjbSynchronizations = - Session - org.jboss.seam.transaction.LocalEjbSynchronizations - ]]> - - - -
-
- - Creating the - <literal>AuthenticatorAction</literal> - EJB - - - We want to take the existing - Authenticator - Seam POJO component and create an EJB3 out of it. - - - - Change the generated Authenticator class - - - - Rename the class to - AuthenticatorAction - - - - - Add the - @Stateless - annotation to the new - AuthenticatorAction - class. - - - - - Create an interface called - Authenticator - which - AuthenticatorAction - implements (EJB3 requires session beans to have a - local interface). Annotate the interface with - @Local - , and add a single method - with same signature as the - authenticate - in - AuthenticatorAction - . - - - - - - - - - - - - - We've already added its reference to the - web.xml - file so are good to go. - - - -
-
- - Extra jar dependencies and other changes to the - <literal>build.xml</literal> - - - This application has similar requirements as the - jee5/booking - example. - - - - - - Change the default target to - archive - (we aren't going to cover - automatic deployment to Websphere). - - - - ]]><= /programlisting> - - - - - Websphere looks for the drools - /security.drl - file in the root of the - war - file instead of the root of the - websphere_example.jar - so we need - to have the - build.xml - move it to the - correct location at build time. The following must be added at - the top of the - <target name=3D"war" - depends=3D"compile" description=3D"Build the distribution - .war file"> - target. - - - - - - -]]> - - - - Now we need to get extra jars into the - build.xml - . Look for the - <fileset dir=3D"${basedir}"> - section - of the task below. Add the new includes at the bottom of - the fileset. - - - - - - - - - - - - - - - - - - - - - - - - - - - - -]]> - - - Hibernate dependencies - - - - - - - ]]> - - - Third party dependencies. - - - - - - - - - - ]]> - - - - jboss-seam.jar - - this is needed in - the - ear - base - directory. - - - ]]> - - - - You should end up with something like: - - = - - - - - - - - - = - - - - - - - - - - - - - - - - - - = - - - = -]]> - - - - -
-
- Building and deploying the seam-gen'd application to - Websphere - - - - - - Build your application by calling - ant - in the base directory of your - project (ex. - /home/jbalunas/workspace/websphere_example - - ). The target of the build will be - dist/websphere_example.ear - - . - - - - - - To deploy the application follow the instructions here : - - but use references to - this project - websphere_example - instead of - jboss-seam-jee5 - . - - - - - Checkout the app at: - http://localhost:9080/websphere_example/index.html - - - - - -
-
-
- --===============7776788925851772908==--