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

📄 jaxr5.html

📁 j2eePDF格式的电子书
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp150882"> </a><div class="pSmartList2"><li>Click Add.</li></div><a name="wp150883"> </a><div class="pSmartList2"><li>In the Coded Name field, type <code class="cCode">eis/JAXR</code>.</li></div><a name="wp150884"> </a><div class="pSmartList2"><li>From the Type menu, choose <code class="cCode">javax.xml.registry.ConnectionFactory</code>.</li></div><a name="wp150885"> </a><div class="pSmartList2"><li>In the Deployment Settings area, type <code class="cCode">eis/JAXR</code> in the JNDI name field and <code class="cCode">j2ee</code> in both the User Name and Password fields.</li></div></ol></div></ol></div><a name="wp151031"> </a><h4 class="pHeading3">Packaging the Application Client</h4><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp151032"> </a><div class="pSmartList1"><li>Choose File<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>New<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Application Client to start the Application Client Wizard, then click Next.</li></div><a name="wp151033"> </a><div class="pSmartList1"><li>In the JAR File Contents screen:</li></div><div class="pSmartList2"><ol type="a" class="pSmartList2"><a name="wp151034"> </a><div class="pSmartList2"><li>Make sure that Create New AppClient Module in Application is selected and that the application is <code class="cCode">ClientSessionApp</code>.</li></div><a name="wp151035"> </a><div class="pSmartList2"><li>In the AppClient Name field, type <code class="cCode">MyAppClient</code>.</li></div><a name="wp151036"> </a><div class="pSmartList2"><li>Click the Edit button next to the Contents text area. </li></div><a name="wp151037"> </a><div class="pSmartList2"><li>In the dialog box, locate the <code class="cCode">clientsession/build</code> directory. Select <code class="cCode">MyAppClient.class</code> from the Available Files tree area and click Add, then OK.</li></div></ol></div><a name="wp151038"> </a><div class="pSmartList1"><li>In the General screen, select <code class="cCode">MyAppClient</code> in the Main Class combo box.</li></div></ol></div><a name="wp151039"> </a><p class="pBody">After you finish the wizard, click the EJB Refs tab, then click Add in the inspector pane. In the dialog box:</p><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp151040"> </a><div class="pSmartList1"><li>Type <code class="cCode">ejb/remote/PubQuery</code> in the Coded Name field.</li></div><a name="wp151041"> </a><div class="pSmartList1"><li>Choose Session from the EJB Type menu.</li></div><a name="wp151042"> </a><div class="pSmartList1"><li>Choose Remote from the Interfaces menu.</li></div><a name="wp151043"> </a><div class="pSmartList1"><li>Type <code class="cCode">PubQueryHome</code> in the Home Interface field.</li></div><a name="wp151044"> </a><div class="pSmartList1"><li>Type <code class="cCode">PubQueryRemote</code> in the Local/Remote Interface field.</li></div></ol></div><a name="wp150887"> </a><p class="pBody">When you return to the EJB Refs inspector pane, select the bean. In the Sun-specific Settings area, select JNDI Name and type <code class="cCode">PubQuery</code> in the field. The session bean uses remote interfaces, so the client accesses the bean through the JNDI name rather than the bean name.</p><a name="wp151053"> </a><h4 class="pHeading3">Checking the JNDI Names</h4><a name="wp150888"> </a><p class="pBody">Verify that the JNDI names for the application components are correct. They should appear as shown in <a  href="JAXR5.html#wp150898">Table 10-3</a> and <a  href="JAXR5.html#wp150918">Table 10-4</a>.</p><div align="left"><table border="1" summary="Application Pane for ClientSessionApp" id="wp150898">  <caption><a name="wp150898"> </a><div class="pTableTitle">Table 10-3   Application Pane for ClientSessionApp</div></caption>  <tr align="center">    <th><a name="wp150904"> </a><div class="pCellHeading">Component Type</div></th>    <th><a name="wp150906"> </a><div class="pCellHeading">Component</div></th>    <th><a name="wp150908"> </a><div class="pCellHeading">JNDI Name</div></th></tr>  <tr align="left">    <td><a name="wp150910"> </a><div class="pCellBody">EJB</div></td>    <td><a name="wp150912"> </a><div class="pCellBody">PubQuery</div></td>    <td><a name="wp150914"> </a><div class="pCellBody">PubQuery</div></td></tr></table></div><p class="pBody"></p><div align="left"><table border="1" summary="References Pane for ClientSessionApp" id="wp150918">  <caption><a name="wp150918"> </a><div class="pTableTitle">Table 10-4   References Pane for ClientSessionApp</div></caption>  <tr align="center">    <th><a name="wp150926"> </a><div class="pCellHeading">Ref. Type</div></th>    <th><a name="wp150928"> </a><div class="pCellHeading">Referenced By</div></th>    <th><a name="wp150930"> </a><div class="pCellHeading">Reference Name</div></th>    <th><a name="wp150932"> </a><div class="pCellHeading">JNDI Name</div></th></tr>  <tr align="left">    <td><a name="wp150934"> </a><div class="pCellBody">EJB Ref</div></td>    <td><a name="wp150936"> </a><div class="pCellBody">MyAppClient</div></td>    <td><a name="wp150938"> </a><div class="pCellBody">ejb/remote/PubQuery</div></td>    <td><a name="wp150940"> </a><div class="pCellBody">PubQuery</div></td></tr>  <tr align="left">    <td><a name="wp150942"> </a><div class="pCellBody">Resource</div></td>    <td><a name="wp150944"> </a><div class="pCellBody">PubQuery</div></td>    <td><a name="wp150946"> </a><div class="pCellBody">eis/JAXR</div></td>    <td><a name="wp150948"> </a><div class="pCellBody">eis/JAXR</div></td></tr></table></div><p class="pBody"></p><a name="wp150950"> </a><h3 class="pHeading2">Deploying the Application</h3><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp150951"> </a><div class="pSmartList1"><li>Save the application.</li></div><a name="wp150952"> </a><div class="pSmartList1"><li>Choose Tools<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Deploy.</li></div><a name="wp150958"> </a><div class="pSmartList1"><li>In the dialog box, type your administrative user name and password (if they are not already filled in) and click OK.</li></div><a name="wp153477"> </a><div class="pSmartList1"><li>In the Application Client Stub Directory area, select the Return Client Jar checkbox.</li></div><a name="wp153482"> </a><div class="pSmartList1"><li>Click OK.</li></div><a name="wp150959"> </a><div class="pSmartList1"><li>In the Distribute Module dialog box, click Close when the process completes. You will find a file named <code class="cCode">ClientSessionAppClient.jar</code> in the specified directory.</li></div></ol></div><a name="wp150961"> </a><h3 class="pHeading2">Running the Application Client</h3><div class="pSmartList1"><ol type="1" class="pSmartList1"><a name="wp150962"> </a><div class="pSmartList1"><li>If you are using the Java WSDP Registry Server, start it by starting Tomcat. </li></div><a name="wp150963"> </a><p class="pBodyRelative">Windows systems: Choose Start<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Programs<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Java(TM) Web Services Developer Pack 1.3<span style="font-family: Symbol"><img src="images/arrwrite.gif" border="0" alt="Right Arrow"></span>Start Tomcat.</p><a name="wp150964"> </a><p class="pBodyRelative">UNIX systems:</p><a name="wp150965"> </a><p class="pBodyRelative"><code class="cCode">&lt;</code><code class="cVariable">JWSDP_HOME</code><code class="cCode">&gt;/bin/startup.sh</code></p><a name="wp150966"> </a><p class="pBodyRelative">Starting Tomcat takes some time.</p><a name="wp150970"> </a><div class="pSmartList1"><li>To run the client, use the following command:</li></div><a name="wp150971"> </a><p class="pBodyRelative"><code class="cCode">appclient -client ClientSessionAppClient.jar</code></p></ol></div><a name="wp150972"> </a><p class="pBody">The program output in the terminal window looks like this:</p><div class="pPreformattedRelative"><pre class="pPreformattedRelative">Looking up EJB referenceLooked up homeNarrowed homeGot the EJBSee server log for bean output<a name="wp150973"> </a></pre></div><a name="wp150974"> </a><p class="pBody">In the server log, you will find the output from the <code class="cCode">executePublish</code> and <code class="cCode">executeQuery</code> methods.</p>    </blockquote>   <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider">    <table width="550" summary="layout" id="SummaryNotReq1">      <tr>	<td align="left" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/download.html#tutorial" target="_blank">Download</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/faq.html" target="_blank">FAQ</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/history.html" target="_blank">History</a>	</td>        <td align="center" valign="center"><a accesskey="p" href="JAXR4.html"><img id="LongDescNotReq1" src="images/PrevArrow.gif" width="26" height="26" border="0" alt="Prev" /></a><a accesskey="c" href="J2EETutorialFront.html"><img id="LongDescNotReq1" src="images/UpArrow.gif" width="26" height="26" border="0" alt="Home" /></a><a accesskey="n" href="JAXR6.html"><img id="LongDescNotReq3" src="images/NextArrow.gif" width="26" height="26" border="0" alt="Next" /></a><a accesskey="i" href="J2EETutorialIX.html"></a>        </td>	<td align="right" valign="center">	<font size="-1">	<a href="http://java.sun.com/j2ee/1.4/docs/api/index.html" target="_blank">API</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/search.html" target="_blank">Search</a>	<br>	<a href="http://java.sun.com/j2ee/1.4/docs/tutorial/information/sendusmail.html" target="_blank">Feedback</a></font>	</font>	</td>      </tr>    </table>    <img src="images/blueline.gif" width="550" height="8" ALIGN="BOTTOM" NATURALSIZEFLAG="3" ALT="Divider"><p><font size="-1">All of the material in <em>The J2EE(TM) 1.4 Tutorial</em> is <a href="J2EETutorialFront2.html">copyright</a>-protected and may not be published in other workswithout express written permission from Sun Microsystems.</font>  </body></html>

⌨️ 快捷键说明

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