5 Replies Latest reply on Aug 6, 2008 9:22 AM by adrian.brock

    MBean Dependency not working as expected .

    vickyk

      I have the following contents in the MBean deployment descriptor

      <?xml version="1.0" encoding="UTF-8"?>
      <server>
       <mbean code="org.jboss.test.jca.mbean.RaDependsOnMe"
       name="jboss.test:test=RaDependsOnMeMBean">
      <depends>jboss.test:name=test</depends>
       </mbean>
      </server>


      The jboss.test:name=test is not present so I would expect that the RaDependsOnMe not to get registered/available for usage

      But to my surprise I see the MBean jboss.test:test=RaDependsOnMeMBean available from the jmx-console and I am able to call the sayHello() operation from the jmx-console .

      I tried this on Jboss5 , Jboss4.2 and Jboss4.0.5 .

      This looks to me as the bug .



        • 1. Re: MBean Dependency not working as expected .

           

          "vickyk" wrote:
          I have the following contents in the MBean deployment descriptor

          <?xml version="1.0" encoding="UTF-8"?>
          <server>
           <mbean code="org.jboss.test.jca.mbean.RaDependsOnMe"
           name="jboss.test:test=RaDependsOnMeMBean">
          <depends>jboss.test:name=test</depends>
           </mbean>
          </server>


          The jboss.test:name=test is not present so I would expect that the RaDependsOnMe not to get registered/available for usage

          But to my surprise I see the MBean jboss.test:test=RaDependsOnMeMBean available from the jmx-console and I am able to call the sayHello() operation from the jmx-console .

          I tried this on Jboss5 , Jboss4.2 and Jboss4.0.5 .

          This looks to me as the bug .



          No. Depends is a contract on the create/start lifecycle not registration in the
          MBeanServer. To get what you want in JMX, you'd have to introduce
          something like the MC demand into the jmx xml.
           <mbean code="org.jboss.test.jca.mbean.RaDependsOnMe"
           name="jboss.test:test=RaDependsOnMeMBean">
          <demand whenRequired="Instantiated">jboss.test:name=test</demand>
           </mbean>
          

          Which doesn't currently exist within the -service.xml


          • 2. Re: MBean Dependency not working as expected .

             

            "vickyk" wrote:

            This looks to me as the bug .


            Do you know how annoying it is when somebody claims "bug"
            without even referring to the documentation/specification of the feature used? :-)

            http://wiki.jboss.org/wiki/BadPostBug

            • 3. Re: MBean Dependency not working as expected .
              vickyk

               

              To get what you want in JMX, you'd have to introduce
              something like the MC demand into the jmx xml.

              Thanks , Let me try to find out more details about it .

              "adrian@jboss.org" wrote:
              "vickyk" wrote:

              This looks to me as the bug .


              Do you know how annoying it is when somebody claims "bug"
              without even referring to the documentation/specification of the feature used? :-)

              http://wiki.jboss.org/wiki/BadPostBug

              yes it is , but I did not know it would annoy you that much ;)

              • 4. Re: MBean Dependency not working as expected .
                vickyk

                 

                "adrian@jboss.org" wrote:
                To get what you want in JMX, you'd have to introduce
                something like the MC demand into the jmx xml.


                I was guessing the same behavior but wanted to clarify it without digging into code ;)

                • 5. Re: MBean Dependency not working as expected .

                   

                  "vickyk" wrote:
                  "adrian@jboss.org" wrote:
                  To get what you want in JMX, you'd have to introduce
                  something like the MC demand into the jmx xml.


                  I was guessing the same behavior but wanted to clarify it without digging into code ;)


                  And that's exactly why it is a BAD POST.

                  Somebody who has done no research whatsover is claiming they have a bug
                  to get attention.

                  Complete waste of people's time. :-(