Author |
Message
|
Jprog |
Posted: Thu Jan 15, 2004 2:45 pm Post subject: Error Code 2059 |
|
|
 Novice
Joined: 15 Jan 2004 Posts: 10 Location: Greenville, SC
|
Im receiving this error when im running my application on linux though my application run smooth on windows 2000, the JDK installed on both machine is 1.4, both uses the same mq jar file. Have anyone run to this kind of problem and was able to resolved it? |
|
Back to top |
|
 |
vennela |
Posted: Thu Jan 15, 2004 2:48 pm Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Do you have your listener running. I guess you are trying to connect in client mode, see if your listener is running (and at right port, double check your program too).
It's an exhusted topic on java program and 2059 and if you do a search you will get a lot of results and you should have an answer. |
|
Back to top |
|
 |
Jprog |
Posted: Thu Jan 15, 2004 2:52 pm Post subject: |
|
|
 Novice
Joined: 15 Jan 2004 Posts: 10 Location: Greenville, SC
|
>java mqget
Loading properties...
Connecting to MQ manager [QM_NAME]
Unable to load message catalog - mqji
An MQ error occurred : Completion code 2 Reason code 2059
>
Here is the complete error message that i got when running my application on linux machine with the same mq jar file and jdk version
and i dont think theres a firewall issues because i can use telnet
>telnet xx.xxx.xxx.xxx 1414
Trying xx.xxx.xxx.xxx...
Connected to xx.xxx.xxx.xxx.
Escape character is '^]'.
Any ideas and advise are pretty much appreciated. |
|
Back to top |
|
 |
Jprog |
Posted: Thu Jan 15, 2004 3:16 pm Post subject: |
|
|
 Novice
Joined: 15 Jan 2004 Posts: 10 Location: Greenville, SC
|
vennela, thanks for your prompt reply
My application doesnt have any problem when i run it on windows 2000
Loading properties...
Connecting to MQ manager...
Retrieving data...
Queue number: 0
Process queue:Q_IN;Q_EV2_IN Number of messages: 0
Retriveing data...
Queue number: 1
Process queue:Q_IN;Q_EV2_IN Number of messages: 1
Retriveing data...
Filename output: C:\Development\java\MQGET\EV2\1074208171802.1.dat
Press any key to continue... |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Jan 15, 2004 3:57 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Jprog wrote: |
vennela, thanks for your prompt reply |
Did you do the search here for other people who had the same issues with 2059 errors in Java programs that he suggested you do?
Jprog wrote: |
My application doesnt have any problem when i run it on windows 2000 |
Then maybe you should compare the situation that your program runs in on Windows with the situation it runs in on linux. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
Jprog |
Posted: Fri Jan 16, 2004 1:35 pm Post subject: |
|
|
 Novice
Joined: 15 Jan 2004 Posts: 10 Location: Greenville, SC
|
- i mistakenly posted this to another topic, my apology
I tried to search but couldnt find what im looking for, i already tried to have a fresh linux box and installed jdk 1.4 and com.ibm..mq.jar (same jar file im using on my windows machine), but i still have the problem... i dont see any special thing/setup/configuration on my winndows machine and both this machine are on the same network so as the MQ Series server machine(running on windows 2000), and the code im using is a simple conneciton code:
String qManager = myManager;
MQEnvironment.hostname = myHostname;
MQEnvironment.channel = myChannel;
MQQueueManager qMgr = new MQQueueManager(qManager); // ... it stop here and return 2059 |
|
Back to top |
|
 |
mqonnet |
Posted: Fri Jan 16, 2004 1:51 pm Post subject: |
|
|
 Grand Master
Joined: 18 Feb 2002 Posts: 1114 Location: Boston, Ma, Usa.
|
Now what i am not clear with your description is whether you are trying to connect to Linux qm from linux or from windows. Since there is a mention of firewall and network i would assume that you are trying to connect from win2k to llinux qm.
You definitely need the port number where your linux qm listener is listening on.
Here's a snippet code that might help
MQEnvironment.properties.put(MQC.HOST_NAME_PROPERTY, "myHostname");
MQEnvironment.properties.put(MQC.CHANNEL_PROPERTY, "myChannel");
MQEnvironment.properties.put(MQC.PORT_PROPERTY, new Integer(2200));
MQEnvironment.properties.put( MQC.TRANSPORT_PROPERTY, MQC.TRANSPORT_MQSERIES_CLIENT);
Depending upon whether you are running a client or not, you have to bind to either the client or server MQ Java bindings. As in the above snippet it is connecting as a client from Win2k to say Linux.
Cheers
KK |
|
Back to top |
|
 |
JasonE |
Posted: Fri Jan 16, 2004 1:52 pm Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
The 'quickest' way is to take a trace of it, then search the trace for error, exception or 2059 and see if anything sticks out.
The problem is 2059 is such a catchall problem, it could be anything and without knowing a large amount about your setup theres too many variables. A trace shows why it has failed, and you can work backwards as to what you have done wrong... But then again I am used to the traces.
If you can get a trace and cant see anything wrong, email it to me and I'll take a quick look. I'll pm you my email addr |
|
Back to top |
|
 |
Jprog |
Posted: Mon Jan 19, 2004 7:30 am Post subject: |
|
|
 Novice
Joined: 15 Jan 2004 Posts: 10 Location: Greenville, SC
|
To all,
Thanks for the help. I finally got my problem resolved using the given snippet , though im curious by the way it behave on linux, my MQ server is running on windows, the client code on linux (not running before) and client code on windows (doesnt have any problem at all) are the same, so what i understand is that on windows port 1414 is use by the default and not on linux box, or are there any difference from using the code
MQEnvironment.hostname = qHostname;
and
MQEnvironment.properties.put(MQC.HOST_NAME_PROPERTY, "myHostname");
anyway its working now, thanks again.
JasonE, what kind of trace are you referring to? i'd like to know how you do it so i can apply it incase i encounter a problem again.
Thanks |
|
Back to top |
|
 |
vennela |
Posted: Mon Jan 19, 2004 7:46 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
Quote: |
or are there any difference from using the code
MQEnvironment.hostname = qHostname;
and
MQEnvironment.properties.put(MQC.HOST_NAME_PROPERTY, "myHostname");
|
NO
There is no difference |
|
Back to top |
|
 |
JasonE |
Posted: Mon Jan 19, 2004 7:56 am Post subject: |
|
|
Grand Master
Joined: 03 Nov 2003 Posts: 1220 Location: Hursley
|
1414 is the default unless overriden.
Which Trace? Depends on the problem. In your case it would be a Java trace, ie:
<copied from somewhere...!>
For the standard MQ JAVA API, here are several techniques which may be tried.
The first, best and simplest requires that you can rebuild (recompile) the application. You can enable MQ Java API tracing using the information in the Using Java manual, basically by adding the following to the start of your app:
import java.io.*;
.
.
.
try
{
FileOutputStream tracefile = new FileOutputStream("mqjava.trc");
MQEnvironment.enableTracing(5,tracefile);
}
catch(IOException ex)
{
MQEnvironment.enableTracing(5);
}
The catch block enables tracing to the console if the creation of mqjava.trc fails.
Note that in both cases, the trace level is being set to the maximum, 5. The resultant trace output does not need to be formatted, it is in ascii format. |
|
Back to top |
|
 |
Jprog |
Posted: Mon Jan 19, 2004 8:07 am Post subject: |
|
|
 Novice
Joined: 15 Jan 2004 Posts: 10 Location: Greenville, SC
|
|
Back to top |
|
 |
|