HI,
I have a MDB wich used a Topic but I have to use now a Queue and there the
problem starts.
In my ejb-jar.xml I have defined ...
<message-driven>
<ejb-name>OrderListener</ejb-name>
<ejb-class>com.tecmath.cms.mt.order.OrderListenerMDBean</ejb-class>
<transaction-type>Container</transaction-type>
<acknowledge-mode>Auto-acknowledge</acknowledge-mode>
<message-driven-destination>
<destination-type>javax.jms.Queue</destination-type>
<subscription-durability>NonDurable</subscription-durability>
</message-driven-destination>
<env-entry>
<description>name of the connetionpool</description>
<env-entry-name>DB_CONNECTION_NAME</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>MySqlPool</env-entry-value>
</env-entry>
<env-entry>
<description>1 == MySQL, 2 == MSSQL</description>
<env-entry-name>DB_TYPE</env-entry-name>
<env-entry-type>java.lang.Integer</env-entry-type>
<env-entry-value>1</env-entry-value>
</env-entry>
<env-entry>
<description>the destinationpath for the
downloadfile</description>
<env-entry-name>destination</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>D:\Programme\Apache_Tomcat_4.0\webapps\mt\download</env-ent
ry-value>
</env-entry>
<env-entry>
<description>the JNDI name of the topic where the MDB
sends too and the
service sub. to</description>
<env-entry-name>sendToJNDIName</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>queue/downloadRequestQueue</env-entry-value>
</env-entry>
<env-entry>
<env-entry-name>connectionFactory</env-entry-name>
<env-entry-type>java.lang.String</env-entry-type>
<env-entry-value>QueueConnectionFactory</env-entry-value>
</env-entry>
<resource-env-ref>
<resource-env-ref-name>queue/orderListenerQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
<resource-env-ref>
<resource-env-ref-name>queue/downloadRequestQueue</resource-env-ref-name>
<resource-env-ref-type>javax.jms.Queue</resource-env-ref-type>
</resource-env-ref>
</message-driven>
and in my jboss.xml I have defined
<message-driven>
<ejb-name>OrderListener</ejb-name>
<configuration-name>Standard Message Driven
Bean</configuration-name>
<destination-jndi-name>queue/orderListenerQueue</destination-jndi-name>
</message-driven>
AND the code wich I use to test it is the following.
public class Test {
public static void main(String[] args) {
try {
java.util.Properties p = System.getProperties();
p.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
p.put(javax.naming.Context.PROVIDER_URL, "localhost");
javax.naming.InitialContext jndiContext = new
javax.naming.InitialContext(p);
QueueConnectionFactory factory = (QueueConnectionFactory)
jndiContext.lookup("QueueConnectionFactory");
Queue queue = (Queue)
jndiContext.lookup("queue/orderListenerQueue");
QueueConnection connect = factory.createQueueConnection();
QueueSession session = connect.createQueueSession(true,
Session.AUTO_ACKNOWLEDGE);
QueueSender sender = session.createSender(queue);
ObjectMessage msg = session.createObjectMessage(new OrderVO());
//sender.send(msg, DeliveryMode.PERSISTENT, 0, 3000);
sender.send(msg);
connect.close();
} catch(NamingException e) {
e.printStackTrace();
} catch(JMSException e) {
e.printStackTrace();
}
}
}
CAN someone please tell me why my MDB does not get any messages ?
Many thanks and any comments are welcome!
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user