CMP

Install CMP Example

JBoss CMP Example converted to Eclipse project.

  1. Click File, click Import..., click Existing Project into Workspace, click Next, click Browse..., navigate to C:\eclipse\workspace\cmp, click Finish.
  2. Expand cmp project in Eclipse.
  3. Right click on build.xml, click Run Ant..., check ear-dir and click Finish.
  4. Click cmp project, click Project, click Rebuild Project.  You do not need to run the Ant script again unless you change a deployment descriptors in the resources folder.
  5. From My Computer navigate to %JBOSS_DIST%\server\default\conf, open jboss-service.xml in Wordpad, go to line with:
        <attribute name="URLs">
        ./deploy
        </attribute>


    Right after ./deploy add ,C:\eclipse\workspace\cmp\cd.ear so it should look like:

        <attribute name="URLs">
        ./deploy,
        C:\eclipse\workspace\cmp\cd.ear
        </attribute>
  6. Save changes and exit Wordpad.

Working with the CMP Example in Eclipse

  1. Run Eclipse, in Package Explorer you should see cmp.
    bulletcmp contains all the EJBs and clients for the CMP Example.  It uses one source folder src, has four packages org.jboss.docs.cmp.cd, org.jboss.docs.cmp.cd.bean, org.jboss.docs.cmp.cd.interfaces, org.jboss.docs.cmp.cd.utils,which contain the EJB and client source, and an ant file build.xml to build the ear folder.
  2. Click JBoss, Start JBoss (if not already started) and wait for:

    10:33:48,077 INFO [Server] JBoss (MX MicroKernel) [3.0.1RC1 Date:200206291622] Started in 0m:12s:125ms

    in the Console output.  This means JBoss is up and running.
  3. Click Run, Run..., click on Java Application, click New, put Upload in Name, click Browse... and select cmp, click OK, click Search..., select Upload, click OK and click Run.  Wait for OK to display in the console.  This uploads records using the CD bean.
  4. Click Run, Run..., click on Java Application, click New, put List in Name, click Browse... and select cmp, click OK, click Search..., select List, click OK and click Run.  Wait for the last record to display in the console.  This lists records using the CD bean.
  5. Click Run, Run..., click on Java Application, click New, put Lookup in Name, click Browse... and select cmp, click OK, click Search..., select Lookup, click OK, click on Arguments tab, put Mozart in Program arguments and click Run.  Wait for the last record to display in the console.  This lists finds all the records with the string Mozart in them using the CD bean.
  6. Click Run, Run..., click on Java Application, click New, put Remove in Name, click Browse... and select cmp, click OK, click Search..., select Remove, click OK and click Run.  Wait for the last record to display in the console.  This ldeletes records using the CD bean.
Home | JBoss Examples Last updated on 08/07/2002