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 Java / JMS » MQEnvironment Problem

Post new topic  Reply to topic
 MQEnvironment Problem « View previous topic :: View next topic » 
Author Message
zico
PostPosted: Wed Dec 14, 2005 1:44 am    Post subject: MQEnvironment Problem Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Wed Dec 14, 2005 4:19 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
zico
PostPosted: Wed Dec 14, 2005 7:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
csmith28
PostPosted: Wed Dec 14, 2005 7:32 pm    Post subject: Reply with quote

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
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 Java / JMS » MQEnvironment Problem
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.