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 » MQ7 PCF java Agent initiation failing

Post new topic  Reply to topic
 MQ7 PCF java Agent initiation failing « View previous topic :: View next topic » 
Author Message
golam1983
PostPosted: Sun Jan 24, 2010 3:02 pm    Post subject: MQ7 PCF java Agent initiation failing Reply with quote

Apprentice

Joined: 27 Jun 2008
Posts: 35

Hi,

I am trying to write java program for monitoring of our mq infrastructure using PCF. I am using MQ v7.0.0.1 on a Windows XP system. Here is the error I am getting when Initializing the PCFAgent -

Code:
java.lang.NullPointerException
   at com.ibm.mq.MQQueue.get(MQQueue.java:487)
   at com.ibm.mq.pcf.PCFAgent.getBasicQmgrInfo(PCFAgent.java:393)
   at com.ibm.mq.pcf.PCFAgent.open(PCFAgent.java:355)
   at com.ibm.mq.pcf.PCFAgent.open(PCFAgent.java:309)
   at com.ibm.mq.pcf.PCFAgent.connect(PCFAgent.java:207)
   at com.ibm.mq.pcf.PCFAgent.<init>(PCFAgent.java:159)
   at com.ge.mq.monitoring.InquireQueue.main(InquireQueue.java:35)


Seems like I am missing some basic step. The code snipet I am using -

Code:
MQEnvironment.hostname = "localhost";
       MQEnvironment.port     = 1414;
       MQEnvironment.channel  = "SYSTEM.DEF.SVRCONN";
       MQEnvironment.userID = "mqsiuid";
       MQEnvironment.password = "mqsipw";
      
       try{
          MQQueueManager qmgr = new MQQueueManager(queueManager);
          PCFAgent agent = new PCFAgent(qmgr);    
          qmgr.close();
       }catch(Exception e){
          e.printStackTrace();
       }


Following line in the code is raising the above error

Code:
PCFAgent agent = new PCFAgent(qmgr);


Any insight will be a great help
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Sun Jan 24, 2010 8:50 pm    Post subject: Reply with quote

Grand High Poobah

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

Look into the documentation for support pack MS0B. Did you open the connection to the qmgr before the pcf agent instantiation?...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
golam1983
PostPosted: Mon Jan 25, 2010 11:58 am    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2008
Posts: 35

Yes, I am following the MSOB support pack and "MQProgrammable Command Formats and Administration Interface" redbook for programming. I have added few lines of code to check the Queue manager connection is fine. Here is the test prototype

Code:

public static void main(String args[])
    {
   MQEnvironment.hostname = "localhost";
       MQEnvironment.port     = 1414;
       MQEnvironment.channel  = "SYSTEM.DEF.SVRCONN";
      
       try{
          MQQueueManager qmgr = new MQQueueManager("QM_MQSI60");
          System.out.println(queueManager+": Queue Manager Connected!");
          MQQueue queueTest = qmgr.accessQueue("TEST.QUEUE",MQC.MQOO_INQUIRE);
          System.out.println("TEST.QUEUE depth: " + queueTest.getCurrentDepth());
          System.out.println(queueManager+": Initializing PCF Agent!");
          PCFMessageAgent agent = new PCFMessageAgent(qmgr);
          System.out.println(queueManager+": PCF Agent Initiated!");
          qmgr.close();
       }catch(Exception e){
          e.printStackTrace();
       }
    }


Return on my console -

