How to create EJB3 MDB Queue project in Eclipse (JBoss 7.1)

20 February 2012 By Nithya Vasudevan 20,670 views 8 Comments
7 Flares Twitter 0 Facebook 0 Google+ 7 7 Flares ×

Environment Used

  • JDK 6 (Java SE 6)
  • JMS Sender/Client – Servlet 2.5 API
  • JMS Consumer – EJB 3.0 Message Driven Bean (MDB)
  • Eclipse Indigo IDE for Java EE Developers (3.7.1)
  • JBoss Tools – Core 3.3.0 M5 for Eclipse Indigo (3.7.1)
  • JBoss Application Server (AS) 7.1.0 Final

Setting up development environment:
Read this page for installing and setting up the environment for developing and deploying EJB 3.0 Session bean on JBoss application server.

Project Description

  • We are going to create a simple EJB 3 Message Driven Bean and a Web client (Servlet) which sends messages to the Queue destination.
  • This example explains how to develop, deploy and run EJB3 MDB as a message consumer in JBoss application server.
  • For testing this MDB listener we write a Web client (a servlet) as a message producer which sends a simple text message and an object message.
  • The message driven bean (message consumer) and the Servlet (message producer) are deployed on the same server instance (JBoss AS).

Creating New EJB Project

  • Open Eclipse IDE and create a new EJB project which can be done in three ways,
    • Right click on Project Explorer -> New -> EJB Project
    • File menu -> New -> EJB Project
    • Click on the down arrow on New icon on toolbar -> EJB Project

  • Enter the project name as “FirstMDBProject” and make sure the JBoss 7.1 Runtime has been selected with the EJB 3.0 Module version.
  • This project uses Java 1.6 version. The default Java version in Eclipse Indigo is 1.7 so to change the “Configuration” click on “Modify…” button to make changes.
  • Click Next -> Next -> and Finish.
  • You will see an EJB project in the Project Explorer view.

Creating object message class

  • Right click on ejbModule -> New -> Class
  • Enter the Java package name as com.theopentutorials.mdb.to
  • Enter the Class name as Employee
  • Click “Finish

Copy the following code:

package com.theopentutorials.mdb.to;
import java.io.Serializable;
public class Employee implements Serializable {
	private int id;
	private String name;
	private String designation;
	private double salary;
	
	public Employee() {	}
	
	public Employee(int id, String name, String designation, 
			double salary) 
	{
		this.id = id;
		this.name = name;
		this.designation = designation;
		this.salary = salary;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDesignation() {
		return designation;
	}
	public void setDesignation(String designation) {
		this.designation = designation;
	}
	public double getSalary() {
		return salary;
	}
	public void setSalary(double salary) {
		this.salary = salary;
	}
	@Override
	public String toString() {
		return "Employee [id=" + id + ", name=" + name + ", designation="
				+ designation + ", salary=" + salary + "]";
	}
}

Creating Message Driven Bean Consumer

