This is a bare- bones Jboss tutorial
What will you need ?
jboss (obviously duh !!!) You can download from here (I used Jboss 4.0.5 GA )
And ANT to compile,build and deploy
And 20 minutes of your time
What will we achieve ?
A quick on its feet Jboss tutorial which uses a stateless session bean to say hello to you
Assumptions
You are running your JBoss server on the default port number 1099.
This example was tested on windows XP platform- but should really work elsewhere as well.
Getting Started
Step 1: Download from here.
Step 2: Unzip the file to your file system. Lets say C:\JBossOne
Step 3: Start your JBoss server
Step 4: Open a command prompt and then Go to the folder C:\JBossOne
Step 5: Edit build.properties and change the jboss.home to confirm to your deployment.
Step 6: Compile, Build the application- by giving the command ant package-ejb
Step 7: Deploy the application by giving the command ant deploy
Step 8: Confirm that the bean has been deployed correctly. It should give something like this on the jboss prompt
18:29:20,359 INFO [EjbModule] Deploying HelloWorldBean
18:29:20,437 INFO [ProxyFactory] Bound EJB Home ‘HelloWorldBean’ to jndi ‘Hello
World’
18:29:20,437 INFO [EJBDeployer] Deployed: file:/C:/jboss_4_0_5/server/default/t
mp/deploy/tmp32046HelloWorld.ear-contents/HelloWorld-ejb.jar
18:29:20,484 INFO [EARDeployer] Started J2EE application: file:/C:/jboss_4_0_5/
server/default/deploy/HelloWorld.ear
Step 9:Open a new command prompt and then Go to the folder C:\JBossOne
Step 10: Test your application by giving the command ant tests. You should see something like this
C:\Work\MyLabs\JBossOne>ant tests
Buildfile: build.xmltests:
[junit] Running com.rajivnarula.tutorial.jboss.test.HelloWorldTests
[junit] Testsuite: com.rajivnarula.tutorial.jboss.test.HelloWorldTests
[junit] hey
[junit] log4j:WARN No appenders could be found for logger (org.jboss.securit
y.SecurityAssociation).
[junit] log4j:WARN Please initialize the log4j system properly.
[junit] Hello Boss
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 2.235 sec
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 2.235 sec
[junit]
[junit] ————- Standard Output —————
[junit] hey
[junit] Hello Boss
[junit] ————- —————- —————
[junit] ————- Standard Error —————–
[junit] log4j:WARN No appenders could be found for logger (org.jboss.securit
y.SecurityAssociation).
[junit] log4j:WARN Please initialize the log4j system properly.
[junit] ————- —————- —————BUILD SUCCESSFUL
Voila !!!. That’s it
If you have trouble downlaoding or get error on running it- please leave a note here and I shall try to help you resolve it.

Recent Comments