Code:
QM_MQSI60: Queue Manager Connected!
TEST.QUEUE depth: 4
QM_MQSI60: Initializing PCF Agent!
java.lang.NullPointerException
   at com.ibm.mq.MQQueue.get(MQQueue.java:487)
   at com.ibm.mq.pcf.PCFAgent.getBasicQmgrInfo(PCFAgent.java:393)
   at com.ibm.mq.pcf.PCFAgent.open(PCFAgent.java:355)
   at com.ibm.mq.pcf.PCFAgent.open(PCFAgent.java:309)
   at com.ibm.mq.pcf.PCFAgent.connect(PCFAgent.java:207)
   at com.ibm.mq.pcf.PCFAgent.<init>(PCFAgent.java:159)
   at com.ibm.mq.pcf.PCFMessageAgent.<init>(PCFMessageAgent.java:130)
   at com.ge.mq.monitoring.InquireQueue.main(InquireQueue.java:40)


It seems like the Agent is trying to read a queue but its failing. I have checked the SYSTEM.ADMIN.COMMAND.QUEUE queue is accessible and command server is running on this queue. Not sure what else I am missing....
Back to top
View user's profile Send private message
mvic
PostPosted: Mon Jan 25, 2010 12:09 pm    Post subject: Re: MQ7 PCF java Agent initiation failing Reply with quote

Jedi

Joined: 09 Mar 2004
Posts: 2080

golam1983 wrote:
Code:
java.lang.NullPointerException
   at com.ibm.mq.MQQueue.get(MQQueue.java:487)

Null pointer exceptions are not "normal" behaviour. Looks like a good reason to call IBM for support.

First, though, to save potentially wasted time, maybe check this problem is still there in the latest fix pack.

7.0.0.0
7.0.0.1 <- your code
7.0.0.2
7.0.1.0
7.0.1.1 <- current code, many defects fixed.
Back to top
View user's profile Send private message
golam1983
PostPosted: Mon Jan 25, 2010 12:34 pm    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2008
Posts: 35

I had anticipated that the fixpack may work so I had upgraded it to Version: 7.0.1.1

This did not help.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Jan 25, 2010 12:59 pm    Post subject: Reply with quote

Grand High Poobah

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

Obviously in order to instantiate the qmgr you have the connection parameters.
What happens if you use the other method of instantiation of the PCFAgent, passing the connection parameters...?
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
golam1983
PostPosted: Mon Jan 25, 2010 1:04 pm    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2008
Posts: 35

Code:
PCFMessageAgent agent = new PCFMessageAgent("localhost",1414,"SYSTEM.DEF.SVRCONN");


Tried this. Its raising the same exception.
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Mon Jan 25, 2010 1:09 pm    Post subject: Reply with quote

Grand High Poobah

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

golam1983 wrote:
Code:
PCFMessageAgent agent = new PCFMessageAgent("localhost",1414,"SYSTEM.DEF.SVRCONN");


Tried this. Its raising the same exception.

PMR time...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
golam1983
PostPosted: Mon Jan 25, 2010 2:03 pm    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2008
Posts: 35

Thanks a lot you all. Will raise a PMR. I will keep posted here....
Back to top
View user's profile Send private message
RogerLacroix
PostPosted: Mon Jan 25, 2010 4:00 pm    Post subject: Reply with quote

Jedi Knight

Joined: 15 May 2001
Posts: 3264
Location: London, ON Canada

Hi,

I would send an email to the author of the SupportPac. His details are at the bottom of the SupportPac's readme.txt file.

Regards,
Roger Lacroix
Capitalware Inc.
_________________
Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter
Back to top
View user's profile Send private message Visit poster's website
mqjeff
PostPosted: Tue Jan 26, 2010 5:02 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

MS0B is integrated into the product at 7.0.1, and should not need to be downloaded and installed separately.

I suppose this could even be part of the issue, that you're using jar files that are not compatible with v7 per se (although they really should be).
Back to top
View user's profile Send private message
golam1983
PostPosted: Tue Jan 26, 2010 8:10 am    Post subject: Reply with quote

Apprentice

Joined: 27 Jun 2008
Posts: 35

I tried to run the program from command prompt and its worked

Earlier I was running from message broker toolkit. May be the issue was with my Environment.

Thanks to all for prompt help
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 » MQ7 PCF java Agent initiation failing
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.