To configure a queue or a topic, create a service.xml file. (myqueue-service.xml, for example) There are some examples of how to do it in jbossmq-destinations-service.xml in your deploy directory. In fact, you could put your own definitions in that file, but I like to create my own service files for them.
This queue's jndi name would be "queue/ex". You could look it up like that and use it directly (the connection factory is "ConnectionFactory") if you want. To link it to a MDB, add this in the enterprise beans section of your jboss.xml file:
It's pretty straightforward
Joined: Jan 28, 2003
Hi norman richards,
Thanks for suggestion. i am getting some Exception during deployment. I am using mysql as database.
<!-- client code --> javax.naming.Context ctx = new InitialContext(); QueueConnectionFactory qcf = (QueueConnectionFactory)ctx.lookup("ConnectionFactory"); //create a connection QueueConnection qConn = qcf.createQueueConnection(); //creater session QueueSession qSession = qConn.createQueueSession(false,1); //create a sender Queue q = ( Queue ) ctx.lookup("queue/ex"); QueueSender sender = qSession.createSender(q); //after message received from the quue the message will be removed from message queue //QueueSender receiver = qSession.createReceiver(q); //delivery message TextMessagemsg = qSession.createTextMessage(); msg.setText("i will set mesage here "); sender.send(msg);
<!-- mdb code--> i am getting exception at time of exception javax.jms.JMSException: Error creating the dlq connection: XAConnectionFactory not bound at org.jboss.ejb.plugins.jms.DLQHandler.createService(DLQHandler.java:169) at org.jboss.system.ServiceMBeanSupport.create(ServiceMBeanSupport.java:158) at org.jboss.ejb.plugins.jms.JMSContainerInvoker.innerCreate(JMSContainerInvoker.java:458) at org.jboss.ejb.plugins.jms.JMSContainerInvoker.startService(JMSContainerInvoker.java:674) at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192) at org.jboss.ejb.MessageDrivenContainer.startService(MessageDrivenContainer.java:234) at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:192) at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
I was having the same problem. I had deleted the hsqldb-ds.xml file from my deploy folder. I just learnt that this file which configures access to the hypersonic database is used by jboss to keep jms related data.
Just add the hsqldb-ds.xml file to your deploy folder and try reinstalling your application. This sholud work