| |
Install Mailer Example
JBoss JavaMail
Example converted to Eclipse projects.
- Click File, click Import..., click Existing Project into Workspace, click
Next, click Browse..., navigate to C:\eclipse\workspace\mailerejb, click
Finish.
- Click File, click Import..., click Existing Project into Workspace, click
Next, click Browse..., navigate to C:\eclipse\workspace\mailerweb, click
Finish.
- Expand mailerweb project in Eclipse.
- Right click on build.xml, click Run Ant..., check ear-dir, jar-dir and
war-dir, click Finish.
- Click mailerweb project, click Project, click Rebuild Project. If you are
just working with just the Servlet code you do not need to run the Ant script
again. If you want to update the deployment with EJB classes run only the
jar-dir target.
- 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\mailerweb\mailer.ear so
it should look like:
<attribute name="URLs">
./deploy,
C:\eclipse\workspace\mailerweb\mailer.ear
</attribute>
Save changes and exit Wordpad.
From My Computer navigate to %JBOSS_DIST%\server\default\deploy, open
mail-service.xml in Wordpad and modify for your account and mail server. Save
changes and exit Wordpad.
Working with the Mailer Example in Eclipse
- Run Eclipse, in Package Explorer you should see mailerweb and mailerejb.
 | mailerejb contains all the EJBs for the Mailer Example. It uses
the project as the source folder, has one package org.jboss.docs.javamail
which contains the EJB source and an ant file build.xml to copy the classes
to the mailerweb project. |
 | mailerweb contains the Servlet code. It uses one source folder
src, has one package org.jboss.docs.javamail which contains the Servlet
source. The output is directed to mailerweb/mailer.ear/mailer.war/WEB-INF/classes
which allows hot editing of the Servlet without having to deploy it. |
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.
Open a web Browser and go to
http://localhost:8080/mailer, you should see the Mailer EJB Form. Enter
you email address in Principle field and click Send. You should get massage
with "Test from inside EJB Using JBoss" in the massage body.
|