ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ API Support » VB.NET MQ 6.0 Hashtables broken?

Post new topic  Reply to topic
 VB.NET MQ 6.0 Hashtables broken? « View previous topic :: View next topic » 
Author Message
PeterPotkay
PostPosted: Thu Apr 06, 2006 10:11 am    Post subject: VB.NET MQ 6.0 Hashtables broken? Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Windows XP SP2
MQ 6.0.1.0
.Net Framwork 1.1.4322
Both amqmdnet.dll and amqmdxcs.dll are registered.

This code used to work just fine up to MQ 5.3.0.12:
Code:

            Dim myHashTable As New Hashtable
            myHashTable.Add(IBM.WMQ.MQC.CHANNEL_PROPERTY, ComboBoxClientChannel.Text)
            myHashTable.Add(IBM.WMQ.MQC.HOST_NAME_PROPERTY, ComboBoxHostname.Text)
            myHashTable.Add(IBM.WMQ.MQC.PORT_PROPERTY, ComboBoxPortNumber.Text)
            '************************************************
            '    Connect to the QM
            '***********************************************
            myQM = New MQQueueManager(ComboBoxQMName.Text, myHashTable)

Since I upgraded to 6.0.1.0, the above code throws the following error when I step into the New MQQueueManager method:
Quote:

An unhandled exception of type 'System.InvalidCastException' occurred in amqmdnet.dll

Additional information: Specified cast is not valid.


If I change the code and use the constructor which specifies the QM Name, Channel Name and Host seperatly like below, it works:
Code:

myQM = New MQQueueManager(qmNamet, channelName, hostName)


Any ideas why the hashtable way is bombing in 6.0.1.0 when it used to work in 5.3.0.12?
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mvic
PostPosted: Thu Apr 06, 2006 10:22 am    Post subject: Re: VB.NET MQ 6.0 Hashtables broken? Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

PeterPotkay wrote:
Any ideas why the hashtable way is bombing in 6.0.1.0 when it used to work in 5.3.0.12?

At first sight, this is a strong case to present to Support.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Apr 06, 2006 10:45 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

My first thought is that the .NET environment changed what "Hashtable" is, or the MQ .NET API changed what it uses for MQEnvironment to be something other than a Hashtable.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Thu Apr 06, 2006 11:15 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

The tooltip says it needs SYSTEM.COLLECTIONS.HASHTABLE. And the debugger window does show the hashtable being built.

Fo ha-has, I changed:
Code:

Dim myHashTable As New Hashtable

to
Code:

Dim myHashTable As New System.Collections.Hashtable


Same results. Opening a PMR....will post the results
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Thu Apr 06, 2006 11:30 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

aha, figured it out (5 minutes after the PMR was sent)

I changed this:
Code:

'myHashTable.Add(IBM.WMQ.MQC.PORT_PROPERTY, ComboBoxPortNumber.Text)

to this:
Code:

Dim portnum As Integer
portnum = 1414
myHashTable.Add(IBM.WMQ.MQC.PORT_PROPERTY, portnum)


Apparently 6.0.1.0 needs an Integer for the port number, whereas 5.3.0.12 took text.

Time to go bang my head against the monitor and figure out how to convert the GUI's textbox for the port from text to an int. (I'm not a VB guy)

-Peter
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
sebastianhirt
PostPosted: Thu Apr 06, 2006 11:40 am    Post subject: Reply with quote

Yatiri

Joined: 07 Jun 2004
Posts: 620
Location: Germany

In case you haven't found out yet

http://www.knowdotnet.com/articles/dbnulls2.html

is suggesting

Code:
public static int MNI(object i)
    {
      if(i==System.DBNull.Value)
        return 0;
      else
        return Convert.ToInt32(i);
    }
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Apr 07, 2006 10:37 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Huh. For once it was easy and intuitive. This works:
Code:

Dim portNumber As Integer
portNumber = ComboBoxPortNumber.Text

ComboBoxPortNumber is a ComboBox with a pull down menu with port #s to choose from. Free form data entry is not allowed, so the value of ComboBoxPortNumber.Text will always be a number.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
mvic
PostPosted: Fri Apr 07, 2006 10:45 am    Post subject: Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

PeterPotkay wrote:
portNumber = ComboBoxPortNumber.Text

Huh indeed. This is number=text. Not at all intuitive
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Fri Apr 07, 2006 10:56 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Without using the pulldown, you should be able to do stuff with VB to convert a text to a number.

Try just setting an Integer = the value of the free form Text box.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Apr 07, 2006 10:58 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

But then they can add a port numbner of ABCD. I wasn't able to find a way to restrict the entry to numbers only.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Fri Apr 07, 2006 11:08 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

PeterPotkay wrote:
But then they can add a port numbner of ABCD. I wasn't able to find a way to restrict the entry to numbers only.


Have you tryed the stringfunction co (contains only) mystring.co("0123456789"). Should be there somewhere just don't ask me about the M$ implementation...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
jefflowrey
PostPosted: Fri Apr 07, 2006 11:09 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

PeterPotkay wrote:
But then they can add a port numbner of ABCD. I wasn't able to find a way to restrict the entry to numbers only.


Yeah, but the program will throw an error trying to do the conversion. And you can catch that error, and tell them to try again, or let the error turn into a pop-up window.

But if you're happy providing a pop-up that covers all values from 0 to 65535 (the range of allowabled TCP/IP port numbers) then more power to you.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Fri Apr 07, 2006 11:32 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

I just listed all the port #s we have in use here for MQ. Its a little tool for my team to use. Obviously if it was a "real" app, I would take the time to do it right, if I was a "real" programmer.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Wed Apr 12, 2006 5:48 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Update from my PMR. Huh again. Sounds like they will allow a string to be passed in for the port number.

Code:

IBM Update Apr 7, 2006 1:26:00 PM UTC
Action Taken: Received the following email from customer.               
.                                                                       
Tameka,                                                                 
I figured out the problem. In 5.3, amqmdnet.dll would accept a text     
string for the port # when passed inside a hashtable. But in the 6.0   
version, it became more restrictive, and required the port number to be
of the type Integer. Once a passed the port number variable as an       
Integer, it worked.                                                     
.                                                                       
Is this (I guess logical) restriction by design in 6.0? Or             
unintentional? Does IBM still want amqmdnet.dll to accept the port # as
a text string in 6.0 like it did in 5.3, and so we have a bug? Or was   
the bug in 5.3 in that it accepted a text string in 5.3?               
.                                                                       
-Peter   


IBM Update Apr 11, 2006 11:48:00 AM UTC
Hello,                                                                 
.                                                                       
The issue reported by the customer has already been identified as an MQ
Problem and it is being handled through an internal defect(101016). The
development team is working on this and the fix is tentatively scheduled
to be available in the next fix pack.                                   
.                                                                       
This information is documented in PRB #2927.                           
.                                                                       
Thanks and Regards,                                                     
Praveen                                                                 
MQL3CR        MQAPR06PI

_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Leigh Kendall
PostPosted: Wed Apr 12, 2006 10:57 am    Post subject: Reply with quote

Acolyte

Joined: 10 Apr 2003
Posts: 66
Location: Hartford, CT

Peter -

Check whether you have Option Strict on or off. In any event, you may want to cast the .text value to an int using either System.ConvertToInt32 of VB's CInt function.

HTH,
_________________
Leigh Kendall
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ API Support » VB.NET MQ 6.0 Hashtables broken?
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.