Uploaded image for project: 'Commons Configuration'
  1. Commons Configuration
  2. CONFIGURATION-767

NullPointerException in XMLConfiguration#createTransformer() when no FileLocator is set

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.7
    • Component/s: None
    • Labels:
      None

      Description

      You get a NullPointerException in XMLConfiguration#createTransformer() when no FileLocator is set.

      For example:

              XMLConfiguration xmlConfig = new XMLConfiguration();
              xmlConfig.setRootElementName("IAmRoot");
              StringWriter sw = new StringWriter();
              xmlConfig.write(sw);
      

      Yields:

      java.lang.NullPointerException
      	at org.apache.commons.configuration2.XMLConfiguration.createTransformer(XMLConfiguration.java:884)
      	at org.apache.commons.configuration2.XMLConfiguration.write(XMLConfiguration.java:1045)
      	...
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              ggregory Gary D. Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: