⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch14s02.html

📁 详细介绍了jboss3.0的配置等
💻 HTML
字号:
<html><head>
      <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
   <title>Deploying the Pet Store 1.1.2 Demo in JBoss</title><link rel="stylesheet" href="styles.css" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/styles.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets Vimages/callouts/"><link rel="home" href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html" title="JBoss 3.0 Documentation"><link rel="up" href="ch14.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch14.html" title="Chapter 14. Third Party Examples"><link rel="previous" href="ch14.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch14.html" title="Chapter 14. Third Party Examples"><link rel="next" href="ch14s07.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch14s07.html" title="Deploying Cocoon 2 in JBoss"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="jboss.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/jboss.gif" border="0"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch14.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch14.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch14.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch14.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch14s07.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch14s07.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table><div class="section"><a name="howtopetstore"></a><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="howtopetstore"></a>Deploying the Pet Store 1.1.2 Demo in JBoss</h2></div></div><p>Author:<span class="author">Tom Coleman</span>
		<tt>&lt;<a href="mailto:tcoleman@autowares.com">tcoleman@autowares.com</a>&gt;</tt>  
	</p><div class="section"><a name="d0e12219"></a><div class="titlepage"><div><h3 class="title"><a name="d0e12219"></a>Introduction</h3></div></div><p>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.</p><p>The Pet Store demo can allow developers to gain familiarity with J2EE concepts including application portability, a key J2EE design objective.</p><p>The Pet Store has been most recently deployed using the JBoss-Jetty package, <a href="javascript:if(confirm('http://www.jboss.org/binary.jsp  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://www.jboss.org/binary.jsp'" tppabs="http://www.jboss.org/binary.jsp" target="_top">JBoss-2.4.0_Jetty-3.1.RC8-1</a>. If you use the JBoss-Jetty package, you will have to add Pet Store DB Pools to the jboss.jcml file in the jboss/conf/jetty directory.</p><p>The Pet Store had previously been deployed using a JBoss 2.4 BETA configured to use Embedded Tomcat 3.2.2. The specific release used was JBoss 2.4 BETA Rel_2_4_0_23.</p><p>Both deployments were on a RH Linux 6.2 system using the Sun 1.3 jdk.</p></div><div class="section"><a name="d0e12235"></a><div class="titlepage"><div><h3 class="title"><a name="d0e12235"></a>Outstanding Deployment Issues</h3></div></div><p>Please post your experiences with deploying the Pet Store in JBoss to the jboss-user mailing list.</p><p><b>Initializing the Database.&nbsp;</b>The Pet Store application should automatically build required database tables the first time the Pet Store application is started.  The latest database schema is slightly different from the earlier release, so you may encounter problems if you have an existing Pet Store database from a previous installation.  When tring to determine the initial status of the database, this conflict may cause one of the drop commands to fail, and the application will not create the required tables.  If this is the case, you may need to manually drop all existing tables before deploying the Pet Store for the first time.  It may help to turn off your browser cache while building the tables.</p><p><b>The Admin Client.&nbsp;</b>We need JBoss deployment descriptors for the Admin application.  If you have successfully deployed the Admin application using JBoss, please post them to one of the Forums or to the jboss-user mailing list.</p><p><b>Pet Store Security.&nbsp;</b>The current release of the Pet Store handles security at the application level.  It does require that you configure JBoss or Tomcat security services.</p></div><div class="section"><a name="d0e12255"></a><div class="titlepage"><div><h3 class="title"><a name="d0e12255"></a>Contributors:</h3></div></div><div class="itemizedlist"><ul><li><p><a name="d0e12259"></a>Mike Lueders, Richard Gyger - Focus Technologies</p></li><li><p><a name="d0e12262"></a>Scott Stark</p></li><li><p><a name="d0e12265"></a>Anatoly Ackerman</p></li><li><p><a name="d0e12268"></a>Tom Coleman</p></li><li><p><a name="d0e12271"></a>Aaron Mulder</p></li><li><p><a name="d0e12274"></a>Cuong Tran</p></li><li><p><a name="d0e12277"></a>Joseph King</p></li><li><p><a name="d0e12280"></a>Jim Utter</p></li></ul></div></div><div class="section"><a name="d0e12283"></a><div class="titlepage"><div><h3 class="title"><a name="d0e12283"></a>Installation &amp; Configuration</h3></div></div><div class="orderedlist"><ol type="1"><li><p><a name="d0e12287"></a>Download the Pet Store</p><p>You can get the source from <a href="javascript:if(confirm('http://java.sun.com/j2ee/download.html  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?'))window.location='http://java.sun.com/j2ee/download.html#blueprints'" tppabs="http://java.sun.com/j2ee/download.html#blueprints" target="_top">Sun's J2EE Download Page</a>. It's in the "J2EE Blueprints" package. Download the 1.1.2 version. Unpack it anywhere. The root directory of the Pet Store demo is referred to below as $PETSTORE. </p></li><li><p><a name="d0e12295"></a>Download the JBoss Pet Store patch file</p><p>Running the Pet Store demo in JBoss requires several minor changes to deployment files in the Pet Store application (.ear) file. The current patch file, <a href="javascript:if(confirm('http://www.jboss.org/doco_files/jps112-01.zip  \n\nThis file was not retrieved by Teleport Pro, because it did not meet the project\'s file type specifications.  \n\nDo you want to open it from the server?'))window.location='http://www.jboss.org/doco_files/jps112-01.zip'" tppabs="http://www.jboss.org/doco_files/jps112-01.zip" target="_top">jps112-01.zip</a> is currently available in the documentation files section of the manual.</p></li><li><p><a name="d0e12303"></a>Configure JBoss</p><p>You need a servlet container to run the Java Pet Store. If you're using the JBoss-Jetty or JBoss-Tomcat releases, the server is preconfigured.</p></li><li><p><a name="d0e12308"></a>Select a Database</p><p>The Pet Store demo uses the Cloudscape database by default.</p><p>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><li><p><a name="d0e12315"></a>Rebuild the Pet Store application (petstore.ear)</p><p>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.</p><p>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.</p><div class="itemizedlist"><ul><li><p><a name="d0e12323"></a>Copy the jps112-01.zip file to the root directory ($PETSTORE) of your Pet Store distribution. Change to this directory and unzip the file. </p><p>Note: This will overwrite the original web.xml file. </p><p><pre class="programlisting">cd $PETSTORE
unzip jps1.1.2-01.zip
</pre></p></li><li><p><a name="d0e12331"></a>Rebuild the Pet Store application. </p><p>Run build.sh or build.bat in the $PETSTORE/src/petstore/src/build directory. </p><p>The result is a new petstore.ear in the $PETSTORE/src/petstore/build directory. </p><p>This is the file you deploy by copying it to $JBOSS_HOME/deploy</p></li></ul></div></li><li><p><a name="d0e12340"></a>Add DB Pools to JBoss</p><p>The JBoss Pet Store patch file includes the file jboss.jcml. This file defines Pet Store DB Pools for JBoss 2.4 using Cloudscape on port 1098.</p><p>Cloudscape uses port 1099 by default. JBoss uses port 1099 for JNDI.</p><p>If you will be using a different database, you will need to define the appropriate DB pools for your database. See <a href="ch03.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch03.html" title="Chapter 3. Using Databases and other Enterprise Resources">Chapter 3</a> for details</p></li><li><p><a name="d0e12351"></a>Prepare the Database</p><p>Modify the Cloudscape startup command to use port 1098.</p><p>You do this by adding -port port_number. For example:</p><pre class="programlisting">java ... RmiJdbc.RJJdbcServer -port 1098 COM.cloudscape.core.JDBCDriver</pre><p>Start Cloudscape.</p></li><li><p><a name="d0e12362"></a>Add JARS to JBoss</p><p>Copy your DB driver JAR to the lib/ext directory of your JBoss installation ($JBOSS_HOME). </p><p>For Cloudscape, copy client.jar and RmiJdbc.jar to the lib/ext directory. </p><p>Copy tools.jar from the J2 SDK to the lib/ext directory of your JBoss installation ($JBOSS_HOME).</p></li><li><p><a name="d0e12371"></a>Start JBoss</p><p>Start JBoss and copy the new petstore.ear to the deploy directory. You should see JBoss deploy the Pet Store EJBs.</p></li><li><p><a name="d0e12376"></a>Run the Pet Store</p><p>Point your browser to http://your-server-name.your-domain:8080/estore to start the Pet Store. </p></li></ol></div></div></div><table border="0" cellpadding="0" cellspacing="0" height="65"><tr height="65"><td rowspan="2"><img src="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="432" height="79"></td><td rowspan="2" background="gbar.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/gbar.gif" width="100%" align="right" valign="top"><a href="index.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/index.html"><img src="doc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/doc.gif" border="0"></a><a href="ch14.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch14.html"><img src="toc.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/toc.gif" border="0"></a><a href="ch14.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch14.html"><img src="prev.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/prev.gif" border="0"></a><a href="ch14s07.html" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/ch14s07.html"><img src="next.gif" tppabs="http://www.huihoo.org/jboss/online_manual/3.0/next.gif" border="0"></a></td></tr><tr></tr></table></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -