blob: 4ca42e685b0379fd040da8c555606e55e0a12835 [file] [log] [blame]
<html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>OpenEJB Deploy Tool</title><link href="default.css" rel="stylesheet"><link href="/images/favicon.ico" rel="SHORTCUT ICON"></head><body marginwidth="0" marginheight="0" leftmargin="0" bottommargin="0" topmargin="0" vlink="#6763a9" link="#6763a9" bgcolor="#ffffff"><a name="top"></a><table height="400" width="712" cellspacing="0" cellpadding="0" border="0"><tr><td bgcolor="#7270c2" align="left" valign="top" width="20"><img border="0" height="1" width="1" src="images/dotTrans.gif"></td><td bgcolor="#7270c2" align="left" valign="top" width="95"><img border="0" height="1" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" width="7"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td><td align="left" valign="top" width="40"><img border="0" height="6" width="40" src="images/dotTrans.gif"></td><td bgcolor="#5A5CB8" align="left" valign="top" width="430"><img border="0" height="6" width="430" src="images/top_2.gif"></td><td bgcolor="#E24717" align="left" valign="top" width="120"><img src="images/top_3.gif" width="120" height="6" border="0"></td></tr><tr><td align="left" valign="top" bgcolor="#7270c2" width="20"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#7270c2" width="95"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#ffffff" width="7"></td><td align="left" valign="top" width="40"><img border="0" height="1" width="1" src="images/dotTrans.gif"></td><td align="left" valign="middle" width="430"><a href="faq.html"><span class="menuTopOff">[ f a q ]</span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://wiki.codehaus.org/openejb"><span class="menuTopOff">[ w i k i ]</span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://archive.openejb.codehaus.org/user/"><span class="menuTopOff">[ l i s t s ]</span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://cvs.openejb.org/"><span class="menuTopOff">[ c v s ]</span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://jira.codehaus.org/secure/BrowseProject.jspa?id=10401"><span class="menuTopOff">[ b u g s ]</span></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br><img border="0" height="2" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" height="20" width="120">&nbsp;</td></tr><tr><td align="left" valign="top" bgcolor="#7270c2" width="20"><img border="0" height="3" width="20" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#7270c2" width="95"><img border="0" height="3" width="105" src="images/line_sm.gif"></td><td align="left" valign="top" bgcolor="#a9a5de" width="7"><img border="0" height="3" width="7" src="images/line_sm.gif"></td><td align="left" valign="top" width="40"><img border="0" height="3" width="40" src="images/line_light.gif"></td><td align="left" valign="top" width="430"><img border="0" height="3" width="430" src="images/line_light.gif"></td><td align="left" valign="top" width="120"><img height="1" width="1" border="0" src="images/dotTrans.gif"></td></tr><tr><td align="left" valign="top" bgcolor="#7270c2"><img border="0" height="10" width="20" src="images/dotTrans.gif"></td><td align="left" valign="top" bgcolor="#7270c2" width="95"><img border="0" height="2" width="1" src="images/dotTrans.gif"><br><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Main</span></td></tr><tr><td align="left" valign="top"><a href="index.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Welcome!</span></a></td></tr><tr><td align="left" valign="top"><a href="download.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Download</span></a></td></tr><tr><td align="left" valign="top"><a href="lists.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Mailing Lists</span></a></td></tr><tr><td align="left" valign="top"><a href="cvs.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Source Code</span></a></td></tr><tr><td align="left" valign="top"><a href="contributors.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
The Team</span></a></td></tr><tr><td align="left" valign="top"><a href="status.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Status</span></a></td></tr></table><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Users</span></td></tr><tr><td align="left" valign="top"><a href="quickstart.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Quickstart</span></a></td></tr><tr><td align="left" valign="top"><a href="hello-world.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Hello World!</span></a></td></tr><tr><td align="left" valign="top"><a href="cmp_entity_postgresql.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
CMP Example</span></a></td></tr><tr><td align="left" valign="top"><a href="cmp_guide.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
CMP Guide</span></a></td></tr><tr><td align="left" valign="top"><a href="deploy.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Deploy</span></a></td></tr><tr><td align="left" valign="top"><a href="start-command.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Startup</span></a></td></tr><tr><td align="left" valign="top"><a href="validate.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Validation</span></a></td></tr><tr><td align="left" valign="top"><a href="config_containers.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Configuration</span></a></td></tr><tr><td align="left" valign="top"><a href="properties.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Properties</span></a></td></tr></table><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Servers</span></td></tr><tr><td align="left" valign="top"><a href="embedded.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Local Server</span></a></td></tr><tr><td align="left" valign="top"><a href="remote-server.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Remote Server</span></a></td></tr><tr><td align="left" valign="top"><a href="tomcat.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Tomcat</span></a></td></tr><tr><td align="left" valign="top"><a href="geronimo.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Geronimo</span></a></td></tr></table><table cellspacing="0" cellpadding="0" border="0"><tr><td align="left" valign="top"><span class="subMenuOn">Integrators</span></td></tr><tr><td align="left" valign="top"><a href="whyopenejb.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Why OpenEJB</span></a></td></tr><tr><td align="left" valign="top"><a href="containersystem.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Overview</span></a></td></tr><tr><td align="left" valign="top"><a href="design_openejb.html"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Design</span></a></td></tr><tr><td align="left" valign="top"><a href="OpenEJB_presentaion.ppt"><span class="subMenuOff">&nbsp;&nbsp;&nbsp;
Presentation</span></a></td></tr></table><img border="0" height="15" width="1" src="images/dotTrans.gif"><br><img border="0" height="3" width="105" src="images/line_sm.gif"><br><A href="http://codehaus.org"><IMG alt="The Codehaus" border="0" height="17" width="88" src="http://www.openejb.org/codehaus-smaller.png"></A></td><td align="left" valign="top" bgcolor="#a9a5de" width="7">&nbsp;</td><td align="left" valign="top" width="40">&nbsp;</td><td valign="top" width="430" rowspan="4"><table width="430" cellspacing="0" cellpadding="0" border="0" rows="2" cols="1"><tr><td align="left" valign="top"><br><img width="200" vspace="0" src="./images/logo_ejb2.gif" hspace="0" height="55" border="0"><br><img src="images/dotTrans.gif" hspace="0" height="7" border="0"><br><span class="pageTitle">OpenEJB Deploy Tool</span><br><img src="images/dotTrans.gif" hspace="0" height="1" border="0"></td></tr></table><p></p><br><a name="name"><h2>NAME</h2></a>
<p><span class="bodyBlack">
openejb deploy - OpenEJB Deploy Tool
</span></p>
<a name="synopsis"><h2>SYNOPSIS</h2></a>
<p><span class="bodyBlack">
openejb deploy [options] jarfiles
</span></p>
<a name="note"><h2>NOTE</h2></a>
<p><span class="bodyBlack">
The OpenEJB Deploy tool is an OPTIONAL tool that creates the <b>openejb-jar.xml</b> file
required for your bean to be loaded into the container system at startup. If you want to create
or maintain that openejb-jar.xml file yourself, you don't need the Deploy tool at all. For more
information, see the <a href="faq_openejb-jar.html">openejb-jar.xml FAQ</a>
</span></p>
<p><span class="bodyBlack">
The OpenEJB Deploy tool must be executed from the OPENEJB_HOME directory. This is the
directory where OpenEJB was installed or unpacked. For for the remainder of this document
we will assume you unpacked OpenEJB into the directory C:\openejb.
</span></p>
<p><span class="bodyBlack">
In Windows, the deploy tool can be executed as follows:
</span></p>
<p><span class="bodyBlack">
<span class="command">C:\openejb&gt; openejb deploy -help</span>
</span></p>
<p><span class="bodyBlack">
In UNIX, Linux, or Mac OS X, the deploy tool can be executed as follows:
</span></p>
<p><span class="bodyBlack">
<span class="command">[user@host openejb]# ./openejb.sh deploy -help</span>
</span></p>
<p><span class="bodyBlack">
Depending on your OpenEJB version, you may need to change execution bits to
make the scripts executable. You can do this with the following command.
</span></p>
<p><span class="bodyBlack">
<span class="command">[user@host openejb]# chmod 755 openejb.sh bin/*.sh</span>
</span></p>
<p><span class="bodyBlack">
From here on out, it will be assumed that you know how to execute the right openejb script
for your operating system and commands will appear in shorthand as show below.
</span></p>
<p><span class="bodyBlack">
<span class="command">openejb deploy -help</span>
</span></p>
<a name="description"><h2>DESCRIPTION</h2></a>
<p><span class="bodyBlack">
The OpenEJB Deploy Tool is responsible for linking or "hooking up" your beans to the
container system. It is run as a separate command line tool using the data in your
OpenEJB configuration file (C:\openejb\conf\openejb.conf). The next time the system is
started, all the deplpoyed beans will be loaded.
</span></p>
<p><span class="bodyBlack">
In the OpenEJB configuration file (C:\openejb\conf\openejb.conf), there are a number
of containers and resources defined. Each of these has a unique name and will
be loaded at start up with that name. In order for your beans to be loaded into the
container system, they must also be named. This name is called a
<a href="deploymentids.html">Deployment ID</a> and must be completely unique in comparison
to all other beans across all jars loaded into the container system.
</span></p>
<p><span class="bodyBlack">
Furthermore, the system must also know which which container
to put a given bean into. During deployment, the bean's Deployment ID must be mapped
to a Container ID.
</span></p>
<p><span class="bodyBlack">
If the beans has any references to database or other resources using the &lt;resource-ref&gt;
tag in the jar's META-INF/ejb-jar.xml, those references must be resolved and linked to
a resource declared in the openejb.conf.
</span></p>
<p><span class="bodyBlack">
All this information is collected by the OpenEJB Deploy Tool. Using the Deploy Tool
will cause a new file to be added to your jar, META-INF/openejb-jar.xml. Jars
in the deployments path containing a META-INF/openejb-jar.xml file will be loaded
when the system starts up and will be usable at runtime. Any jar containing an invalid
openejb-jar.xml, or conntaining no openejb-jar.xml at all, will simply be overlooked by the
container system.
</span></p>
<p><span class="bodyBlack">
To effectively "undeploy" a jar, you simply need to remove the META-INF/openejb-jar.xml file
from the jar then restart the container system/server. If you wish to temporarily remove
the jar from the container system, you can just rename the jar with a new extention, ".skip"
for example, then restart the container system/server.
</span></p>
<p><span class="bodyBlack">
The files passed to the Deploy Tool must be valid ejb 1.1 jar files and contain
the META_INF/ejb-jar.xml inside the jar. This is case sensitive, so meta-inf/Ejb-Jar.xml
is not the same as META_INF/ejb-jar.xml.
</span></p>
<p><span class="bodyBlack">
Do NOT edit the openejb-jar.xml file unless you
know exactly what you are doing.
</span></p>
<a name="options"><h2>OPTIONS</h2></a>
<p><span class="bodyBlack">
<table width="440" cellspacing="0" cellpadding="6" border="0">
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-m</span></td><td valign="top">&nbsp;</td><td valign="top"><span class="option">
Move the jar to the OPENEJB_HOME/beans directory. Will not overwrite the
jar if there is an existing jar with the same name in the
OPENEJB_HOME/beans directory. Add the -f option to force the overwrite.
</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-c</span></td><td valign="top">&nbsp;</td><td valign="top"><span class="option">
Copy the jar to the OPENEJB_HOME/beans directory. Will
not overwrite the jar if there is an existing jar with
the same name in the OPENEJB_HOME/beans directory. Add
the -f option to force the overwrite.
</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-f</span></td><td valign="top">&nbsp;</td><td valign="top"><span class="option">
Forces a move or a copy, overwriting any previously
existing jar with the same name.
</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-a</span></td><td valign="top">&nbsp;</td><td valign="top"><span class="option">Automate deployment as much as possible. Applies all automation related flags.</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-C</span></td><td valign="top">&nbsp;</td><td valign="top"><span class="option">Automatically assigns each bean in the jar to the first container of the appropriate bean type.</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-D</span></td><td valign="top">&nbsp;</td><td valign="top"><span class="option">Automatically assigns the OpenEJB
<a href="deploymentids.html">Deployment ID</a>
for each bean by using the &lt;ejb-name&gt; in your
ejb-jar.xml. The deployment ID uniquely identifies
the bean in the OpenEJB container system and is used
by most servers as the client-side JNDI name. No
two beans can share the same deployment ID.</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-d</span></td><td valign="top"><span class="option-param">dir</span></td><td valign="top"><span class="option">Sets the OPENEJB_HOME to the specified directory.</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-l</span></td><td valign="top"><span class="option-param">file</span></td><td valign="top"><span class="option">Sets the log4j configuration to the specified file.</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-conf</span></td><td valign="top"><span class="option-param">file</span></td><td valign="top"><span class="option">Sets the OpenEJB configuration to the specified file.</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-version</span></td><td valign="top">&nbsp;</td><td valign="top"><span class="option">Print the version.</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-help</span></td><td valign="top">&nbsp;</td><td valign="top"><span class="option">Print this help message.</span></td></tr>
<tr><td width="10">&nbsp;</td><td valign="top"><span class="option-flag">-examples</span></td><td valign="top">&nbsp;</td><td valign="top"><span class="option">Show examples of how to use the options.</span></td></tr>
</table>
</span></p>
<a name="examples"><h2>EXAMPLES</h2></a>
<a name="using.multiple.jar.files"><h3>Deploying multiple jar files</h3></a>
<p><span class="bodyBlack">
<span class="command">openejb deploy myapp\fooEjbs.jar myapp\barEjbs.jar</span>
</span></p>
<p><span class="bodyBlack">
Deploys the beans in the fooEjbs.jar first, then deploys the
beans in the barEjbs.jar. Wildcards can be used as well.
</span></p>
<p><span class="bodyBlack">
<span class="command">openejb deploy myapp\*.jar</span>
</span></p>
<a name="using.-m "><h3>Using -m </h3></a>
<p><span class="bodyBlack">
<span class="command">openejb deploy -m myapp\myEjbs.jar</span>
</span></p>
<p><span class="bodyBlack">
Deploys the beans in the jar, moving the entire jar from
myapp\myEjbs.jar to OPENEJB_HOME\beans\myEjbs.jar.
</span></p>
<p><span class="bodyBlack">
If the jar OPENEJB_HOME\beans\myEjbs.jar already existed, it will
not be overwritten. Supply the -f to force an overwrite.
</span></p>
<p><span class="bodyBlack">
<span class="command">openejb deploy -m -f myapp\myEjbs.jar</span>
</span></p>
<a name="using.-c"><h3>Using -c</h3></a>
<p><span class="bodyBlack">
<span class="command">openejb deploy -c myapp\myEjbs.jar</span>
</span></p>
<p><span class="bodyBlack">
Same as using -m, except the jar is copied not moved. The -f also
can be used with a -c to force an overwrite if the file is already
present.
</span></p>
<a name="using.-C"><h3>Using -C</h3></a>
<p><span class="bodyBlack">
<span class="command">openejb deploy -C myapp\myEjbs.jar</span>
</span></p>
<p><span class="bodyBlack">
Deploys the beans in the jar, does not prompt you to assign each
bean to a container. Instead, each bean will automatically be
assigned to the first container of the appropriate type.
</span></p>
<a name="using.-D"><h3>Using -D</h3></a>
<p><span class="bodyBlack">
<span class="command">openejb deploy -D myapp\myEjbs.jar</span>
</span></p>
<p><span class="bodyBlack">
Deploys the beans in the jar, does not prompt you to assign each
bean a <a href="deploymentids.html">Deployment ID</a>. Instead,
the deployment ID for each bean
will automatically be assigned using the &lt;ejb-name&gt; of the bean
as it is in the META-INF/ejb-jar.xml of the jar file.
</span></p>
<p><span class="bodyBlack">
The deployment ID uniquely identifies the bean in the OpenEJB
container system. No two beans can share the same deployment ID.
</span></p>
<p><span class="bodyBlack">
The deployment ID is also used by most servers as the client-side
JNDI name for doing JNDI lookups.
</span></p>
<a name="using.-a"><h3>Using -a</h3></a>
<p><span class="bodyBlack">
<span class="command">openejb deploy -a myapp\myEjbs.jar</span>
</span></p>
<p><span class="bodyBlack">
Applies all automation related flags. Currently equivalent to:
</span></p>
<p><span class="bodyBlack">
<span class="command">openejb deploy -C -D myapp\myEjbs.jar</span>
</span></p>
<p><span class="bodyBlack">
As more automation options are added, they will also be applied
when using the -a option.
</span></p>
<a name="using.-d"><h3>Using -d dir</h3></a>
<p><span class="bodyBlack">
<span class="command">openejb deploy -d C:\openejb myapp\myEjbs.jar</span>
</span></p>
<p><span class="bodyBlack">
Sets the OPENEJB_HOME to the C:\openejb directory. This will
cause the deploy tool to treat the C:\openejb as the directory
where OpenEJB was installed.
</span></p>
<a name="using.-conf"><h3>Using -conf file</h3></a>
<p><span class="bodyBlack">
<span class="command">openejb deploy -conf C:\openejb\conf\mytest.conf myapp\myEjbs.jar</span>
</span></p>
<p><span class="bodyBlack">
Sets the openejb.configuration system variable to the file
C:\openejb\conf\mytest.conf. When the beans are deployed the
beans will be to be mapped to the containers and resources in the
configuration file C:\openejb\conf\mytest.conf. If the deploy
tool needs update the configuration, the mytest.conf file will be
modified.
</span></p>
<a name="using.combinations"><h3>Using combinations of options </h3></a>
<p><span class="bodyBlack">
<span class="command">openejb deploy -c -a C:\foo\bar.jar D:\my\beans\*.jar</span>
</span></p>
<p><span class="bodyBlack">
<span class="command">openejb deploy -c -C /foo/bar.jar</span>
</span></p>
<p><span class="bodyBlack">
<span class="command">openejb deploy -m -a /home/dblevins/mybeans/*.jar</span>
</span></p>
<p><span class="bodyBlack">
<span class="command">openejb deploy -D -m /home/dblevins/mybeans/*.jar</span>
</span></p>
<p><span class="bodyBlack">
<span class="command">openejb deploy -a /openejb/beans/*.jar</span>
</span></p>
<p><span class="bodyBlack">
<span class="command">openejb deploy -a C:\openejb\beans\*.jar</span>
</span></p>
</td><td align="left" valign="top" height="5" width="120">
&nbsp;
</td></tr><tr height="5"><td align="left" valign="top" bgcolor="#7270c2" height="5" width="20">&nbsp;</td><td valign="top" bgcolor="#7270c2" height="5" width="95">&nbsp;</td><td align="left" valign="top" bgcolor="#a9a5de" height="5" width="7">&nbsp;</td><td align="left" valign="top" height="5" width="40">&nbsp;</td><td align="left" valign="top" height="5" width="120">&nbsp;</td></tr><tr><td align="left" valign="top" bgcolor="#7270c2" height="5" width="20">&nbsp;</td><td align="left" valign="top" bgcolor="#7270c2" width="95">&nbsp;</td><td align="left" valign="top" bgcolor="#a9a5de" width="7"><img border="0" height="25" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" width="40"><img border="0" height="25" width="1" src="images/dotTrans.gif"></td><td align="left" valign="top" width="120">&nbsp;</td></tr><tr height="5"><td align="left" valign="bottom" bgcolor="#7270c2" height="100%" rowspan="2" width="20"><img border="0" height="125" width="20" src="images/stripes1.gif"></td><td align="left" valign="bottom" bgcolor="#7270c2" height="100%" rowspan="2" width="95"><img border="0" height="125" width="105" src="images/stripe105.gif"></td><td align="left" valign="top" bgcolor="#a9a5de" height="100%" rowspan="2" width="7">&nbsp;</td><td align="left" valign="top" height="100%" width="40">&nbsp;</td><td align="left" valign="top" height="100%" width="120">&nbsp;</td></tr><tr height="5"><td align="left" valign="top" height="25" width="40">&nbsp;</td><td align="left" valign="bottom" height="25" width="430"><br><br><img height="3" width="430" border="0" src="images/line_light.gif"><br><p></p><span class="bodyGrey"><small><notice>
OpenEJB is a trademark of the OpenEJB Group.
Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered
trademarks of Sun Microsystems, Inc. in the United States and in other
countries. XML, XML Schema, XSLT and related standards are trademarks or registered
trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web
Consortium. All other product names mentioned herein are trademarks of their respective
owners.
</notice><br>&nbsp;<br></small></span><p></p>
&nbsp;
</td><td align="left" valign="top" height="25" width="120">&nbsp;</td></tr></table></body></html>