Author |
Message
|
texan |
Posted: Mon Nov 01, 2004 5:56 am Post subject: JMSAdmin in WAS5.1 |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
I am in process of migrating my J2EE app. from WAS4 to WAS5.1. Under WAS4, we defined several MQ objects in JNDI using JMSAdmin tool. Does anyone know how to run JMSAdmin with WAS5.1? I tried several options and none of them worked. So I used WAS5 admin console to define these objects. But I am getting the following problem when accessing QueueConnection factory.
java.lang.ClassCastException: com.ibm.ejs.jms.JMSQueueConnectionFactoryHandle
Does anyone know why? I searched several places but could not find anything similar to this. I appreciate your help and time. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Nov 01, 2004 6:25 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You shouldn't use JMSAdmin with version 5, as the objects you create will not be persistent.
Did you define the object that is giving you trouble under "Websphere JMS Provider", or 'WebSphere MQ JMS Provider", or some other provider?
Did you configure MQ_INSTALL_ROOT properly in the server Variables?
Do you have WebSphere MQ installed on the same machine as the WAS server? Do you have a full server, a client, or just the Java client? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
texan |
Posted: Mon Nov 01, 2004 6:38 am Post subject: |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
1) You shouldn't use JMSAdmin with version 5, as the objects you create will not be persistent..
--- I could not even create objects. After running JMSadmin, I got initial context prompt. If I run any command like "dis ctx" am getting problem.
2) Did you define the object that is giving you trouble under "Websphere JMS Provider", or 'WebSphere MQ JMS Provider", or some other provider?
----I created them under 'WebSphere MQ JMS Provider"
3) Did you configure MQ_INSTALL_ROOT properly in the server Variables?
----Yes. It was pointed to my install directory. (C:\WMQ). Do I have to point it to bin or java folder?
4)Do you have WebSphere MQ installed on the same machine as the WAS server? Do you have a full server, a client, or just the Java client?
---- Both WAS and MQ are on same machine. I have a full MQ server.
I am testing this migration on my local machine. Everything is on one machine. Infact I have both WAS4.5 and WAS5.1 on same box. Currently I stopped WAS4.5 and working on WAS51. |
|
Back to top |
|
 |
vennela |
Posted: Mon Nov 01, 2004 7:20 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Do you have the right JDK version?
Do you have the right MQ java libraries?
What version of MQ?
Exactly at what point are you getting the error? |
|
Back to top |
|
 |
texan |
Posted: Mon Nov 01, 2004 8:52 am Post subject: |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
Do you have the right JDK version?
--- what ever comes with WAS51. I believe it is 1.4.1.
Do you have the right MQ java libraries?
----I think I do. They worked fine with WAS4.5.
What version of MQ?
-----5.3 CSD 5.
Exactly at what point are you getting the error?
-----The same program that worked fine with WAS4.5 is giving problem for WAS51. This program is looking up for QCF and upon finding it, we are casting it. Currently we are casting this with MQQueueConnectionFactory.
I did a dumpNameSpace and here is what I found between WAS4.5 and WAS51.
XXQCF javax.jms.QueueConnectionFactory
XXQCF com.ibm.mq.jms.MQQueueConnectionFactory
Do you know why thety are different? |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Nov 01, 2004 9:03 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So this is really a programming problem, and not a setup problem.
According to the Using Java manual, you should be casting it to a plain QueueConnectionFactory
Code: |
QueueConnectionFactory factory;
factory = (QueueConnectionFactory)ctx.lookup("cn=ivtQCF"); |
Instead of casting to an MQQueueConnectionFactory. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
texan |
Posted: Mon Nov 01, 2004 9:06 am Post subject: |
|
|
Acolyte
Joined: 25 Feb 2004 Posts: 74
|
The issue is: if I use JMSAdmin in WAS4.5, it created QCF with MQQueueConnectionFactory. JMSAdmin is not supported in WAS51. So if you use was51 console, it is creating QCF with QueueConnectionFactory. I really do not want to change the code. The same code should be working fine in WAS51. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Nov 01, 2004 9:17 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I'm fairly sure that 5.1 supports a newer JMS release than 4.5. I suspect that is why you are having difficulties, and that the difficulties you are having are due to changes in JMS.
So you'll likely have to change your code. And it's not IBM's fault.
Did you know that the EJB 3.0 spec is not going to be backwards compatible with the EJB 2.0 spec? Isn't that fun? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Nov 01, 2004 12:42 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Any of the adjustments you might have done using MQQueueConnectionFactory class you will have to incorporate in the JNDI setup. Pretty easy in the admin console of WAS 5.1.
Just use the plain QueueConnectionFactory. Under the covers you still have an MQQueueConnectionFactory.
I suspect 2 factors here. You may well have declared all the jar files correctly but did you add them to the MQ_INSTALL_ROOT variable as requested in the WAS MQ JMS setup documentation? It is not enough to just point to the directory, you need to add all the jars as well.
Your case should show:
Code: |
C:\wmq\java\lib;c:\wmq\java\lib\jdbc;c:\wmq\java\lib\....jar
|
Add each jar file individually like in a classpath.
Of course I expect you to have c:\wmq\java\lib and c:\wmq\java\lib\jdbc defined as part of your path variable as well. (library_path or equivalent in unix)
Update your MQ_INSTALL_ROOT variable and let us know if it works.
Enjoy 
Last edited by fjb_saper on Tue Nov 02, 2004 12:41 pm; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Nov 01, 2004 1:54 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
fjb_saper wrote: |
You may well have declared all the jar files correctly but did you add them to the MQ_INSTALL_ROOT variable as requested in the WAS MQ JMS setup documentation? It is not enough to just point to the directory, you need to add all the jars as well. |
I haven't had to do that. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Nov 02, 2004 12:37 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Jeff,
If you did not add the jars to MQ_INSTALL_ROOT you sure did add the jars to the classpath somewhere or you did not use full blown MQ but only the embedded version.
You are supposed to add the jars to the MQ_INSTALL_ROOT variable as this allows you to use only javax.jms classes in your app. and you do not have to add any of the MQ jars to the app classpath.
We ran into a bunch of problems with our MDB's when the MQ_INSTALL_ROOT got corrupted for some reason (misspelling of one of the critical mq jars: com.ibm.mqbind.jar). We are running on AIX....
Enjoy  |
|
Back to top |
|
 |
|