2 Replies Latest reply: Feb 9, 2012 9:16 AM by Adam Green RSS

manuallyAddResource() in CLI  not appearing to work correctly

Adam Green Newbie

I am trying to add a JMS queue which has not been auto discovered by rhq, to rhq.

Using the following method call:


// I have hard coded the values here for the purpose of this discussion


DiscoveryBossRemote dbr = client.getDiscoveryBossRemote();

dbr.manuallyAddResource(subject, 10152, 10416, cfg);


10152 is the resourcetypeid for a jbm jms queue resource, 10416 is the parentresourceid for jms queues of the same resource type which have been auto discovered by rhq. In the cfg I have added the following fields as simple properties:


name = "errorqueue"

JNDIName = "/errorqueue"

serverPeer = "jboss.messasing.service=serverPeer"


The client and subject fields are correct as used successfully by other operations.


There are no syntax/compile/runtime errors, the method finishes running but the resource is not added.

Please be aware I have had to manually type the code here, it is not pasted, so ignore what would be syntax errors from the text here.


Any advice would be much appreciated!

  • 1. Re: manuallyAddResource() in CLI  not appearing to work correctly
    Lukas Krejci Apprentice

    One thing that comes to my mind is that this might be caused by https://bugzilla.redhat.com/show_bug.cgi?id=754419. Basically, the agent code assumes that all the required properties in the configuration objects have values. This is taken care of by the GUI but in CLI, you need to specify a concrete value for every required property in your configuration object (+ others if you need to set them of course).


    But that is just a guess. Do you see anything suspicious in either the server log or the agent log when you try to manually add the resource?

  • 2. Re: manuallyAddResource() in CLI  not appearing to work correctly
    Adam Green Newbie

    I have checked the agent and server logs which do not show anything related to the interaction, as a test I also just changed the parentresourceid to generate a semantic failure for which java as expected threw a run time error, this was not logged by the agent or server though so maybe cli interactions are not logged?

    The configuration props i put in were the required props as defined by the rhq-plugin.xml for that type, I will try again as you suggest above with all properties added and see what the results are.