blob: 7a2686cc9484af6fc3823123b66489bae9a4fef3 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<!-- /*******************************************************************************
* Copyright (c) 2000, 2005 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/ -->
<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
<title>Creating EJB projects</title>
</head>
<body id="tecrtpro"><a name="tecrtpro"><!-- --></a>
<h1 class="topictitle1">Creating EJB projects</h1>
<div><p>An EJB project is used to organize the resources contained in an
EJB module.</p>
<div class="section"><p>An EJB module is used to assemble one or more enterprise beans
into a single deployable unit. It is deployed in a standard Java� archive
(JAR) file. An EJB module can be used as a standalone application, or it can
be combined with other modules to create a J2EE enterprise application. An
EJB module is installed and run in an enterprise bean container. An EJB project
must be referenced by an enterprise application project (defined as a module
in an EAR) in order to be deployed successfully and run on a server.</p>
<p>An
EJB module contains the following:</p>
<ul><li>One or more deployable enterprise beans.</li>
<li>A deployment descriptor, stored in an Extensible Markup Language (XML)
file. This file declares the contents of the module, defines the structure
and external dependencies of the beans in the module, and describes how the
enterprise beans are to be used at run time.</li>
</ul>
<p>To create a new EJB project:</p>
</div>
<ol><li class="stepexpand"><span>In the J2EE perspective, select <span class="menucascade"><span class="uicontrol">File</span> &gt; <span class="uicontrol">New</span> &gt; <span class="uicontrol">Other</span> &gt; <span class="uicontrol">EJB</span> &gt; <span class="uicontrol">EJB Project</span></span>. The New EJB Project wizard
opens.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Name</span> field, type a name for the EJB
project. To change the default <span class="uicontrol">Project location</span>, click
the <span class="uicontrol">Browse</span> button to select a new location.</span> <p>If
you specify a non-default project location that is already being used by another
project, the project creation will fail.</p>
</li>
<li class="stepexpand"><span>Click <span class="uicontrol">Show Advanced</span>.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">Target runtime</span> drop-down list, select
the application server that you want to target for your development. This
selection affects the compilation and runtime settings by modifying the class
path entries for the project.</span></li>
<li class="stepexpand"><span>In the <span class="uicontrol">EJB version</span> drop-down list, select
the EJB specification version to which you want your EJB project to adhere.</span> <div class="note"><span class="notetitle">Note: </span>If you plan on using EJB 2.1 enterprise beans, you must specify
an EJB 2.1 project. You can add EJB 1.1 enterprise beans to EJB 2.x projects.
An EJB 2.1 project must exist in a J2EE 1.4 enterprise application project.
An EJB 2.0 project requires a minimum level of J2EE 1.3 for its enterprise
application project.</div>
</li>
<li class="stepexpand"><strong>Optional: </strong><span>Select the <span class="uicontrol">Add module to an EAR
application</span> check box to add the new module to an enterprise application
(EAR) project.</span> Type a new project name or select an existing enterprise
application project from the drop-down list in the <span class="uicontrol">EAR application</span> combination
box. Or, click the <span class="uicontrol">New</span> button to launch the New Enterprise
Application Project wizard.<div class="note"><span class="notetitle">Note:</span> If you type a new EAR project name, the EAR
project will be created in the default location with the lowest compatible
J2EE version based on the version of the project being created. If you want
to specify a different version or a different location for the enterprise
application, you must use the New Enterprise Application Project wizard.</div>
</li>
<li class="stepexpand"><strong>Optional: </strong><span>Select the <span class="uicontrol">Create an EJB Client
JAR Project to hold the client interfaces and classes</span> check box
if you want the client interface classes for your enterprise beans to be kept
in a separate EJB client JAR file. This EJB client JAR file will be added
to the enterprise application as a project utility JAR file. </span></li>
<li class="stepexpand"><strong>Optional: </strong><span>Select the <span class="uicontrol">Add support for annotated
Java classes</span> check box if you want the generated classes to use
XDoclet annotations.</span></li>
<li class="stepexpand"><strong>Optional: </strong><span>Select the <span class="uicontrol">Support Multiple Modules
per project</span> check box to enable the selected project to contain
multiple modules of the same type. Select the project which will
support multiple modules from the drop-down list.</span></li>
<li class="stepexpand"><strong>Optional: </strong><span>If you are creating an EJB Client JAR project, click <span class="uicontrol">Next</span> to
specify the client JAR project options. Otherwise, click <span class="uicontrol">Finish</span>.</span></li>
</ol>
</div>
<p>
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.
</p>
</body>
</html>