Description of problem: The agent's config export command produces an invalid XML file. Bug 536138 introduced a change that results the DOCTYPE element being removed and no DTD being defined. This means that a config export from the agent produces a file that can not be imported back into the agent: Failed to start the agent java.lang.IllegalArgumentException: Failed to load configuration file [/tmp/00989956-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". at org.rhq.enterprise.agent.AgentMain.processArguments(AgentMain.java:3155) at org.rhq.enterprise.agent.AgentMain.<init>(AgentMain.java:508) at org.rhq.enterprise.agent.AgentMain.main(AgentMain.java:404) Version-Release number of selected component (if applicable): 3.1.2.GA How reproducible: Always Steps to Reproduce: 1. Install and configure JBoss ON agent. 2. Launch agent command prompt: ${RHQ_AGENT_HOME}/bin/rhq-agent.sh -n 3. Execute agent config export prompt command: config export /tmp/exported-agent-configuration.xml 4. Exit agent command prompt. 5. Re-configure agent using export configuration: ${RHQ_AGENT_HOME}/bin/rhq-agent.sh --cleanconfig --config /tmp/exported-agent-configuration.xml 6. Validate /tmp/exported-agent-configuration.xml: xmllint --valid /tmp/exported-agent-configuration.xml Actual results: Agent fails to start: Failed to start the agent java.lang.IllegalArgumentException: Failed to load configuration file [/tmp/00989956-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". at org.rhq.enterprise.agent.AgentMain.processArguments(AgentMain.java:3155) at org.rhq.enterprise.agent.AgentMain.<init>(AgentMain.java:508) at org.rhq.enterprise.agent.AgentMain.main(AgentMain.java:404) xmllint reports: /tmp/exported-agent-configuration.xml:2: validity error : Validation failed: no DTD found ! <preferences EXTERNAL_XML_VERSION="1.0"> ^ Expected results: Exported agent configuration file can be imported without error or validation warning. Additional info: As indicated in Bug 782915, this issue is a direct result of the work done in Bug 536138.
see bug #536138 and bug #782915 for some history on this issue.
HA! I didn't realize Larry alread mentioned those bugs from my last comment in his description - guess I should read the whole thing all the way through.
Fixed in master (includes unit test): commit d6c14baa1bc2f4b8e63045abe10bf4d62878708c Author: burmanm <miburman> Date: Fri Jul 11 19:00:06 2014 +0300
commit to release/jon3.2.x : fcc34701d5977e59f0c1d87366df9fd3438fb00c
Moving to ON_QA as this is available for test in JON 3.2.3 ER01 build: http://jon01.mw.lab.eng.bos.redhat.com:8042/dist/release/jon/3.2.3.GA/8-14-14/