Hello,
I am using Websphere 4.0 Single Server Edition and I am installed the WAS4.0 and MqSeries in the same system(Window
NT). I don't know how to configure it for mqseries in WAS4.0 admin console. I already worked with was3.5/MQSeries and
configured it successfully.
In Websphere--> Resources-->JMS Providers-->IBM MQSeries
1. Server classpath : D:\Program Files\MQSeries\java\lib;D:\Program
files\MQSeries\java\lib\com.ibm.mq.jar;D:\Program Files\MQSeries\java\lib\com.ibm.mqjms.jar
2. External Initial Context Factory: com.ibm.websphere.naming.WsnInitialContextFactory
3. External Provider URL :
iiop://localhost In Websphere--> Resources-->JMS Providers-->IBM MQSeries -->JMS Destinations
1. Name : Q1
2. JNDI Name : jms/Q1
3. Destination Type : Queue
4. External JNDI Name: jms/Q1
In Websphere--> Resources-->JMS Providers-->IBM MQSeries -->JMS Connection Factory
1. Name : QM1
2. JNDI Name : jms/QM1
3. Connection Type : Queue
4. External JNDI Name: jms/Q1
I am not sure about the external jndi name. Similarly for Connection Factory configuration.
if i run the following
servlet it gives the following error message:
Inside the try loop Initial Context Factory: javax.naming.InitialContext@7be837eb Inside the setConnection Method Naming
Exception is occured: javax.naming.NameNotFoundException: Name comp/env/jms not found in context "java:".
In the servlet doGET method i am sending a message to the MQSeries QueueManager -QM1 ; Queue - Q1.
PrintWriter out= null;
QueueConnection connection=null;
QueueSession session=null;
QueueSender sender=null;
InitialContext ic = null;
try
{
out= response.getWriter();
}catch(IOException io)
{
System.out.println("IOException occured: " + io);
}
try {
out.println("Inside the try loop ");
ic = new InitialContext();
out.println("Initial Context Factory: " + ic);
} catch (NamingException ne) {
out.println("Naming Exception is occured: " + ne);
}
try {
out.println("
Inside the setConnection Method");
Queue queue = (Queue) ic.lookup("java:comp/env/jms/Q1");
out.println("
Queue connection be created");
QueueConnectionFactory factory = (QueueConnectionFactory) ic.lookup("java:comp/env/jms/QM1");
sender = session.createSender(queue);
sender.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
sender.setPriority(4);
sender.setTimeToLive(0);
out.println("1");
connection = factory.createQueueConnection();
out.println("2");
session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
out.println("3");
connection.start();
TextMessage message = session.createTextMessage("Narayana");
sender.send(message);
}
catch (NamingException ne1) {
out.println("Naming Exception is occured: " + ne1);
}catch(JMSException je)
{
out.println("JMS Exception is occured: " + je);
}
Thanks in advance.
Regards,
M.S.Raman