User: alborini
  Date: 01/04/27 01:46:30

  Modified:    src/docs jbossdocs.xml
  Added:       src/docs howtopetstore.xml
  Log:
  Included petstore howto written by Tom Coleman.
  
  Revision  Changes    Path
  1.16      +2 -1      manual/src/docs/jbossdocs.xml
  
  Index: jbossdocs.xml
  ===================================================================
  RCS file: /cvsroot/jboss/manual/src/docs/jbossdocs.xml,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- jbossdocs.xml     2001/04/25 12:40:26     1.15
  +++ jbossdocs.xml     2001/04/27 08:46:30     1.16
  @@ -10,6 +10,7 @@
        <!ENTITY production.xml SYSTEM "production.xml">
        <!ENTITY howtotomcat.xml SYSTEM "howtotomcat.xml">
        <!ENTITY howtormhexamples.xml SYSTEM "howtormhexamples.xml">
  +     <!ENTITY howtopetstore.xml SYSTEM "howtopetstore.xml">
        <!ENTITY howtojmx.xml SYSTEM "howtojmx.xml">
        <!ENTITY howtotimer.xml SYSTEM "howtotimer.xml">
        <!ENTITY howtoj2eedeployer.xml SYSTEM "howtoj2eedeployer.xml">
  @@ -71,6 +72,6 @@
   &howto_socketfactories.xml;
   &howtojaxp.xml;
   &howtoverifier.xml;
  -
  +&howtopetstore.xml;
   </chapter>
   </book>
  
  
  
  1.1                  manual/src/docs/howtopetstore.xml
  
  Index: howtopetstore.xml
  ===================================================================
  <?xml version = "1.0" encoding = "UTF-8"?>
  <section id="howtopetstore">
        <title>Deploying the Pet Store 1.1.1 Demo in JBoss</title>
        <para>Author:<author>
                        <firstname>Tom</firstname>
                        <surname>Coleman</surname>
                </author>
                <email>[EMAIL PROTECTED]</email>  
        </para>
  
        <section>
                <title>Introduction</title>
                <para>The Pet Store sample application (demo) is a relatively robust, 
well-documented demonstration of J2EE technology and concepts. It implements MVC 
(Model-View-Controller) architecture.</para>
                <para>The Pet Store demo can allow developers to gain familiarity with 
J2EE concepts including application portability, a key J2EE design objective.</para>
                <para>The Pet Store has been successfully deployed in JBoss PRE 2.1 
configured to use Embedded Tomcat and Tomcat 3.2.1/Apache using Sun 1.3 jdk on Linux. 
The steps provided below apply to JBoss PRE 2.1 since 21st January 2001.</para>
        </section>
        <section>
                <title>Outstanding Deployment Issues</title>
                <para>Please post your experiences with deploying the Pet Store in 
JBoss to the jboss-user mailing list.</para>
                <section>
                        <title>The security adapter</title>
                        <para>The Pet Store implements non-portable security code that 
works only with the J2EE RI (Reference Implementation) server. </para>
                        <para>The non-portable code is contained in the 
J2eeSecurityAdapter class. The JBoss Pet Store patch replaces this class with a 
JBossSecurityAdapter class that implements the SecurityAdapter interface.</para>
                        <para>The steps below change the value for 
securityAdapterClassName in the Pet Store application to use JBossSecurityAdapter. 
</para>
                        <para>See the /docs/security.html page in the Pet Store demo 
for more information. </para>
                </section>
                <section>
                        <title>Adding new users</title>
                        <para>In order to add new users, you have to configure Tomcat 
to use a JDBCRealm. See below for details.</para>
                </section>
                <section>
                        <title>The Admin Client</title>
                        <para>We still need JBoss specific Deployment descriptors for 
the Admin client application. Please post them to the mailing list if you have 
them.</para>
                </section>
        </section>
        <section>
                <title>Original contributers</title>
                <itemizedlist>
                        <listitem><para>Mike Lueders, Richard Gyger - Focus 
Technologies</para></listitem>
                        <listitem><para>Scott Stark</para></listitem>
                        <listitem><para>Anatoly Ackerman</para></listitem>
                        <listitem><para>Tom Coleman</para></listitem>
                        <listitem><para>Aaron Mulder</para></listitem>
                </itemizedlist>
        </section>
        <section>
                <title>Installation &amp; Configuration</title>
                <orderedlist>
                        <listitem>
                                <para>Download the Pet Store</para>
                                <para>You can get the source from <ulink 
url="http://java.sun.com/j2ee/download.html#blueprints";>Sun's J2EE Download 
Page</ulink>. It's in the "J2EE Blueprints" package. Download the 1.1.1 version. 
Unpack it anywhere. The root directory of the Pet Store demo is referred to below as 
$PETSTORE. </para>
                        </listitem>
                        <listitem>
                                <para>Download the JBoss Pet Store patch file</para>
                                <para>Running the Pet Store demo in JBoss requires 
several minor changes to deployment files in the Pet Store application (.ear) file. 
The patch is currently available in the file section of the manual, it is named 
petstore-1.1.1-patch.zip.</para>
                                <para>Copy the patch file to a temporary directory and 
unzip it. The patch contains a zip file that patches the Pet Store demo. </para>
                        </listitem>
                        <listitem>
                                <para>Configure JBoss to use Embedded Tomcat</para>
                                <para>You need a servlet container to run the 
petstore. These instructions use Tomcat 3.2.1. You can either use a bundled binary 
JBoss + Tomcat, or see the instructions to configure JBoss to use Embedded Tomcat in 
<xref linkend="howtotomcat"/>.</para>
                        </listitem>
                        <listitem>
                                <para>Select a Database</para>
                                <para>The Pet Store demo uses the Cloudscape database 
by default.</para>
                                <para>The Pet Store demo theoretically should work 
with just about any JDBC compliant database. However, to avoid problems with SQL 
syntax doing a Product Search, use Cloudscape if at all possible.</para>
                        </listitem>
                        <listitem>
                                <para>Rebuild the Pet Store application 
(petstore.ear)</para>
                                <para>The following step overwrites several files in 
the Pet Store application sources. You may want to make a separate copy of the JBoss 
version of the Pet Store.</para>
                                <para>This step adds the file jboss-web.xml to the 
WEB-INF directory in petstore.war, modifies the serverType in the web.xml file of that 
directory to identify the JBoss server to the application, and modifies the 
application.xml file in the META-INF directory of petstore.ear.</para>
                                <itemizedlist>
                                        <listitem>
                                                <para>Copy the petstore-jboss-mods.zip 
file to the root directory ($PETSTORE) of your Pet Store distribution. Change to this 
directory and unzip the file. </para>
                                                <para>Note: This will overwrite the 
original web.xml file. </para>
                                                <para><programlisting>cd $PETSTORE
  unzip petstore-jboss-mods.zip
  </programlisting></para>
                                        </listitem>
                                        <listitem>
                                                <para>Rebuild the Pet Store 
application. </para>
                                                <para>Run build.sh or build.bat in the 
$PETSTORE/src/petstore/src/build directory. </para>
                                                <para>The result is a new petstore.ear 
in the $PETSTORE/src/petstore/build directory. </para>
                                                <para>This is the file you deploy by 
copying it to $JBOSS_HOME/deploy</para>
                                        </listitem>
                                </itemizedlist>
                        </listitem>
                        <listitem>
                                <para>Add DB Pools to JBoss</para>
                                <para>The JBoss Petstore patch file includes the file 
jboss.jcml. This file defines Pet Store DB Pools for Cloudscape using port 1098. 
</para>
                                <para>Cloudscape uses port 1099 by default. JBoss uses 
port 1099 for JNDI.</para>
                                <para>If you will be using a different database, you 
will need to define DB pools appropriate for your database. See <xref linkend="jdbc"/> 
for details</para>
                        </listitem>
                        <listitem>
                                <para>Prepare the Database</para>
                                <para>Modify the Cloudscape startup command to use 
port 1098.</para>
                                <para>You do this by adding -port port_number. For 
example:</para>
                                <programlisting>java ... RmiJdbc.RJJdbcServer -port 
1098 COM.cloudscape.core.JDBCDriver</programlisting>
                                <para>Whichever product you're using, create a 
database or instance or schema (the terminology varies) and then run the appropriate 
script to populate it.</para>
                                <para>Start Cloudscape.</para>
                        </listitem>
                        <listitem>
                                <para>Add JARS to JBoss</para>
                                <para>Copy your DB driver JAR to the lib/extdirectory 
of your JBoss installation ($JBOSS_HOME). </para>
                                <para>Copy tools.jar from the J2 SDK to the lib/ext 
directory of your JBoss installation ($JBOSS_HOME).</para>
                                <para>For Cloudscape, copy cloudscape.jar and 
RmiJdbc.jar to the lib/ext directory. </para>
                        </listitem>
                        <listitem>
                                <para>Add Tomcat JDBCRealm</para>
                                <para>Find the following code in the Tomcat server.xml 
file and comment it out.</para>
                                <programlisting><![CDATA[<RequestInterceptor 
    className="org.apache.tomcat.request.SimpleRealm"
    debug="0" />
  ]]></programlisting>
                                <para>Add the following code just below the code you 
commented out.</para>
                                <programlisting><![CDATA[<RequestInterceptor 
    className="org.apache.tomcat.request.JDBCRealm"
    debug="99"
    driverName="COM.cloudscape.coreRmiJdbcDriver"
    connectionURL="jdbc:rmi://localhost:1098/jdbc:cloudscape:CloudscapeDB"
    userTable="users"
    userNameCol="user_name"
    userCredCol="user_pass"
    userRoleTable="user_roles"
    roleNameCol="role_name"
    connectionName="estoreuser"
    connectionPassword="estore" />
  ]]></programlisting>
                                <para>Make sure the JbossRealm interceptor follows the 
JDBCRealm definition. </para>
                                <programlisting><![CDATA[<RequestInterceptor 
    className="org.jboss.tomcat.security.JbossRealm" />
  ]]></programlisting>
                                <para>Change to the $PETSTORE directory and run the 
dbrealm script to set up the default Pet Store user. </para>
                        </listitem>
                        <listitem>
                                <para>Modify the Tomcat Users file</para>
                                <para>The patch contains a tomcat-users.xml file that 
adds the default Pet Store user. You can copy this file to your $TOMCAT_HOME/conf 
directory, or add the following line to your existing tomcat-users.xml file. </para>
                                <para>You don't need to do this if you configure a 
JDBCRealm as described above. </para>
  <programlisting><![CDATA[<user name = "j2ee"  password = "j2ee"  roles = "customer" 
/>
  ]]></programlisting>
                        </listitem>
                        <listitem>
                                <para>Start JBoss</para>
                                <para>Start JBoss and copy the new petstore.ear to the 
deploy directory. You should see JBoss deploy the Pet Store EJBs.</para>
                        </listitem>
                        <listitem>
                                <para>Run the Pet Store</para>
                                <para>Point your browser to 
http://your-server-name.your-domain:8080/estore to start the Pet Store. </para>
                        </listitem>
                </orderedlist>
        </section>
  </section>
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to