Hi Patrick,
I believe your call is incorrect because you are passing a String value
to the method (i.e. MQC.MQOO_OUTPUT). To get the value of this field,
you need to call java::field MOC.MOOO_OUTPUT.
Hope this helps,
Regards,
James Graham
> Subject: [tcljava-user] JACL - convert Tcl string to java int.
> Reply-To: tcl...@li...
>
> This is a multipart message in MIME format.
> --=_alternative 00100FCE48257060_=
> Content-Type: text/plain; charset="US-ASCII"
>
> Running Tclblend 1.3.2 on Windows XP.
>
> Writing JACL script to send/retrieve messages to IBM MQSeries on
> Mainframe.
>
> Java code looks like;
>
> qMgr = new MQQueueManager(qManager);
> // Set up the options on the queue we wish to open...
> // Note. All WebSphere MQ Options are prefixed with MQC in Java.
> //##### openOptions is defined as integer ####.
> int openOptions = MQC.MQOO_INPUT_AS_Q_DEF |
> MQC.MQOO_OUTPUT ;
>
> // Now specify the queue that we wish to open,
> // and the open options...
> MQQueue system_default_local_queue =
> qMgr.accessQueue("SYSTEM.DEFAULT.LOCAL.QUEUE",
> openOptions);
>
> JACL code looks like.
>
> set MQQueueManager [ java::new com.ibm.mq.MQQueueManager XXXX ]
>
> set queueName XXX.XX.XXXX.0059.XXXX
> append openOptions MQC.MQOO_OUTPUT
> append openOptions " | "
> append openOptions MQC.MQOO_INPUT_AS_Q_DEF
>
> set accessQueue [ $MQQueueManager accessQueue $queueName $openOptions ]
>
> ##################################333
>
> Calling the accessQueue method generates the error:
>
> ----------------------
> expected integer but got "MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_AS_Q_DEF"
> while executing
> "$MQQueueManager accessQueue $queueName $openOptions "
> ----------------------
>
> $openOptions needs to be defined as an integer but it's not being
> converted in the method call.
>
> Doco says:
>
> "Tcl values are also be converted to Java objects and primitive Java types
> when they are given as arguments to Java commands. The default conversion
> for all Tcl values is a java.lang.String object. To override this default
> a full signature must be provided for Java method invocations".
>
> java::info method for MQQueueManager returns "{accessQueue
> java.lang.String int}".
>
> I tried "set accessQueue [ $MQQueueManager { accessQueue java.lang.String
> int } $queueName $openOptions ] "
>
> and got:
>
> expected integer but got "MQC.MQOO_OUTPUT | MQC.MQOO_INPUT_AS_Q_DEF"
> while executing
> "$MQQueueManager { accessQueue java.lang.String int } $queueName
> $openOptions "
>
> How do I specify the full signature for method invocations do enable this
> conversion?
>
> Regards.
>
> Patrick.
> ===================================================
> HBF Health Funds Inc. a registered organisation under the National Health Act
> HBF Insurance Pty Ltd ACN 009 268 277
> This email is a confidential communication intended only for the named Addressee(s).
> If you are not that person any disclosure, copying, distribution or use of this email
> or the information in it is prohibited. Please notify us immediately by
> telephone, (+61) 08 9265 6111 or return email and delete this email.
> The views in this email may be personal to the author and not those of HBF.
>
--
James T. Graham
Software Development Manager
Design Automation
jg...@mo...
__________________________________
Monolithic System Technology, Inc.
1020 Stewart Dr.
Sunnyvale, CA 94085
Phone: (408) 731-1891
Fax: (408) 731-1893
|