blob: aab6687c8f3fb417baac7a4bf7ece36426ab9834 [file]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<!-- $PAGETITLE -->
<TITLE>OpenEJB - Deployments</TITLE>
<LINK href="http://openejb.apache.org/all.css" rel="stylesheet" type="text/css">
<!--[if IE]><link rel="stylesheet" type="text/css" media="screen, projection" href="openejb.apache.org/ie.css"><![endif]-->
<LINK rel="SHORTCUT ICON" href="http://openejb.apache.org/images/favicon.ico">
<META http-equiv="Content-Type" content="text/html;charset=UTF-8">
</HEAD>
<BODY>
<!-- Delay the loading of the external javascript file needed for labels (as it takes too long to load and visibly holds loading of the page body) -->
<!-- To do this without javascript errors over undefined functions, we need to declare stubs here (that are overrided later by the proper implementations) -->
<SCRIPT language="JavaScript" type="text/javascript">
function doAddLabel(hideTextfieldAfterAddParam)
{
// stub
}
function onAddLabel()
{
// stub
}
function showLabelsInput()
{
// stub
}
</SCRIPT>
<A name="top"></A>
<TABLE class="frameTable" cellpadding="0" cellspacing="0" border="0">
<TR class="Row1">
<TD class="Col1"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col2"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col3"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
</TR>
<TR class="Row2">
<TD class="Col1"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col2">&nbsp;</TD>
<TD class="Col3" id="breadcrumbs">
<!-- $TOP_NAV_BAR -->
<A href="../OPENEJB/index.html" title="Index">Home</A> | <A href="../OPENEJB/download.html" title="Download">Download</A> | <A href="../OPENEJB/mailing-lists.html" title="Mailing Lists">Lists</A> | <A href="http://issues.apache.org/jira/browse/OPENEJB" class="external-link" rel="nofollow">Issues</A>
</TD>
<TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5">&nbsp;</TD>
</TR>
<TR class="Row3">
<TD class="Col1"><IMG alt="" class="Row3Img" id="thinLine" src="http://openejb.apache.org/images/line_sm.gif"></TD>
<TD class="Col2"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col3"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col4"><IMG alt="" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5"><IMG alt="" class="Row3Img" src="http://openejb.apache.org/images/dotTrans.gif"></TD>
</TR>
<TR class="Row4">
<TD class="Col1">
<SPAN id="Navigation">
<H3><A name="Navigation-Overview"></A>Overview</H3>
<UL class="alternate" type="square">
<LI><A href="../OPENEJB/index.html" title="Index">Home</A></LI>
<LI><A href="../OPENEJB/news.html" title="News">News</A></LI>
<LI><A href="../OPENEJB/faq.html" title="FAQ">FAQ</A></LI>
<LI><A href="../OPENEJB/download.html" title="Download">Download</A></LI>
<LI><A href="index.html" title="Index">Documentation</A></LI>
<LI><A href="../OPENEJB/examples.html" title="Examples">Examples</A></LI>
<LI><A href="http://cwiki.apache.org/confluence/display/OPENEJB/Lightening%20Demos" class="external-link" rel="nofollow">Lightning Demos</A></LI>
<LI><A href="../OPENEJB/mailing-lists.html" title="Mailing Lists">Mailing Lists</A></LI>
<LI><A href="../OPENEJB/source-code.html" title="Source Code">Source Code</A></LI>
<LI><A href="http://blogs.apache.org/openejb" class="external-link" rel="nofollow">Project Blog</A></LI>
</UL>
<H3><A name="Navigation-Servers"></A>Servers</H3>
<UL class="alternate" type="square">
<LI><A href="../OPENEJB/local-server.html" title="Local Server">Local</A></LI>
<LI><A href="../OPENEJB/remote-server.html" title="Remote Server">Remote</A></LI>
</UL>
<H3><A name="Navigation-Integrations"></A>Integrations</H3>
<UL class="alternate" type="square">
<LI><A href="tomcat.html" title="Tomcat">Tomcat</A></LI>
<LI><A href="../OPENEJB/geronimo.html" title="Geronimo">Geronimo</A></LI>
<LI><A href="../OPENEJB/webobjects.html" title="WebObjects">WebObjects</A></LI>
</UL>
<H3><A name="Navigation-Community"></A>Community</H3>
<UL class="alternate" type="square">
<LI><A href="../OPENEJB/team.html" title="Team">Team</A></LI>
<LI><A href="../OPENEJB/articles.html" title="Articles">Articles</A></LI>
<LI><A href="http://webchat.freenode.net/?channels=openejb" class="external-link" rel="nofollow">IRC</A></LI>
</UL>
<H3><A name="Navigation-RelatedProjects"></A>Related Projects</H3>
<UL class="alternate" type="square">
<LI><A href="http://activemq.apache.org/" class="external-link" rel="nofollow">ActiveMQ</A></LI>
<LI><A href="http://openjpa.apache.org/" class="external-link" rel="nofollow">OpenJPA</A></LI>
<LI><A href="http://cxf.apache.org/" class="external-link" rel="nofollow">CXF</A></LI>
</UL>
<H3><A name="Navigation-Index"></A>Index</H3>
<UL class="alternate" type="square">
<LI><A href="../OPENEJB/space-index.html" title="Space Index">Site Index</A></LI>
<LI><A href="space-index.html" title="Space Index">Doc Index</A></LI>
</UL>
<H3>
<A name="Navigation-Feeds"></A>
Feeds
</H3>
<UL class="feeds">
<LI>
<A href="http://cwiki.apache.org/confluence/spaces/rss.action?key=OPENEJB&newPages=false">
<IMG src="http://openejb.apache.org/images/rss.gif"></A>
<A class="feedsText" href="http://cwiki.apache.org/confluence/spaces/rss.action?key=OPENEJB&newPages=false">Site</A>
</LI>
<LI><A href="http://cwiki.apache.org/confluence/spaces/blogrss.action?key=OPENEJB">
<IMG src="http://openejb.apache.org/images/rss.gif"></A>
<A class="feedsText" href="http://cwiki.apache.org/confluence/spaces/blogrss.action?key=OPENEJB">News</A>
</LI>
</UL>
</SPAN>
</TD>
<TD class="Col2">&nbsp;</TD>
<TD class="Col3">
<TABLE id="PageHeader" border="0" width="100%">
<TR>
<TD>
<A href="http://openejb.org/">
<IMG hspace="0" src="http://openejb.apache.org/images/logo_openejb.gif" vspace="0">
</A>
</TD>
<TD align="right">
<A href="http://www.apache.org/">
<IMG src="http://www.apache.org/images/asf-logo.gif" width="258" height="66">
</A>
</TD>
</TR>
<TR>
<TD id="page_title">
<!-- $TITLE -->
Deployments
</TD>
<TD align="right">
<BR><BR>
<!-- Google CSE Search Box Begins -->
<FORM id="searchbox_010475492895890475512:_t4iqjrgx90" action="http://www.google.com/cse">
<INPUT type="hidden" name="cx" value="010475492895890475512:_t4iqjrgx90">
<INPUT type="hidden" name="cof" value="FORID:0">
<INPUT name="q" type="text" size="25">
<INPUT type="submit" name="sa" value="Search">
</FORM>
<SCRIPT type="text/javascript" src="http://www.google.com/coop/cse/brand?form=searchbox_010475492895890475512:_t4iqjrgx90"></SCRIPT>
<!-- Google CSE Search Box Ends -->
</TD>
</TR>
</TABLE>
<P>
<!-- $BODY -->
<DIV id="PageContent">
<H1><A name="Deployments-The%27Deployments%27elementinopenejb.xml"></A>The 'Deployments' element in openejb.xml</H1>
<H2><A name="Deployments-Asinglejar"></A>A single jar</H2>
<P>To include a single jar by name, just declare a 'Deployments' element with a 'jar' attribute pointing to the jar file on the file system.</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>openejb.conf</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-xml">
<SPAN class="code-tag">&lt;openejb&gt;</SPAN>
...
<SPAN class="code-tag">&lt;Deployments jar=<SPAN class="code-quote">&quot;c:\my\app\superEjbs.jar&quot;</SPAN> /&gt;</SPAN>
<SPAN class="code-tag">&lt;Deployments jar=<SPAN class="code-quote">&quot;c:\someplace\purchasing.jar&quot;</SPAN> /&gt;</SPAN>
<SPAN class="code-tag">&lt;Deployments jar=<SPAN class="code-quote">&quot;timeTrack.jar&quot;</SPAN> /&gt;</SPAN>
<SPAN class="code-tag">&lt;/openejb&gt;</SPAN>
</PRE>
</DIV></DIV>
<P>The last element in the example uses a relative path to point to the ejb jar. This path will be resolved relative to the openejb.base property. So, for example, of the value of openejb.base was 'c:\timeapp\' then OpenEJB would look for the jar 'c:\timeapp\timeTrack.jar'. See the <A href="../OPENEJB/configuration.html" title="Configuration">Configuration</A> guide for more details.</P>
<H2><A name="Deployments-Adirectoryofjars"></A>A directory of jars</H2>
<P>To point to a directory that contains several jar files that OpenEJB should load, simply declare a 'Deployments' element with a 'dir' attribute pointing to the directory containing the jar files.</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>openejb.conf</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-xml">
<SPAN class="code-tag">&lt;openejb&gt;</SPAN>
...
<SPAN class="code-tag">&lt;Deployments dir=<SPAN class="code-quote">&quot;c:\my\app\beans\&quot;</SPAN> /&gt;</SPAN>
<SPAN class="code-tag">&lt;Deployments dir=<SPAN class="code-quote">&quot;c:\crimestopper\lib&quot;</SPAN> /&gt;</SPAN>
<SPAN class="code-tag">&lt;Deployments dir=<SPAN class="code-quote">&quot;ejbs&quot;</SPAN> /&gt;</SPAN>
<SPAN class="code-tag">&lt;Deployments dir=<SPAN class="code-quote">&quot;beans&quot;</SPAN> /&gt;</SPAN>
<SPAN class="code-tag">&lt;/openejb&gt;</SPAN>
</PRE>
</DIV></DIV>
<P>The directories listed will be searched for jars containing 'META-INF/ejb-jar.xml' files and will be added to the list of jars to load if they do. Better said, it's completely save to point to a directory containing a mix of ejbs and regular jar files. OpenEJB will simply skip over jars that do contain the required 'META-INF/ejb-jar.xml' file.</P>
<P>The last Deployments element declares a 'beans' directory relative to openejb.base for holding ejb jars. This declaration is simply convention and not required.</P>
<H2><A name="Deployments-Anunpackedjar"></A>An unpacked jar</H2>
<P>As of 1.0 beta1, OpenEJB supports unpacked ejb jars. Simply meaning that you don't need to pack your ejb's into a jar file in order to use them in OpenEJB. You still need to follow the ejb jar layout and include an &quot;META-INF/ejb-jar.xml&quot; in the directory that contains your ejbs.</P>
<P>For example, if you have a directory structure like this:</P>
<BLOCKQUOTE>
<P>C:\myapp\<BR>
C:\myapp\acmeEjbs\<BR>
C:\myapp\acmeEjbs\META-INF\ejb-jar.xml<BR>
C:\myapp\acmeEjbs\org\acme\Foo.class<BR>
C:\myapp\acmeEjbs\org\acme\FooBean.class<BR>
C:\myapp\acmeEjbs\org\acme\FooHome.class<BR>
C:\myapp\acmeEjbs\org\acme\Bar.class<BR>
C:\myapp\acmeEjbs\org\acme\BarBean.class<BR>
C:\myapp\acmeEjbs\org\acme\BarHome.class</P></BLOCKQUOTE>
<P>Then you would delcare a 'Deployments' element with the 'dir' attribute set to 'C:\myapp\acmeEjbs' as shown below.</P>
<DIV class="code panel" style="border-width: 1px;"><DIV class="codeHeader panelHeader" style="border-bottom-width: 1px;"><B>openejb.conf</B></DIV><DIV class="codeContent panelContent">
<PRE class="code-xml">
<SPAN class="code-tag">&lt;openejb&gt;</SPAN>
...
<SPAN class="code-tag">&lt;Deployments dir=<SPAN class="code-quote">&quot;c:\myapp\acmeEjbs&quot;</SPAN> /&gt;</SPAN>
<SPAN class="code-tag">&lt;/openejb&gt;</SPAN>
</PRE>
</DIV></DIV>
<P>Note that this syntax is the same as the directory syntax above. If OpenEJB finds a META-INF directory with an 'ejb-jar.xml' fine inside, then OpenEJB will treat the directory as an unpacked ejb jar. Otherwise OpenEJB will look for ejb jar files to load as detailed in the above section.</P>
<H1><A name="Deployments-Logfile"></A>Log file </H1>
<P>When trying to figure out if your ejbs were loaded, the openejb.log file is an incredible asset.</P>
<P>If your ejbs were loaded successfully you should see entries like the following (1.x and higher only):</P>
<DIV class="panel" style="border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;"><B>openejb.log</B></DIV><DIV class="panelContent">
<P>INFO : Loaded EJBs from /usr/local/openejb-1.0-beta1/beans/openejb-itests-beans.jar<BR>
INFO : Loaded EJBs from /usr/local/openejb-1.0-beta1/beans/openejb-webadmin-clienttools.jar</P>
</DIV></DIV>
<P>If your ejbs failed to load, you will see an entry similar to the following.</P>
<DIV class="panel" style="border-width: 1px;"><DIV class="panelHeader" style="border-bottom-width: 1px;"><B>openejb.log</B></DIV><DIV class="panelContent">
<P>WARN : Jar not loaded. /usr/local/openejb-1.0-beta1/beans/helloworld.jar. Jar failed validation. Use the validation tool for more details</P>
</DIV></DIV>
<P>Additionally, all the successfully loaded ejbs are individually listed in the log file at startup. The Deployment ID listed is the JNDI name used to lookup the ejb from a client of the Local or Remote Servers. The beans listed below are from our test suite.</P>
<DIV class="preformatted panel" style="border-width: 1px;"><DIV class="preformattedContent panelContent">
<PRE>DEBUG: Deployments : 19
DEBUG: Type Deployment ID
DEBUG: CMP_ENTITY client/tests/entity/cmp/RMI-over-IIOP/EJBHome
DEBUG: STATEFUL client/tests/stateful/EncBean
DEBUG: STATELESS client/tests/stateless/BeanManagedBasicStatelessHome
DEBUG: STATEFUL client/tests/stateful/BasicStatefulHome
DEBUG: STATELESS client/tests/stateless/EncBean
DEBUG: STATEFUL client/tests/stateful/BeanManagedTransactionTests/EJBHome
DEBUG: BMP_ENTITY client/tests/entity/bmp/RMI-over-IIOP/EJBHome
DEBUG: STATEFUL client/tests/stateful/RMI-over-IIOP/EJBHome
DEBUG: STATELESS client/tests/stateless/BeanManagedTransactionTests/EJBHome
DEBUG: BMP_ENTITY client/tests/entity/bmp/allowed_operations/EntityHome
DEBUG: CMP_ENTITY client/tests/entity/cmp/EncBean
DEBUG: STATEFUL client/tests/stateful/BeanManagedBasicStatefulHome
DEBUG: BMP_ENTITY client/tests/entity/bmp/BasicBmpHome
DEBUG: STATELESS client/tests/stateless/BasicStatelessHome
DEBUG: CMP_ENTITY client/tests/entity/cmp/BasicCmpHome
DEBUG: STATELESS client/tools/DatabaseHome
DEBUG: CMP_ENTITY client/tests/entity/cmp/allowed_operations/EntityHome
DEBUG: BMP_ENTITY client/tests/entity/bmp/EncBean
DEBUG: STATELESS client/tests/stateless/RMI-over-IIOP/EJBHome
</PRE>
</DIV></DIV>
</DIV>
</P>
</TD>
<TD class="Col4"><IMG src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5">
</TD>
</TR>
<TR class="Row5">
<TD class="Col1">&nbsp;</TD>
<TD class="Col2">&nbsp;</TD>
<TD class="Col3">
<BR>
<BR>
<IMG width="100%" height="1" src="http://openejb.apache.org/images/line_light.gif">
<TABLE width="100%">
<TR>
<TD>
<SPAN class="bodyGrey">
<SMALL>
<NOTICE><!-- $FOOTER -->
Apache OpenEJB is an project of The Apache Software Foundation (ASF)
</NOTICE>
<BR>
Site Powered by
<A href="http://atlassian.com/">Atlassian</A>
<A href="http://atlassian.com/confluence/">Confluence</A>
.
</SMALL>
</SPAN>
</TD>
<TD align="right">
<A style="color:#999;font-size:small;font-weight:normal;" href="https://cwiki.apache.org/confluence/pages/editpage.action?spaceKey=OPENEJBx30&title=Deployments">[ edit ]</A>
</TD>
</TR>
</TABLE>
<BR>
</TD>
<TD class="Col4"><IMG src="http://openejb.apache.org/images/dotTrans.gif"></TD>
<TD class="Col5">&nbsp;</TD>
</TR>
</TABLE>
<!-- Needed for composition plugin -->
<!-- delay the loading of large javascript files to the end so that they don't interfere with the loading of page content -->
<SPAN style="display: none">
<SCRIPT type="text/javascript" language="JavaScript" src="http://cwiki.apache.org/confluence/labels-javascript"></SCRIPT>
<SCRIPT src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</SCRIPT>
<SCRIPT type="text/javascript">
_uacct = "UA-2717626-1";
urchinTracker();
</SCRIPT>
</SPAN>
</BODY>
</HTML>