Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-670

Using "attribute" tag causes injection of null values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • Awaiting Volunteers
    • None
    • JMX
    • None
    • Hide
       
      public interface TestMBean {
          public String getText();
          public void setText(String text);
      }
      
       
      public class Test implements TestMBean {
      
              private String text;
      
              public String getText() {
                      return text;
              }
      
              public void setText(String text) {
                      if (text == null) {
                              throw new NullPointerException("Parameter can not be null");
                      }
                      this.text = text;
              }
      }
      
      <?xml version="1.0" encoding="UTF-8"?>
      
      <server xmlns="urn:jboss:service:7.0"
                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                          xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
      
                          <mbean code="Test" name="test:service=Test">
                                  <attribute name="Text">Bla bla</attribute>
                              </mbean>
      </server>
      
      Show
      public interface TestMBean { public String getText(); public void setText(String text); } public class Test implements TestMBean { private String text; public String getText() { return text; } public void setText(String text) { if (text == null) { throw new NullPointerException("Parameter can not be null"); } this.text = text; } } <?xml version="1.0" encoding="UTF-8"?> <server xmlns="urn:jboss:service:7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd"> <mbean code="Test" name="test:service=Test"> <attribute name="Text">Bla bla</attribute> </mbean> </server>
    • Workaround Exists
    • Hide

      Make sure that the MBean code can handle null values and do not use primitive datatypes.

      Show
      Make sure that the MBean code can handle null values and do not use primitive datatypes.

    Description

      Using "attribute" tag in "jboss-service.xml" in a SAR archive causes injection of null values. Even if your code can handle this it makes it impossible to use primitive datatypes.

      Attachments

        Activity

          People

            tadamski@redhat.com Tomasz Adamski
            anders-l.welen@polisen.se Anders Welen (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: