| |
Install CMP Example
JBoss CMP Example
converted to Eclipse project.
- Click File, click Import..., click Existing Project into Workspace, click
Next, click Browse..., navigate to C:\eclipse\workspace\cmp, click Finish.
- Expand cmp project in Eclipse.
- Right click on build.xml, click Run Ant..., check ear-dir and click
Finish.
- 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.
- 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>
Save changes and exit Wordpad.
Working with the CMP Example in Eclipse
- Run Eclipse, in Package Explorer you should see cmp.
 | cmp 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. |
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.
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.
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.
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.
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.
|