|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
MQEnvironment Problem |
« View previous topic :: View next topic » |
Author |
Message
|
zico |
Posted: Wed Dec 14, 2005 1:44 am Post subject: MQEnvironment Problem |
|
|
Novice
Joined: 22 Jun 2005 Posts: 21
|
Hi,
I have a java program for reading messages from a queue which is running in two different Sun Solaris machines but the problem is, it cannot run properly in one Solaris box. In other Solaris box it is OK.
In the java code no line is being executed after I set MQEnvironment.host = '192.12.12.134';. Nothing even catch in the exception. As i mentioned the same code is running OK in other Solaris machine.
Here is the some part of my code.
try{
MQEnvironment.hostname ='192.12.12.134';
MQEnvironment.port ='1414';
MQEnvironment.channel ='SYSTEM.ADMIN.SVRCONN'; //server connection channel
MQEnvironment.properties.put(MQC.TRANSPORT_PROPERTY,MQC.TRANSPORT_MQSERI
ES);
aMqm=new MQQueueManager(strQManager);
System.out.println("Inside Connection Opened.");
aMqlqueue=aMqm.accessQueue(strLocalQueue,iOpenOptionsLocal,null,null,nul
l);
//
aMqlqueue=aMqm.accessQueue(strQueue,iOpenOptionsLocal,null,null,null);
System.out.println("Connection Opened.");
}
catch(Exception e)
{
e.printStackTrace();
}
Pls note that my Sever connection chl is running fine..and tried to print messages after that MQEnvironment.hostname ='192.12.12.134'; line but nothing printed...
Can anyone help for this problem |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Dec 14, 2005 4:19 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
a) BAD java coding.
Strings are delimited by " (double quotes)
So you really need to do
Code: |
MQEnvironment.hostname ="myhostname_or_ip"; |
Note that I would also want to double check whether you are using the right transport property from the list of possibles.
Enjoy  |
|
Back to top |
|
 |
zico |
Posted: Wed Dec 14, 2005 7:10 pm Post subject: |
|
|
Novice
Joined: 22 Jun 2005 Posts: 21
|
sorry, it's my typing mistake when I added my last note...don't worry there is no compilation error in the java code. I pass the hostname,channal name as command line argument and store in variables. Those variables are used in MQEnvironment.hostname. There is no value added within quotes.
As i told the same code is running fine in other Sun Solaris box...problem is with another Sun solaris box. |
|
Back to top |
|
 |
csmith28 |
Posted: Wed Dec 14, 2005 7:32 pm Post subject: |
|
|
 Grand Master
Joined: 15 Jul 2003 Posts: 1196 Location: Arizona
|
If one is working and the other is not, I would think there must be something different about the one that is "not" working when compared to the one that is.
A ` that should be a ', a : that should be a ;, a blank space in a line or a carriage return in a line. If at all possible run a diff to compare the two files.
Also, why are you using the SYSTEM.ADMIN.SVRCONN channel? Applications should never use the SYSTEM.ADMIN.SVRCONN or SYSTEM.DEF.SVRCONN channels. _________________ Yes, I am an agent of Satan but my duties are largely ceremonial. |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|