aspose file tools*
The moose likes Websphere and the fly likes JMS in WAS 4.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "JMS in WAS 4.0" Watch "JMS in WAS 4.0" New topic
Author

JMS in WAS 4.0

krish chandru
Ranch Hand

Joined: Apr 27, 2001
Posts: 39
all,
Is there any document stating the method of creating the JMS application under WAS4.0. I am not having any clue reg the ways of creating the topic ! is there any tool to develop that ?
thanx in advance
kaycee
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
To use JMS with WebSphere 4.0 you must purchase or download an evaluation copy of IBM MQ Series 5.2. A JMS provider is not included in the WebSphere download -- MQ Series is the only supported HJMS provider.
Then download the MA88 support pack (MQ Series JMS support) and use the JMS Admin tool there to create topics...
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
krish chandru
Ranch Hand

Joined: Apr 27, 2001
Posts: 39
kyle,
i have IBM MQ series installed in my machine. i came to know that message driven beans are not suppored in WAS 4.0. i am looking for some information through which i can configure my websphere to contact the message queues. i used jmsadmin. but i got an error like "jndi initialisation failed. check your jndi settigs". i am not sure where i should check these setigs. can u please help me in this regard.
thanx and regards
kaycee
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Are you using WAS 4.0 AE or AEs? (Configuration differs slightly between the two)
Kyle
------------------
Kyle Brown,
Author of Enterprise Java (tm) Programming with IBM Websphere
See my homepage at http://members.aol.com/kgb1001001 for other WebSphere information.
krish chandru
Ranch Hand

Joined: Apr 27, 2001
Posts: 39
I am using websphere advanced single server edition
Daniel Lilavois
Greenhorn

Joined: Dec 03, 2001
Posts: 2
Hello,
I am using WAS 4.0 AE on one machine (with the MA88 classes installed) and MQSeries 5.2 (w/ the MA88 classes) on another machine. I configured & tested JMSAdmin on the WAS machine and it works fine; I have also defined the appropriate JMS resources in the WAS AdminConsole...are there **any** other steps I would have to do in order for the WAS machine to communicate properly to the MQSeries machine? Thanks in advance.
Danny
dlilavois@tradepointsys.com
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi,
I am using Websphere 4.0 Single Server Edition and I am installed the WAS4.0 and MqSeries in the same system. I don't know how to configure it for mqseries in WAS4.0 admin console.
I gave the server classpath as <MQSeries root>/lib;+ jar files;
In the JMS Destination :
Name as Q1; JNDI Name : jms/Q1 ; External JNDI Name : jms/Q1.
I am not sure about the external jndi name. Similarly for Connection Factory configuration. Please let me know the configuration details. It's work fine with WAS3.5

Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
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
Malli Raman
Ranch Hand

Joined: Nov 07, 2001
Posts: 312
Hi,
I am successfully configured the JMS to MQSeries for WAS4.0.
Refer the following URL: http://www7b.boulder.ibm.com/wsdd/library/techtip/0112_cox.html http://www7b.boulder.ibm.com/wsdd/library/techtip/0112_cox.html
But Still I am facing one more problem that i am able to send and receive message for point to point successfully, but after stopping the server i am losing the JMS administered details.
Again to run it , I have to run the JMSAdmin -t -cfg JMSAdmin.config. How to store the details permanently.

Regards,
M.S. Raman.

Gobi nathan
Greenhorn

Joined: Feb 22, 2003
Posts: 1
Hi Malli ,
Can you send me how you solved that error.
When i try to run JMSAdmin -t -cfg JMSAdmin.config
I am getting the following message.
Starting MQSeries classes for Java(tm) Message Service Administration
JNDI initialisation failed, please check your JNDI settings and service

I have set the following
INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
PROVIDER_URL=iiop://localhost:900

My JMSAdmin.bat file is
C:/WebSphere/AppServer/java/jre/bin/java -DMQJMS_LOG_DIR="%MQ_JAVA_INSTALL_PATH%"\log -DMQJMS_TRACE_DIR="%MQ_JAVA_INSTALL_PATH%"\trace -DMQJMS_INSTALL_PATH="%MQ_JAVA_INSTALL_PATH%" com.ibm.mq.jms.admin.JMSAdmin %1 %2 %3 %4 %5
I am trying to configure in WAS4.0 Single server
-Gobi.
Brian Stelzer
Greenhorn

Joined: Feb 22, 2003
Posts: 1
I had this problem as well, first off you need to use the CNInitialContextFactory instead of the WsnInitialContextFactory(Bug!). Also visit this site http://www7b.boulder.ibm.com/wsdd/library/techtip/0111_cox.html
and create .bat or .sh to set up your environmental variables( instructions on how to do this are at the site ). You might need to include some more librarys than the ones listed as part of there .bat file. Just run JMSAdmin and see what its missing and add them to the .bat.
Now I'm on to the next step of creating a sender but I'm getting a javax.jms.InvalidDestination: MQ2008: cannot open Queue. So if anyone has ideas on this it would be appreciated.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JMS in WAS 4.0