<?xml version="1.0" encoding="UTF-8"?>
<section version="5.0" xml:lang="en" xmlns="http://docbook.org/ns/docbook"
         xmlns:xlink="http://www.w3.org/1999/xlink"
         xmlns:xi="http://www.w3.org/2001/XInclude"
         xmlns:svg="http://www.w3.org/2000/svg"
         xmlns:mml="http://www.w3.org/1998/Math/MathML"
         xmlns:html="http://www.w3.org/1999/xhtml"
         xmlns:db="http://docbook.org/ns/docbook"
         xml:id="developerguide.usingexamples">
  <info>
    <title>Using JOnAS Examples.</title>
  </info>
  
  
  <section>
    <info>
      <title>Getting from SVN</title>
    </info>

    <para>The examples are available in <code>jonas_tests</code> module of
      <code>jonas</code> trunk. Please Refer to the section
      <xref linkend="developerguide.getting_from_svn" />.</para>
  </section>

  <section>
    <info>
      <title>Compiling the Examples</title>
    </info>
 
    <section>
      <info>
        <title>Requirements</title>
      </info>

      <para>Before running the examples, be sure to follow the requirements
        for compiling and running these JOnAS examples.</para>
    </section>

    <section>
      <info>
        <title>Compile</title>
      </info>
   
      <para>The <application>ant tool</application> is used to build the
        examples. Each example is associated a
        <code>build.xml</code><filename />for individual compilation. All the
        examples can be compiled by launching the <command>ant</command> task
        in <code>jonas_tests</code> root folder.</para>
   
      <para>After having compiled an example, putting the generated
        archive(war, ear) in the <code>$JONAS_ROOT/deploy</code> folder will
        allow JOnAS to deploy it. If JOnAS is running the archive will be
        deployed automatically, if not, it will be deployed on startup.</para>
   
      <para>Here is an example of log messages for a deployment on
        startup.</para>
   
      <screen>
2008-03-11 10:14:41,734 : DeployableMonitorService.doStart : Use the deploy directories '[]', development mode is 'true'
2008-03-11 10:14:41,796 : DeployableMonitor.detectNewArchives : Deployables to deploy at startup: [[c:\cluster\JONAS5-OSGI-BIS\deploy\jonas-ctxroot.war, c:\cluster\JONAS5-OSGI-BIS\deploy\jonasAdmin.war]]</screen>

      <para>An example of log messages for hot deployment(when JOnAS is
        already running)</para>

      <para>
        <screen>
2008-03-11 10:14:41,812 : J2EEServer.info : JOnAS server 'jonas' RUNNING
2008-03-11 10:20:54,437 : Rar.processRar : Starting deployment of /c:/cluster/JONAS5-OSGI-BIS/work/apps/jonas/earsample_2008.03.11-10.20.52.ear/ra-sample.rar
2008-03-11 10:20:54,687 : Rar.processRar : /c:/cluster/JONAS5-OSGI-BIS/work/apps/jonas/earsample_2008.03.11-10.20.52.ear/ra-sample.rar available
2008-03-11 10:20:54,734 : JOnASEJBService.checkGenIC : JOnAS version was not found in the '/c:/cluster/JONAS5-OSGI-BIS/work/apps/jonas/earsample_2008.03.11-10.20.52.ear/secusb.jar' manifest file. Auto-generating container cla
sses...
2008-03-11 10:20:56,750 : GenIC.&lt;init&gt; : GenIC for JOnAS 5.0.2-SNAPSHOT: 'EarOp' generation ...
2008-03-11 10:20:56,921 : GenIC.&lt;init&gt; : Sources classes successfully generated for 'EarOp'
2008-03-11 10:20:56,937 : GenIC.compilClasses : Compiling Interposition classes ...
2008-03-11 10:20:59,734 : GenIC.compilClasses : Sources classes successfully compiled with Eclipse compiler.
2008-03-11 10:20:59,765 : GenIC.compilClasses : Running fastrmic
2008-03-11 10:21:00,109 : GenIC.compilClasses : Stubs and Skels successfully generated with fastrmic for rmi/jrmp
2008-03-11 10:21:00,343 : GenIC.clean : Deleting [D:\DOCUME~1\zengeyls\LOCALS~1\Temp\genic20567.tmp\org\ow2\jonas_gen\org\objectweb\earsample\beans\secusb\JOnASEarOp_1317676915Home.java, D:\DOCUME~1\zengeyls\LOCALS~1\Temp\gen
ic20567.tmp\org\ow2\jonas_gen\org\objectweb\earsample\beans\secusb\JOnASEarOp_1317676915Remote.java, D:\DOCUME~1\zengeyls\LOCALS~1\Temp\genic20567.tmp\org\ow2\jonas_gen\org\objectweb\earsample\beans\secusb\JOnASEarOp_13176769
15LocalHome.java, D:\DOCUME~1\zengeyls\LOCALS~1\Temp\genic20567.tmp\org\ow2\jonas_gen\org\objectweb\earsample\beans\secusb\JOnASEarOp_1317676915Local.java, D:\DOCUME~1\zengeyls\LOCALS~1\Temp\genic20567.tmp]
2008-03-11 10:21:01,359 : JContainer.addBean : EarOp available
2008-03-11 10:21:01,390 : EarDeployer.deployWARs : There are WAR files in the EAR 'EARDeployableImpl[archive=c:\cluster\JONAS5-OSGI-BIS\work\apps\jonas\earsample_2008.03.11-10.20.52.ear]' but the web service is not available
2008-03-11 10:21:01,421 : EarDeployer.deployEAR : 'EARDeployableImpl[archive=c:\cluster\JONAS5-OSGI-BIS\deploy\earsample.ear]' EAR Deployable is now deployed</screen>
      </para>
    </section>
  </section>

  <section>
    <info>
      <title>Running Examples</title>
    </info>

    <para>For running an example, please refer to the README file in root
      folder of each example.</para>
  </section>
</section>
