org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: Ungültiges XML-Zeichen angegeben.

225 views
Skip to first unread message

Marcel

unread,
Oct 13, 2014, 5:56:16 AM10/13/14
to zaproxy...@googlegroups.com
Dear developers-group,

since some build, I occasionally get the below mentioned error which then triggers a deletion of the config.xml - making any subsequent start of ZAP impossible. I use a backup of the app data to restore and first thought the error has something to do with the German umlauts, but the config-file looks okay (see attachment if interested). Any ideas what causes this error?

Background info:
- OS: OS X Mavericks 10.9.5, 64-bit, German language
- ZAP build: SVN commit no. 5386

Best regards,

Marcel

57206 [AWT-EventQueue-0] ERROR org.parosproxy.paros.control.MenuToolsControl  - org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: Ungültiges XML-Zeichen angegeben.
org.apache.commons.configuration.ConfigurationException: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: Ungültiges XML-Zeichen angegeben.
    at org.apache.commons.configuration.XMLConfiguration.createDocument(XMLConfiguration.java:850)
    at org.apache.commons.configuration.XMLConfiguration.save(XMLConfiguration.java:970)
    at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration$FileConfigurationDelegate.save(AbstractHierarchicalFileConfiguration.java:570)
    at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:557)
    at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:524)
    at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:474)
    at org.apache.commons.configuration.AbstractFileConfiguration.save(AbstractFileConfiguration.java:414)
    at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.save(AbstractHierarchicalFileConfiguration.java:214)
    at org.parosproxy.paros.control.MenuToolsControl.options(MenuToolsControl.java:72)
    at org.parosproxy.paros.control.MenuToolsControl.options(MenuToolsControl.java:61)
    at org.parosproxy.paros.view.MainMenuBar$1.actionPerformed(MainMenuBar.java:176)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
    at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:157)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
    at java.awt.Component.processMouseEvent(Component.java:6505)
.... (cutted the dispatch events) ...
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Caused by: org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: Ungültiges XML-Zeichen angegeben.
    at com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElement(CoreDocumentImpl.java:622)
    at org.apache.commons.configuration.XMLConfiguration$XMLBuilderVisitor.insert(XMLConfiguration.java:1465)
    at org.apache.commons.configuration.HierarchicalConfiguration$BuilderVisitor.visitBeforeChildren(HierarchicalConfiguration.java:1734)
    at org.apache.commons.configuration.HierarchicalConfiguration$Node.visit(HierarchicalConfiguration.java:1401)
    at org.apache.commons.configuration.HierarchicalConfiguration$Node.visit(HierarchicalConfiguration.java:1407)
    at org.apache.commons.configuration.XMLConfiguration$XMLBuilderVisitor.processDocument(XMLConfiguration.java:1440)
    at org.apache.commons.configuration.XMLConfiguration.createDocument(XMLConfiguration.java:844)
    ... 49 more

config.xml

psiinon

unread,
Oct 14, 2014, 4:59:24 AM10/14/14
to zaproxy...@googlegroups.com
Hi Marcel,

The config.xml file looks ok, but thats not too surprising as I think the error occurred when saving a new config file, so thats probably the state it was in when it was valid.
If the Apache commons library reported which character(s) it was complaining about then this would be easy, but it doesnt, so its not :(
As you only occasionally get the problem I'm guessing (hoping) that its something you're adding to the configs manually.
Can you remember changing any of the configs before this error occurs?
Do you add or change anything via the Options, especially anything that includes 'non standard' characters (pretty much anything other than alphanumeric ones?

Cheers,

Simon

Marcel Kulicke

unread,
Oct 17, 2014, 6:25:17 AM10/17/14
to zaproxy...@googlegroups.com
Hi Simon!

Thanks for answering! I just run into that error again, so I have some updates:
> The config.xml file looks ok, but thats not too surprising as I think the error occurred when saving a new config file, so thats probably the state it was in when it was valid.
Correct. I just updated to the latest version and it even tells me now that there are problems saving the options. However, I did not change anything in the config. I started ZAP with almost the version of config.xml that you already have (just the version tag is different). First thing I did after the startup was to enter the preferences -> looking up the port for the local proxy -> closing the preferences -> Bam! Could not save options -> log says "ungültiges Zeichen" (invalid character) -> config.xml is empty afterwards.

> If the Apache commons library reported which character(s) it was complaining about then this would be easy, but it doesnt, so its not :(
Yip, wouldn't that be boring anyway ;-)

> As you only occasionally get the problem I'm guessing (hoping) that its something you're adding to the configs manually.
It now seems the problem is reproducible...

> Can you remember changing any of the configs before this error occurs?
I know its the usual answer, but I REALLY did change nothing! I swear it!

> Do you add or change anything via the Options, especially anything that includes 'non standard' characters (pretty much anything other than alphanumeric ones?
I wouldn't dare to use anything but alphanumerics - given the uncounted amount of hours it already deducted from my life time since I use computers

I will try to get more information about this error and come back to you.

Cheers,

Marcel
> --
> You received this message because you are subscribed to a topic in the Google Groups "OWASP ZAP Developer Group" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/zaproxy-develop/bUSBnzl1loQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to zaproxy-devel...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

psiinon

unread,
Oct 17, 2014, 7:05:32 AM10/17/14
to zaproxy...@googlegroups.com
OK, this is weird :/
I've just:
  1. Started ZAP 2.3.1 with a clean config
  2. Switched to German
  3. Restarted ZAP
  4. Opened and saved the Options

All worked fine!

I also tried it with the config file you attached before, again no problem.

One possibility is that theres an issue with another local 'old' config, as by default ZAP will try to import it.

Could you try running ZAP again, but this time specifying a '-dir' path (which doesnt have to exist) eg:

./zap.sh -dir thisisatest

That should give you a completely clean config.

If that still fails, can you check to see what jars are on your class path? We have seen problems before where an our of date jar overrode one of the ones we included with ZAP.

Cheers,

Simon

> To unsubscribe from this group and all its topics, send an email to zaproxy-develop+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages