|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Websphere, JMS, and JNDI |
« View previous topic :: View next topic » |
Author |
Message
|
mikeoca |
Posted: Mon Jan 09, 2006 11:12 pm Post subject: Websphere, JMS, and JNDI |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 2
|
I am experienced in JMS, but just getting started using JMS on Websphere. I am trying to set up and use Websphere MQ JMS Server on Websphere 5.1, which comes with a trial version. I have read several books, and have been learned to use CRTMQM to make a queue in MQ, then use the Websphere admin console to associate that queue with JMS objects, making the connection factory and destination, finally using JMSAdmin to store the connection factory and destination objects in JNDI. I have also written/modified a couple of test clients.
So far, so good.
The problem is that I have only been able to get things working with:
INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory
I would like to make the objects available to remote systems. There are two likely contexts listed in the shipped JMSAdmin.config:
INITIAL_CONTEXT_FACTORY=com.ibm.ejs.ns.jndi.CNInitialContextFactory
INITIAL_CONTEXT_FACTORY=com.ibm.websphere.naming.WsnInitialContextFactory
but only one potential URL:
PROVIDER_URL=iiop://localhost:2809/
I don't think that's the default port number, I may have changed it because the default port number was not in use on my installation.
Do either of those two factories point to a running Websphere JNDI provider? ...to a running MQ JNDI provider? How would I determine the port number? Are those classes available only for the IBM JVM? Is com.sun.jndi.cosnaming.CNCtxFactory the Sun JVM equivalent of com.ibm.websphere.naming.WsnInitialContextFactory?
I have set my CLASSPATH to:
%MQLIB%\com.ibm.mq.jar
%MQLIB%\com.ibm.mq.pcf.jar
%MQLIB%\mqcontext.jar
%MQLIB%\com.ibm.mqbind.jar
%MQLIB%\com.ibm.mqjms.jar
%MQLIB%\connector.jar
\%MQLIB%\jms.jar
%MQLIB%\jndi.jar
%MQLIB%\jta.jar
%MQLIB%\providerutil.jar
%MQLIB%\fscontext.jar
%MQLIB%\ldap.jar
%WSLIB%\j2ee.jar
%WSLIB%\naming.jar
%WSLIB%\namingclient.jar
%WSLIB%\namingserver.jar
%WSLIB%\ras.jar
%WSLIB%\wsexception.jar
%MQLIB%\bootstrap.jar
%WSLIB%\ecutils.jar
%WSLIB%\iwsorb.jar
%WSLIB%\mq.jar
%WSLIB%\messagingclient.jar
%WSLIB%\ffdc.jar
%WSLIB%\idl.jar
%WSLIB%\utils.jar
%WSLIB%\messaging.jar
%WSLIB%\messagingClient.jar
%WSLIB%\messagingImpl.jar
%WSLIB%\jmsserver.jar
%WSLIB%\jmsserverI.jar
This is probably massive overkill. Research says that I should be able to use:
%MQLIB%com.ibm.mq.jar
%MQLIB%\com.ibm.mqbind.jar
%MQLIB%com.ibm.mqjms.jar
%WSLIB%\ecutils.jar
%WSLIB%\j2ee.jar
%WSLIB%\messaging.jar
%WSLIB%\messagingClient.jar
%WSLIB%\messagingImpl.jar
%WSLIB%\namingClient.jar
In any case, neither have worked for me. Can anyone help me to get rolling with networked JNDI, or should I be using LDAP for that?
If I missed any information, please let me know.
Any and all help appreciated. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 10, 2006 4:40 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Okay.
If you are using CRTMQM, pretty much you are using the embedded messaging.
If you are using the embedded messaging, you shouldn't have to mess with the classspath at all - the MQ_INSTALL_ROOT and MQJMS_LIB_ROOT should already be set properly.
Then you need to create your JNDI Resources in the "WebSphere JMS Provider".
If you are trying to use a full MQ, then you need to set MQ_INSTALL_ROOT (and it will consequently set MQJMS_LIB_ROOT). And you need to create your JNDI Resources in the "WebSphere MQ JMS Provider".
When you're trying to access the WAS JNDI from remote systems.... you have some difficulties in general. The easiest thing to do is install the WebSphere J2EE Application Client on the remote machine, and run your code under that. It's a very heavy-weight installation and not a light client at all.
Also, guess what? The embedded messaging provider doesn't allow you to connect to it from a remote machine. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
mikeoca |
Posted: Tue Jan 10, 2006 12:49 pm Post subject: |
|
|
Newbie
Joined: 09 Jan 2006 Posts: 2
|
Curioser and curioser...
Quote: |
If you are using CRTMQM, pretty much you are using the embedded messaging. |
"Websphere MQ" != "MQSeries"? I am using Websphere MQ because I thought that it had the same administration interfaces as MQSeries.
Quote: |
If you are using the embedded messaging, you shouldn't have to mess with the classspath at all - the MQ_INSTALL_ROOT and MQJMS_LIB_ROOT should already be set properly. |
What script sets these? They're not set in my default environment.
Quote: |
Then you need to create your JNDI Resources in the "WebSphere JMS Provider". |
Now I'm really confused. It is "Websphere JMS MQ Provider" which has the "Base Queue Name" property for queues - wouldn't this be how I link to a queue made with CRTMQM? There is also a "Websphere JMS Provider" which does not have a base queue name property. Both allow me to specify the JNDI name of the created JMS queue. Do I perhaps need to configure the JNDI for the Websphere Application Server?
Quote: |
If you are trying to use a full MQ, then you need to set MQ_INSTALL_ROOT (and it will consequently set MQJMS_LIB_ROOT). And you need to create your JNDI Resources in the "WebSphere MQ JMS Provider". |
This is what I wanted to do, but it seems that I do not have a proper MQSeries.
Quote: |
When you're trying to access the WAS JNDI from remote systems.... you have some difficulties in general. The easiest thing to do is install the WebSphere J2EE Application Client on the remote machine, and run your code under that. It's a very heavy-weight installation and not a light client at all. |
I'd like to avoid this if possible. I think that I shall try LDAP first.
Quote: |
Also, guess what? The embedded messaging provider doesn't allow you to connect to it from a remote machine. |
Yes, I knew that, which is why I wanted to use MQ (I thought I had a trial version of MQSeries, but apparently did not). Is there a develeoper's edition of MQSeries that I can use for testing and development?
Thanks for the help. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jan 10, 2006 2:14 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
WebSphere MQ is the same thing as MQSeries.
There is a messaging provider included with WAS, that is named in the Admin console by 'WebSphere JMS Provider' - that is known as 'embedded messaging' in v5.
I could be wrong about the CRTMQM script being limited to the embedded messaging provider. I've never used it for the stuff I've done with WAS and MQ, though. So go back and check the docs/info center.
If you have seperately installed WebSphere MQ from WAS, then you do have a full MQ and you do need to use the WebSphere MQ JMS Provider. And you manually need to set MQ_INSTALL_ROOT (unless you installed MQ first, in which case the WAS installer should have set this) in the WebSphere Variables in the Environment section in the Admin console. And then confirm that MQJMS_LIB_ROOT is set relative to MQ_INSTALL_ROOT, and has the correct path to the Java subpath of the MQ Install root.
I also misspoke a little bit in mentioning the J2EE Application Client. Just having access to the JNDI, even by way of LDAP, isn't necessarily going to help. The WAS Context Factory is a very heavy weight thing, and there are several other posts here about trying to get at it without using the full WAS J2EE Application Client. In my opinion, it is not worth a lot of your time trying to do this without installing the app client.
The trial version is the best you're going to get without purchasing the product. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|