EJB Development Quickstart with MyEclipse---9
天下维客,你可以修改的网络知识库
Deploying an EJB Project
The Enterprise Archive (EAR) is the only required deployment model specified by the J2EE specification. Yet, the specification makes provision for application server specific deployment models. Application servers such as JBoss and Weblogic support direct deployment of EJB Jar archives. A restriction of direct EJB Jar deployment is there is no provision for deployment of optional packages required by an EJB jar archive. See Section 8.2 of the J2EE 1.4 specification for optional package deployment details.
This section presents abbreviated instructions for deploying the firstejb project to a local JBoss 3.2 instance as a single EJB Jar archive.
1. Configure a JBoss 3.2 application server from the MyEclipse Application Server preference pages
- From the MyEclipse menubar open JBoss server configuration preferences; select
Window > Preferences > MyEclipse > Application Servers > JBoss 3.
- Select the Enable radio button
- Select Browse... for the JBoss root installation directory
- Select the JBoss3 JDK preference page and select a full JDK, not just a JRE. Note: You may have to add a new JDK if only a JRE is listed.
2. Deploy the firstejb project to the JBoss 3 server
- From the MyEclipse toolbar select the deploy icon,
or right-click firstejb project and select MyEclipse >Add and Remove Project Deployments... This will open the Deployment dialog.
- Select firstejb in Project field. Select Add... and select the configured JBoss 3 server.
- Choose either Packaged or Exploded deployment; JBoss supports both deployment modes.
3.Launch JBoss Application Server
- From the MyEclipse toolbar select the application server management icon,
and expand the menu to JBoss3 > Start action
4.Monitor the JBoss stdout and stderr messages presented in Console view.
- Inspect the message log for an that EJB was successfully deployed as shown in Figure 18.
Figure 20. Console output of JBoss showing the EJB was successfully deployed
Testing an EJB
Standalone EJB testing requires a distributed test client. Creation of a test client for the Trader EJB is a non-trivial effort that is beyond the scope of this document. For efficiency purposes we have elected to defer this topic to the MyEclipse Enterprise Application Quickstart. That document describes the process for creating an Enterprise application composed of the Trader EJB and a simple web client that are packaged and deployed as a single unit. The web client serves as a test client.



