Deploy the Java EE Example
Like the other Java EE examples the MDB example is a JEE Application which first needs deploying in the JBoss Application Server. The first thing we need to do is set the JBOSS_HOME environment property to the location of the JBoss Application Server, in a Linux shell this would be something like: export JBOSS_HOME=/home/jbossas5.1/build/output/jboss-5.1.0.GA Once set we can then deploy the application, from inside the examples/javaee/mdb directory run the command: ./build.sh deploy This will make a copy of the messaging profile in the JBoss Application server and start the server. In the shell window you should see something like the following output: Buildfile: build.xml validate-jboss: deploy: deploy-resources: [copy] Copying 1 file to /home/andy/projects/jbossas5.1/build/output/jboss-5.1.0.GA /server/default-with-hornetq/deploy/hornetq.sar [copy] Copying 1 file to /home/andy/projects/jbossas5.1/build/output/jboss-5.1.0.GA /server/default-with-hornetq/deploy/hornetq.sar init: compile: jar: [jar] Building jar: /home/andy/projects/hornetq/trunk/examples/javaee/mdb/build/mdb-exa mple.jar ear: [jar] Building jar: /home/andy/projects/hornetq/trunk/examples/javaee/mdb/build/mdb-exa mple.ear deploy-ear: [copy] Copying 1 file to /home/andy/projects/jbossas5.1/build/output/jboss-5.1.0.GA ....... [exec] 16:01:04,607 INFO [JBossASKernel] Class:javax.jms.MessageListener [exec] 16:01:04,607 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=mdb-example.ear, jar=mdb-example.jar,name=MessageMDBExample,service=EJB3) to KernelDeployment of: mdb-example.jar [exec] 16:01:04,702 INFO [EJBContainer] STARTED EJB: org.hornetq.javaee.example.server .MDBExample ejbName: MessageMDBExample [exec] 16:01:09,496 INFO [TomcatDeployment] deploy, ctxPath=/mdb-example [exec] 16:01:09,812 WARNING [config] Unable to process deployment descriptor for cont ext '/mdb-example' [exec] 16:01:09,812 INFO [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/mdb-example' [exec] 16:01:09,958 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1- 8080 [exec] 16:01:09,990 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009 [exec] 16:01:10,001 INFO [ServerImpl] JBoss (Microcontainer) [5.1.0.GA (build: SVNTag =JBoss_5_1_0_GA date=200905151005)] Started in 6m:21s:797ms We can now run the example, do this by running the following command from within the mdb directory. ./build.sh You should see some output similar to the following: Buildfile: build.xml run: init: compile: runExample: [java] Sent message: This is a text message BUILD SUCCESSFUL Total time: 7 seconds You may also see some output from the JBoss Application Server, in this instance it is: 16:27:54,703 INFO [STDOUT] message This is a text message received