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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.7
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: