User: tcoleman
Date: 01/03/04 20:25:56
Modified: documentation petstore-1.1.1-01.html
Log:
Add Cloudscape JDBCRealm
Revision Changes Path
1.6 +48 -11 newsite/documentation/petstore-1.1.1-01.html
Index: petstore-1.1.1-01.html
===================================================================
RCS file: /products/cvs/ejboss/newsite/documentation/petstore-1.1.1-01.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- petstore-1.1.1-01.html 2001/03/02 22:30:58 1.5
+++ petstore-1.1.1-01.html 2001/03/05 04:25:56 1.6
@@ -23,25 +23,27 @@
<li>
<h3><a NAME="petstore0">The Security Adapter</a></h3>
<p>The Pet Store implements non-portable security code that works only with
-the J2EE RI (Reference Implementation) server. The non-portable code is
-contained in the <code>J2eeSecurityAdapter</code> class. You need to replace
-this class with a JBoss security module that implements the
+the J2EE RI (Reference Implementation) server.
+<p>The non-portable code is contained in the <code>J2eeSecurityAdapter</code>
class. The JBoss Pet Store patch replaces this class with a
+<code>JBossSecurityAdapter</code> class that implements the
<code>SecurityAdapter</code> interface.
<p>
The steps below change the value for <code>securityAdapterClassName</code> in
-the Pet Store <code>web.xml</code> file to use <code>JBossSecurityAdapter</code>.
+the Pet Store application to use <code>JBossSecurityAdapter</code>.
<p>
-See the <code>/docs/security.html</code> page in the Pet Store demo for details.
+See the <code>/docs/security.html</code> page in the Pet Store demo for more
information.
<p>
<li>
<h3><a NAME="petstore00">Adding New Users</a></h3>
-<p>The JBossSecurityAdapter needs to be modified in order to add new users.
+<p>In order to add new users, you have to configure Tomcat to use a JDBCRealm.
+See Step #9 below for details.
</ol>
<h2>Original contributors</h2>
Mike Leuders, Richard Gyger - Focus Technologies
<br>Scott Stark
<br>Anatoly Ackerman
+<br>Tom Coleman
<br>Aaron Mulder
<h2>Doc writer</h2>
@@ -83,7 +85,7 @@
<h3><a NAME="petstore4">Select a Database</a></h3>
<p>The Pet Store demo uses the <b>Cloudscape</b> database by default.
<p>
-The Pet Store demo theoretically should work with just about any JDBC compliant
database. However, to avoid problems with SQL syntax, use Cloudscape if at all
possible.
+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.
<p>
<li>
@@ -154,22 +156,57 @@
<p>
<li>
-<h3><a NAME="petstore9a">Modify the Tomcat Users file</a></h3>
+<h3><a NAME="petstore9">Add Tomcat JDBCRealm</a></h3>
+<p>Find the following code in the Tomcat <code>server.xml</code> file and
+comment it out.
+<pre>
+ <RequestInterceptor
+ className="org.apache.tomcat.request.SimpleRealm"
+ debug="0" />
+</pre>
+Add the following code just below the code you commented out.
+<pre>
+ <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" />
+</pre>
+Make sure the JbossRealm interceptor follows the JDBCRealm definition.
+<pre>
+ <RequestInterceptor
+ className="org.jboss.tomcat.security.JbossRealm" />
+</pre>
+Change to the $PETSTORE directory and run the <code>dbrealm</code> script
+to set up the default Pet Store user.
+</p>
+
+<p>
+<li>
+<h3><a NAME="petstore10">Modify the Tomcat Users file</a></h3>
<p>The patch contains a tomcat-users.xml file that adds the default Pet Store user.
You can copy this file to your <code>$TOMCAT_HOME/conf</code> directory, or
-add the following line to your existing tomcat-users.xml file.
+add the following line to your existing tomcat-users.xml file.
+<p>You don't need to do this if you configure a JDBCRealm as described above.
<pre>
<user name = "j2ee" password = "j2ee" roles = "customer" />
</pre>
<li>
-<h3><a NAME="petstore9">Start JBoss</a></h3>
+<h3><a NAME="petstore11">Start JBoss</a></h3>
<p>Start JBoss and copy the new <code>petstore.ear</code> to the
<code>deploy</code> directory. You should see JBoss deploy the Pet Store
EJBs.</p>
<p>
<li>
-<h3><a NAME="petstore10">Run the Pet Store</a></h3>
+<h3><a NAME="petstore12">Run the Pet Store</a></h3>
<p>Point your browser to http://<your-server-name.your-domain>:8080/estore to
start the Pet Store.
</ol>