  • Right click on ejbModule -> New -> Message-Driven Bean (EJB 3.x)
  • Enter the Java package name as com.theopentutorials.mdb
  • Enter the Class name as QueueListenerMDB
  • Select the Destination type as Queue
  • Click “Finish

package com.theopentutorials.mdb;

import java.util.Date;
import javax.ejb.ActivationConfigProperty;
import javax.ejb.MessageDriven;
import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import javax.jms.TextMessage;
import com.theopentutorials.mdb.to.Employee;

@MessageDriven(activationConfig = {
		@ActivationConfigProperty(
		propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
		@ActivationConfigProperty(
		propertyName = "destination", propertyValue = "queue/MyQueue") })
public class QueueListenerMDB implements MessageListener {
	public QueueListenerMDB() {
	}

	public void onMessage(Message message) {
		try {
			if (message instanceof TextMessage) {
				System.out.println("Queue: I received a TextMessage at " 
								+ new Date());
				TextMessage msg = (TextMessage) message;
				System.out.println("Message is : " + msg.getText());
			} else if (message instanceof ObjectMessage) {
				System.out.println("Queue: I received an ObjectMessage at " 
								+ new Date());
				ObjectMessage msg = (ObjectMessage) message;
				Employee employee = (Employee) msg.getObject();
				System.out.println("Employee Details: ");
				System.out.println(employee.getId());
				System.out.println(employee.getName());
				System.out.println(employee.getDesignation());
				System.out.println(employee.getSalary());
			} else {
				System.out.println("Not a valid message for this Queue MDB");
			}

		} catch (JMSException e) {
			e.printStackTrace();
		}
	}
}
  • The activationConfig property of @MessageDriven is an array of ActivationConfigProperty and it should specify the destinationType (Queue or Topic) and destination (Queue/Topic’s JNDI name).
  • In the onMessage() we are receiving two types of message, TextMessage and ObjectMessage.

Configuring messaging services on JBoss AS 7

In the previous version of JBoss AS we had an option to configure the messaging destinations (Queue or Topic) in META-INF/*-service.xml with element. In JBoss AS 7, it is configured in main application server configuration file (standalone.xml) which is found in JBossAS_Home/standalone/configuration.

  • Open standalone.xml and follow the steps below to configure messaging services.

Add entension element

Add

<extension module="org.jboss.as.messaging"/>

in the <extensions> element.

Add subsystem element

Add the following <subsystem> inside <profile> element.

<subsystem xmlns="urn:jboss:domain:messaging:1.1">
            <hornetq-server>
                <persistence-enabled>true</persistence-enabled>
                <journal-file-size>102400</journal-file-size>
                <journal-min-files>2</journal-min-files>

                <connectors>
                    <netty-connector name="netty" socket-binding="messaging"/>
                    <netty-connector name="netty-throughput" socket-binding="messaging-throughput">
                        <param key="batch-delay" value="50"/>
                    </netty-connector>
                    <in-vm-connector name="in-vm" server-id="0"/>
                </connectors>

                <acceptors>
                    <netty-acceptor name="netty" socket-binding="messaging"/>
                    <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
                        <param key="batch-delay" value="50"/>
                        <param key="direct-deliver" value="false"/>
                    </netty-acceptor>
                    <in-vm-acceptor name="in-vm" server-id="0"/>
                </acceptors>

                <security-settings>
                    <security-setting match="#">
                        <permission type="send" roles="guest"/>
                        <permission type="consume" roles="guest"/>
                        <permission type="createNonDurableQueue" roles="guest"/>
                        <permission type="deleteNonDurableQueue" roles="guest"/>
                    </security-setting>
                </security-settings>

                <address-settings>
                    <address-setting match="#">
                        <dead-letter-address>jms.queue.DLQ</dead-letter-address>
                        <expiry-address>jms.queue.ExpiryQueue</expiry-address>
                        <redelivery-delay>0</redelivery-delay>
                        <max-size-bytes>10485760</max-size-bytes>
                        <address-full-policy>BLOCK</address-full-policy>
                        <message-counter-history-day-limit>10</message-counter-history-day-limit>
                    </address-setting>
                </address-settings>

                <jms-connection-factories>
                    <connection-factory name="InVmConnectionFactory">
                        <connectors>
                            <connector-ref connector-name="in-vm"/>
                        </connectors>
                        <entries>
                            <entry name="java:/ConnectionFactory"/>
                        </entries>
                    </connection-factory>
                    <connection-factory name="RemoteConnectionFactory">
                        <connectors>
                            <connector-ref connector-name="netty"/>
                        </connectors>
                        <entries>
                            <entry name="RemoteConnectionFactory"/>
                            <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
                        </entries>
                    </connection-factory>
                    <pooled-connection-factory name="hornetq-ra">
                        <transaction mode="xa"/>
                        <connectors>
                            <connector-ref connector-name="in-vm"/>
                        </connectors>
                        <entries>
                            <entry name="java:/JmsXA"/>
                        </entries>
                    </pooled-connection-factory>
                </jms-connection-factories>

                <jms-destinations>
                    <jms-queue name="testQueue">
                        <entry name="queue/MyQueue"/>
                    </jms-queue>
                    <jms-topic name="testTopic">
                        <entry name="topic/MyTopic"/>
                    </jms-topic>
                </jms-destinations>
            </hornetq-server>
        </subsystem>

The entry name for jms-queue should match the destination activation config property in @MessageDriven.

Add messaging port

In <socket-binding-group> add these two elements

<socket-binding name="messaging" port="5445"/>
<socket-binding name="messaging-throughput" port="5455"/>

Add MDB Resource Adapter Reference

Under <subsystem xmlns=”urn:jboss:domain:ejb3:1.2″> add this <mdb> element

<mdb>
    <resource-adapter-ref resource-adapter-name="hornetq-ra"/>
    <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>

Deploying EJB project

  • Now we need to deploy the EJB project “FirstMDBProject” on server..
  • Deploying the project can be done in two ways,
    • Right click on the EJB project -> Run As -> Run On Server. Select the existing “JBoss 7.1 Runtime Server” and click Finish.
    • Right click on “JBoss 7.1 Runtime Server” available in Servers view -> Add and Remove… -> Select the EJB JAR file from the left pane and click Add-> and then Finish.

Start/Restart the Server

Right click on “JBoss 7.1 Runtime Server” from Servers view and click on Start if it has not yet been started.

If the project is deployed properly with global JNDI mapping then you will see the following message in the console.

Bound messaging object to jndi name java:/queue/MyQueue
Started message driven bean ‘QueueListenerMDB’ with ‘hornetq-ra’ resource adapter
Deployed “FirstMDBProject.jar”

Creating JMS client (Dynamic Web Project)

  • The next step is to write a Web Client (a Servlet) which produces the message and sends to the Queue.
  • The servlet uses JNDI to lookup ConnectionFactory and the Queue.
  • Creating a new ‘Dynamic Web project’ can be done in three ways,
    • Right click on Project Explorer -> New -> Dynamic Web Project
    • File menu -> New -> Dynamic Web Project
    • Click on the down arrow on New icon on toolbar -> Dynamic Web Project

  • Enter the project name as “MDBWebClient” and make sure the JBoss 7.1 Runtime has been selected with the Dynamic web module version as 2.5.
  • This project uses Java 1.6 version. The default Java version in Eclipse Indigo is 1.7 so to change the “Configuration” click on “Modify…” button to make changes.
  • Click “Next” -> “Next” -> and “Finish”.
  • You will see the Dynamic web project in the “Project Explorer” view.

To send object message servlet needs Employee class which we have created in FirstMDBProject.

Creating JAR file

  • Right click on Employee.java file in FirstMDBProject -> Export.
  • Expand Java folder and select “JAR file” and click Next.
  • Click on Browse… and enter the file name and Finish.

Now copy the created JAR file and paste it in MDBWebClient/WebContent/WEB-INF/lib folder.

Creating Servlet class

  • Right click on src or Project -> New -> Servlet

  • Enter the Java package name as com.theopentutorials.servlets
  • Enter the Class name as ServletMessageProducer
  • Click “Finish

In the doGet() method copy the following code.

package com.theopentutorials.servlets;

import java.io.IOException;
import java.io.PrintWriter;
import javax.jms.ObjectMessage;
import javax.jms.Queue;
import javax.jms.QueueConnection;
import javax.jms.QueueConnectionFactory;
import javax.jms.QueueSender;
import javax.jms.QueueSession;
import javax.jms.TextMessage;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.theopentutorials.mdb.to.Employee;

public class ServletMessageProducer extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public ServletMessageProducer() {
        super();
    }

	protected void doGet(HttpServletRequest request, 
			HttpServletResponse response) 
			throws ServletException, IOException {
		final String QUEUE_LOOKUP = "queue/MyQueue";
		final String CONNECTION_FACTORY = "ConnectionFactory";
		
		PrintWriter out = response.getWriter();
		try{
			Context context = new InitialContext();
			QueueConnectionFactory factory = 
				(QueueConnectionFactory)context.lookup(CONNECTION_FACTORY);
			QueueConnection connection = factory.createQueueConnection();
			QueueSession session = 
				connection.createQueueSession(false, 
					QueueSession.AUTO_ACKNOWLEDGE);
			
			Queue queue = (Queue)context.lookup(QUEUE_LOOKUP);
			QueueSender sender = session.createSender(queue);
			
			//1. Sending TextMessage to the Queue 
			TextMessage message = session.createTextMessage();
			message.setText("Hello EJB3 MDB Queue!!!");
			sender.send(message);
			out.println("1. Sent TextMessage to the Queue");
			
			//2. Sending ObjectMessage to the Queue
			ObjectMessage objMsg = session.createObjectMessage();
			
			Employee employee = new Employee();
			employee.setId(2163);
			employee.setName("Kumar");
			employee.setDesignation("CTO");
			employee.setSalary(100000);
			objMsg.setObject(employee);						
			sender.send(objMsg);
			out.println("2. Sent ObjectMessage to the Queue");
			
			session.close();
		}catch(Exception e){e.printStackTrace();}
	}
}

Deploying Dynamic Web Project

  • Now we need to deploy the servlet’s project “MDBWebClient” on server.
  • Deploying the project can be done in two ways,
    • Right click on the “MDBWebClient” Dynamic Web project -> Run As -> Run On Server. Select the existing “JBoss 7.1 Runtime Server” and click Finish.
    • Right click on “JBoss 7.1 Runtime Server” available in Servers view -> Add and Remove… -> Select the WAR file from the left pane and click Add-> and then Finish.

Start/Restart the Server

  • Right click on “JBoss 7.1 Runtime Server” from Servers view and click on Start if it has not yet been started.
  • If the projects are deployed properly then you will see the following message in the console.

Deployed “MDBWebClient.war”
Deployed “FirstMDBProject.jar”

Folder Structure

The figure below shows the final directory structure of EJB project “FirstMDBProject”.

The figure below shows the final directory structure of Dynamic Web project “MDBWebClient”

Run the Servlet

Eclipse Internal Web Browser will display the following output

JBoss Runtime Server Console will display the following output.

[stdout] Queue: I received a TextMessage at Fri Feb 17 18:03:41 IST 2012
[stdout] Message is : Hello EJB3 MDB Queue!!!
[stdout] Queue: I received an ObjectMessage at Fri Feb 17 18:03:41 IST 2012
[stdout] Employee Details:
[stdout] 2163
[stdout] Kumar
[stdout] CTO
[stdout] 100000.0

Tags: , , , , , ,

  • riteshh05

    Hi Nithya,
    Thanks for sharing such a helpful stuff. I did all the steps mentioned above but getting error below

    00:57:22,257 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of “FirstMDBProject.jar”
    00:57:22,305 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit.”FirstMDBProject.jar”.PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit.”FirstMDBProject.jar”.PARSE: Failed to process phase PARSE of deployment “FirstMDBProject.jar”
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_02]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_02]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_02]
    Caused by: org.jboss.msc.service.ServiceNotFoundException: Service service jboss.ejb.default-resource-adapter-name-service not found
    at org.jboss.msc.service.ServiceContainerImpl.getRequiredService(ServiceContainerImpl.java:447) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.getDefaultResourceAdapterName(MessageDrivenComponentDescriptionFactory.java:273)
    at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processMessageBeans(MessageDrivenComponentDescriptionFactory.java:153)
    at org.jboss.as.ejb3.deployment.processors.MessageDrivenComponentDescriptionFactory.processAnnotations(MessageDrivenComponentDescriptionFactory.java:81)
    at org.jboss.as.ejb3.deployment.processors.AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.processAnnotations(AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.java:58)
    at org.jboss.as.ejb3.deployment.processors.AbstractDeploymentUnitProcessor.deploy(AbstractDeploymentUnitProcessor.java:81)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    … 5 more

    00:57:22,391 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-8) JNDI bindings for session bean named HelloWorldBean in deployment unit deployment “HelloWorldStateLessExample.jar” are as follows:

    java:global/HelloWorldStateLessExample/HelloWorldBean!com.ritesh.business.HelloWorldRemote
    java:app/HelloWorldStateLessExample/HelloWorldBean!com.ritesh.business.HelloWorldRemote
    java:module/HelloWorldBean!com.ritesh.business.HelloWorldRemote
    java:jboss/exported/HelloWorldStateLessExample/HelloWorldBean!com.ritesh.business.HelloWorldRemote
    java:global/HelloWorldStateLessExample/HelloWorldBean
    java:app/HelloWorldStateLessExample/HelloWorldBean
    java:module/HelloWorldBean

    00:57:22,543 INFO [org.jboss.as] (MSC service thread 1-1) JBAS015951: Admin console listening on http://127.0.0.1:9990
    00:57:22,544 ERROR [org.jboss.as] (MSC service thread 1-1) JBAS015875: JBoss AS 7.1.1.Final “Brontes” started (with errors) in 4185ms – Started 192 of 272 services (1 services failed or missing dependencies, 78 services are passive or on-demand)
    00:57:22,544 INFO [org.jboss.as.server] (DeploymentScanner-threads – 2) JBAS015871: Deploy of deployment “HelloWorldStateLessExample.jar” was rolled back with no failure message
    00:57:22,549 INFO [org.jboss.as.server] (DeploymentScanner-threads – 2) JBAS015870: Deploy of deployment “FirstMDBProject.jar” was rolled back with failure message {“JBAS014671: Failed services” => {“jboss.deployment.unit.\”FirstMDBProject.jar\”.PARSE” => “org.jboss.msc.service.StartException in service jboss.deployment.unit.\”FirstMDBProject.jar\”.PARSE: Failed to process phase PARSE of deployment \”FirstMDBProject.jar\”"}}
    00:57:22,560 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015877: Stopped deployment FirstMDBProject.jar in 10ms
    00:57:22,572 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015877: Stopped deployment HelloWorldStateLessExample.jar in 26ms
    00:57:22,574 INFO [org.jboss.as.controller] (DeploymentScanner-threads – 2) JBAS014774: Service status report
    JBAS014777: Services which failed to start: service jboss.deployment.unit.”FirstMDBProject.jar”.PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit.”FirstMDBProject.jar”.PARSE: Failed to process phase PARSE of deployment “FirstMDBProject.jar”

    00:57:22,802 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads – 1) {“JBAS014653: Composite operation failed and was rolled back. Steps that failed:” => {“Operation step-2″ => {“JBAS014671: Failed services” => {“jboss.deployment.unit.\”FirstMDBProject.jar\”.PARSE” => “org.jboss.msc.service.StartException in service jboss.deployment.unit.\”FirstMDBProject.jar\”.PARSE: Failed to process phase PARSE of deployment \”FirstMDBProject.jar\”"}}}}
    00:57:22,830 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads – 1) JBAS014654: Composite operation was rolled back

    Please help me.
    Regards
    Ritesh Kumar

    • http://theopentutorials.com Praveen Macherla

      Check this link. Add the mentioned configuration in standalone.xml

      • riteshh05

        Thanks Praveen,
        I got the solution.
        If possible, please provide some SPRING tutorial on the site.
        EJB stuff is really helpful which helped me a lot.
        Regards,
        Ritesh Kumar

    • naveen

      i executed ur program…i am very happy….send different type programs into this site similarly……thank’s alot…..

  • biman

    I have to use jboss 4.2 in my project
    what changes should i make?

    • http://theopentutorials.com Praveen Macherla

      Try this and see. That is for JBoss 6. Hope it works for 4.2 as well. If not you are on your own :(

  • Andy Tather

    After running the sample and leaving it a while you may get this in the JBoss log:

    12:56:31,128 WARN [org.hornetq.jms.client.HornetQConnection] (Finalizer) I’m closing a JMS connection you left open. Please make sure you close all JMS connections explicitly before letting them go out of scope!
    12:56:31,128 WARN [org.hornetq.jms.client.HornetQConnection] (Finalizer) The JMS connection you didn’t close was created here:: java.lang.Exception

    A simple:

    connection.close();

    after the line:

    session.close();

    should suffice.

  • vikram

    HI nithya,

    I dont see Employee Details. It prints null and zero. what needs to be done in order to see output you mentioned it above? i have followed all step as you said.

    log:
    09:52:02,613 INFO [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Listening on /127.0.0.1:9999
    09:52:02,613 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Started FileSystemDeploymentService for directory C:\Software\jboss-as-7.1.1.Final\standalone\deployments
    09:52:02,628 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads – 1) JBAS015003: Found FirstMDBProject.jar in deployment directory. To trigger deployment create a file called FirstMDBProject.jar.dodeploy
    09:52:02,753 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source
    09:52:02,987 INFO [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-6) Started Netty Acceptor version 3.2.5.Final-a96d88c localhost:5445 for CORE protocol
    09:52:02,987 INFO [org.hornetq.core.remoting.impl.netty.NettyAcceptor] (MSC service thread 1-6) Started Netty Acceptor version 3.2.5.Final-a96d88c localhost:5455 for CORE protocol
    09:52:02,987 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-6) Server is now live
    09:52:02,987 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-6) HornetQ Server version 2.2.13.Final (HQ_2_2_13_FINAL_AS7, 122) [30f9f008-2dab-11e2-8920-511ab1fdf6a3]) started
    09:52:02,987 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-4) trying to deploy queue jms.queue.testQueue
    09:52:03,004 INFO [org.jboss.as.messaging] (MSC service thread 1-4) JBAS011601: Bound messaging object to jndi name java:/queue/MyQueue
    09:52:03,019 INFO [org.jboss.as.messaging] (MSC service thread 1-8) JBAS011601: Bound messaging object to jndi name java:/ConnectionFactory
    09:52:03,035 INFO [org.jboss.as.messaging] (MSC service thread 1-5) JBAS011601: Bound messaging object to jndi name java:jboss/exported/jms/RemoteConnectionFactory
    09:52:03,035 INFO [org.jboss.as.messaging] (MSC service thread 1-5) JBAS011601: Bound messaging object to jndi name java:/RemoteConnectionFactory
    09:52:03,035 INFO [org.hornetq.core.server.impl.HornetQServerImpl] (MSC service thread 1-6) trying to deploy queue jms.topic.testTopic
    09:52:03,035 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-1) JBAS010406: Registered connection factory java:/JmsXA
    09:52:03,051 INFO [org.hornetq.ra.HornetQResourceAdapter] (MSC service thread 1-1) HornetQ resource adaptor started
    09:52:03,051 INFO [org.jboss.as.connector.services.ResourceAdapterActivatorService$ResourceAdapterActivator] (MSC service thread 1-1) IJ020002: Deployed: file://RaActivatorhornetq-ra
    09:52:03,051 INFO [org.jboss.as.deployment.connector] (MSC service thread 1-7) JBAS010401: Bound JCA ConnectionFactory
    09:52:03,051 INFO [org.jboss.as.messaging] (MSC service thread 1-6) JBAS011601: Bound messaging object to jndi name java:/topic/MyTopic
    09:52:03,082 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of “FirstMDBProject.jar”
    09:52:03,285 INFO [org.jboss.as.ejb3] (MSC service thread 1-3) JBAS014142: Started message driven bean ‘QueueListnerMDB’ with ‘hornetq-ra’ resource adapter
    09:52:03,300 INFO [org.jboss.as] (MSC service thread 1-5) JBAS015951: Admin console listening on http://127.0.0.1:9990
    09:52:03,300 INFO [org.jboss.as] (MSC service thread 1-5) JBAS015874: JBoss AS 7.1.1.Final “Brontes” started in 2763ms – Started 185 of 264 services (78 services are passive or on-demand)
    09:52:03,378 INFO [org.jboss.as.server] (DeploymentScanner-threads – 2) JBAS018559: Deployed “FirstMDBProject.jar”
    09:52:18,432 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads – 2) JBAS015003: Found MDBWebClient.war in deployment directory. To trigger deployment create a file called MDBWebClient.war.dodeploy
    09:52:18,433 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015876: Starting deployment of “MDBWebClient.war”
    09:52:18,745 INFO [org.jboss.web] (MSC service thread 1-3) JBAS018210: Registering web context: /MDBWebClient
    09:52:18,808 INFO [org.jboss.as.server] (DeploymentScanner-threads – 1) JBAS018559: Deployed “MDBWebClient.war”