Author |
Message
|
tapak |
Posted: Fri Aug 25, 2006 9:48 am Post subject: How to Connect to mq using Channel tab file in java |
|
|
 Centurion
Joined: 26 Oct 2005 Posts: 149 Location: Hartford,CT
|
The following link give an example.
http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/csqzaw1425.htm
But I dont have the option to pass the java.net.url object to the constructor as specified in the link. Is it only supported for Ver6 client .If yes , is there a way to do with ver5 client jars .
Here is the text from the link
Quote: |
java.net.URL chanTab1 = new URL("file:///home/admdata/ccdt1.tab");
As another example, suppose the file ccdt2.tab contains a client channel definition table and is stored on a system that is different to the one on which the application is running. If the file can be accessed using the FTP protocol, the application can create a URL object in the following way:
java.net.URL chanTab2 = new URL("ftp://ftp.server/admdata/ccdt2.tab");
After the application has created a URL object, the application can create an MQQueueManager object using one of the constructors that takes a URL object as a parameter. Here is an example:
MQQueueManager mars = new MQQueueManager("MARS", chanTab2);
|
|
|
Back to top |
|
 |
tleichen |
Posted: Fri Aug 25, 2006 10:08 am Post subject: |
|
|
Yatiri
Joined: 11 Apr 2005 Posts: 663 Location: Center of the USA
|
Hmmm... I just came across a similar problem with someone here on this subject. I'm not sure of the answer either, but want to take a ride on this one myself to see where it leads....  _________________ IBM Certified MQSeries Specialist
IBM Certified MQSeries Developer |
|
Back to top |
|
 |
tapak |
Posted: Fri Aug 25, 2006 10:35 am Post subject: |
|
|
 Centurion
Joined: 26 Oct 2005 Posts: 149 Location: Hartford,CT
|
Looks like it is only for Ver6 . I am not sure if there is an alternate way to do with Ver5.3 client jars. |
|
Back to top |
|
 |
wschutz |
Posted: Fri Aug 25, 2006 11:38 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
tapak wrote: |
Looks like it is only for Ver6 . I am not sure if there is an alternate way to do with Ver5.3 client jars. |
No, using client channel tables from Java is only supported in the V6 client.... but.... You don't need a V6 server, only the V6 client (which you can download free from the s/p site), and the V6 client will work wit the V5 server. _________________ -wayne |
|
Back to top |
|
 |
tapak |
Posted: Fri Aug 25, 2006 12:27 pm Post subject: |
|
|
 Centurion
Joined: 26 Oct 2005 Posts: 149 Location: Hartford,CT
|
Hi Wayne ,
Thanks for the info. Will there be an issue with installing a Ver6 client in a Ver53 server . I will be doing client connection from v53 machine to other v53 machines .
In case ,if it is a problem , can I just have the V6 jar files and try to use that in my classpath for the Java application in v53 machine . |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Aug 25, 2006 2:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You can only use the V6 jars for client connection as you already have V5 installed. You will need to have the V6 jars installed in a different directory and have them in the right sequence on the classpath. (do not mix V5 and V6 jars on the classpath you might get into trouble).
Access in bindings will only work using your 5.3 jars.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
tapak |
Posted: Mon Aug 28, 2006 9:11 am Post subject: |
|
|
 Centurion
Joined: 26 Oct 2005 Posts: 149 Location: Hartford,CT
|
Hi fjb_saper
Thank you for the inputs .
I got the mq client6 jars .But I am getting mq error code 2278 while trying to use the channel table . Here is my code which gives error . I am trying to connect from windows to a solaris queue manager using client connection channel table.
java.net.URL chanTab1 = new URL("file:C:/deepak/chltab/AMQCLCHL.TAB");
qMgr = new MQQueueManager("qmname, chanTab1); |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Aug 28, 2006 9:38 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
try "file://C:/deepak/chltab/AMQCLCHL.TAB".
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
tapak |
Posted: Mon Aug 28, 2006 10:37 am Post subject: |
|
|
 Centurion
Joined: 26 Oct 2005 Posts: 149 Location: Hartford,CT
|
I tried that too. It looks like it is related to my mqv6 client . I am not able to connect to v53 using amqsputc .
Here is the error in the client and server .
Client Error
8/28/2006 14:28:48 - Process(3768.1) User(username (edited) Program(amqsputc.exe)
AMQ9202: Remote host '' not available, retry later.
EXPLANATION:
The attempt to allocate a conversation using to host '' was not successful.
However the error may be a transitory one and it may be possible to
successfully allocate a conversation later.
ACTION:
Try the connection again later. If the failure persists, record the error
values and contact your systems administrator. The return code from is 0
(X'0'). The reason for the failure may be that this host cannot reach the
destination host. It may also be possible that the listening program at host ''
was not running. If this is the case, perform the relevant operations to start
the listening program, and try again.
Server Error
08/28/06 02:22:47 PM
AMQ9209: Connection to host 'hostname (apaddrr edited)' closed.
EXPLANATION:
An error occurred receiving data from 'hostname (apaddrr edited)' over TCP/IP.
The connection to the remote host has unexpectedly terminated.
ACTION:
Tell the systems administrator.
----- amqccita.c : 2736 -------------------------------------------------------
08/28/06 02:22:47 PM
AMQ9228: The TCP/IP responder program could not be started.
EXPLANATION:
An attempt was made to start an instance of the responder program, but the
program was rejected.
ACTION:
The failure could be because either the subsystem has not been started (in this
case you should start the subsystem), or there are too many programs waiting
(in this case you should try to start the responder program later). The reason
code was 0. |
|
Back to top |
|
 |
wschutz |
Posted: Mon Aug 28, 2006 3:49 pm Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
tapak...I'm a little confused...are you trying to connect via the java client or the "c" client (since it looks like amqsputc is involved)... can you give your exact configuration (os' versions, csd , which clients you are using and whether there is a channel table involved or your are using MQSERVER)? _________________ -wayne |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Aug 28, 2006 3:54 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
As well I hope you did not install the full V6 client on your V5 machine. That would be seriously messed up. I had said only V6 jars _________________ MQ & Broker admin |
|
Back to top |
|
 |
tapak |
Posted: Tue Aug 29, 2006 6:04 am Post subject: |
|
|
 Centurion
Joined: 26 Oct 2005 Posts: 149 Location: Hartford,CT
|
Wayne ,
Listing down my server version. I installed mq v6 client to connect to v53 server using java client .It was not working. After that I tried amqsputc using the MQSERVER variable . I reinstalled MQClientv6 2 times to make sure that there was no issue with installation . But still I was getting the same error for amqsputc listed in my earlier post.
I reinstalled MQv53 and then amqsputc was working. By the way I was using hostname instead of IPaddress. Does that cause an issue with V6 client.
I will try using v6 jars as suggested by fjb_saper.
Name: WebSphere MQ
Version: 530.11 CSD11
CMVC level: p530-11-L050802
BuildType: IKAP - (Production) |
|
Back to top |
|
 |
tapak |
Posted: Tue Aug 29, 2006 7:28 am Post subject: |
|
|
 Centurion
Joined: 26 Oct 2005 Posts: 149 Location: Hartford,CT
|
I installed mqver6 client before I got your message. I reinstalled mqv53 and tried setting the classpath to ver6 jar files for my java application.
Still I am getting the 2278 error .
Basically I added the following codes to the PCF Sample Code.
System.out.print ("Connecting to queue manager");
java.net.URL chanTab1 = new URL("file://C:/deepak/chltab/AMQCLCHL.TAB");
qMgr = new MQQueueManager("QMMQQA1", chanTab1);
// Convert the URL to a file object
agent = new PCFMessageAgent(qMgr);
Here is the mqv6 jar files I used.Code for setting the classpath and running my java program
@ECHO OFF
set CLASSPATH=
rem set MQ_JAVA_LIB=C:\Program Files\IBM\Websphere MQ\java\lib
set MQ_JAVA_LIB=C:\deepak\mq\mqv6jars\lib
set
CLASSPATH="%CLASSPATH%;%MQ_JAVA_LIB%\com.ibm.mq.jar;%MQ_JAVA_LIB%\connector.jar;%MQ_JAVA_LIB%\fscontext.jar;%MQ_JAVA_LIB
%\providerutil.jar;c:/deepak/javawork/pcf/com.ibm.mq.pcf.jar;"
echo %CLASSPATH%
java PCFMessageListQueueDepth
channel definition is proper as I tried using amqsputc after setting chanlib and chantab mq server variables.
SET MQCHLLIB=C:\deepak\chltab
SET MQCHLTAB=AMQCLCHL.TAB |
|
Back to top |
|
 |
tapak |
Posted: Tue Aug 29, 2006 7:47 am Post subject: |
|
|
 Centurion
Joined: 26 Oct 2005 Posts: 149 Location: Hartford,CT
|
One more additional info which might help. I am using a Server Connection Channel with Blockip security exit.
I will try using a regular channel and see if it helps. |
|
Back to top |
|
 |
tapak |
Posted: Tue Aug 29, 2006 8:04 am Post subject: |
|
|
 Centurion
Joined: 26 Oct 2005 Posts: 149 Location: Hartford,CT
|
using a regular channel didnt helped with my java program. I didnt test mqv6 client as I am on v53 client now. |
|
Back to top |
|
 |
|