JON agent's 'config export' command generates an invalid XML file due to: Document root element "preferences", must match DOCTYPE root "null"

Solution Verified - Updated -

Issue

  • Receive the below error:

    > config import /Users/mg/agent_config.xml 
    Failed to perform config command; stack trace follows:
    java.util.prefs.InvalidPreferencesFormatException: org.xml.sax.SAXParseException: Document root element "preferences", must match DOCTYPE root "null".
    
  • Agent config export does not include DOCTYPE

  • After config export, the !DOCTYPE line is missing
  • Unable to configure agent with export configuration file due to:

    Failed to start the agent
    java.lang.IllegalArgumentException: Failed to load configuration file [/tmp/agent-configuration-export.xml]. Cause: java.util.prefs.InvalidPreferencesFormatException: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 41; Document root element "preferences", must match DOCTYPE root "null".
    

Environment

  • Red Hat JBoss Operations Network (ON) 3.0, 3.1
  • JBoss ON agent configuration file that was generated by config export <file> agent prompt command
  • Attempting to import or configure an agent using a configuration file that is missing the XML element:

    <!DOCTYPE preferences SYSTEM 'http://java.sun.com/dtd/preferences.dtd'>
    

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content