vinodat / xmlwise

Automatically exported from code.google.com/p/xmlwise
0 stars 0 forks source link

XmlParseException when parsing a plist #1

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a string that contains a plist in valid XML format.
2. Call Plist.fromXml() on it.

What is the expected output? What do you see instead?

I expect it to parse the plist into a map.  Instead I see an exception:

06-23 17:16:14.867: WARN/System.err(1159): xmlwise.XmlParseException: 
java.lang.IllegalArgumentException: 
http://apache.org/xml/features/nonvalidating/load-external-dtd

I tried running this with the source code, and it seems to be in line 88 of 
Xmlwise.java.

What version of the product are you using? On what operating system?

The latest Xmlwise version.  Eclipse on Mac OS X (for Android v7 development).  
Let me know if you need more details.

Please provide any additional information below.

I commented out the line that was triggering the crash, and parsing seems to 
work.

Original issue reported on code.google.com by david.ho...@gmail.com on 23 Jun 2010 at 9:47

GoogleCodeExporter commented 8 years ago
If  Anyone is facing the IllegalArgumentException on Android OS then please  
comment out the line no 49 of file xmlwise.java .

Original comment by mail2abhishekgupta on 14 Oct 2010 at 12:27

GoogleCodeExporter commented 8 years ago
I'm experiencing a similar problem with the attached plist file (note that it's 
been saved by xmlwise and now I can't read it back).

The exception:

GRAVE: null
com.sun.org.apache.xerces.internal.impl.io.MalformedByteSequenceException: 
Invalid byte 2 of 3-byte UTF-8 sequence.
        at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.invalidByte(UTF8Reader.java:684)
        at com.sun.org.apache.xerces.internal.impl.io.UTF8Reader.read(UTF8Reader.java:405)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.load(XMLEntityScanner.java:1742)
        at com.sun.org.apache.xerces.internal.impl.XMLEntityScanner.skipChar(XMLEntityScanner.java:1416)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2792)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
        at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
        at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:235)
        at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
        at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:208)
        at xmlwise.Xmlwise.loadDocument(Unknown Source)
        at xmlwise.Xmlwise.loadDocument(Unknown Source)
        at xmlwise.Xmlwise.loadXml(Unknown Source)
        at xmlwise.Plist.load(Unknown Source)
        at xmlwise.Plist.load(Unknown Source)
        at itablodesigner.bl.Issue.load(Issue.java:32)
        at itablodesigner.view.MainInternalFrame.importPlist(MainInternalFrame.java:409)
        at itablodesigner.iTabloMainForm.importPlist(iTabloMainForm.java:239)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(ApplicationAction.java:662)
        at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicationAction.java:698)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:389)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809)
        at com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:137)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850)
        at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
        at java.awt.Component.processMouseEvent(Component.java:6374)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
        at java.awt.Component.processEvent(Component.java:6139)
        at java.awt.Container.processEvent(Container.java:2085)
        at java.awt.Component.dispatchEventImpl(Component.java:4736)
        at java.awt.Container.dispatchEventImpl(Container.java:2143)
        at java.awt.Component.dispatchEvent(Component.java:4566)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4621)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
        at java.awt.Container.dispatchEventImpl(Container.java:2129)
        at java.awt.Window.dispatchEventImpl(Window.java:2478)
        at java.awt.Component.dispatchEvent(Component.java:4566)
        at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:680)
        at java.awt.EventQueue.access$000(EventQueue.java:86)
        at java.awt.EventQueue$1.run(EventQueue.java:639)
        at java.awt.EventQueue$1.run(EventQueue.java:637)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:98)
        at java.awt.EventQueue$2.run(EventQueue.java:653)
        at java.awt.EventQueue$2.run(EventQueue.java:651)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:650)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
        at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Original comment by santine...@gmail.com on 4 May 2011 at 4:18

Attachments:

GoogleCodeExporter commented 8 years ago
Rather than line 49, I think this line needs commenting out (50) - 

documentBuilderFactory.setAttribute("http://apache.org/xml/features/nonvalidatin
g/load-external-dtd", loadExternalDTD);

That solved the IllegalArgumentException error, but now get this error:

System.err    Error: /myplist.plist

I'm guessing this has something to do with the plist validating? But I checked 
the file on http://www.w3schools.com/xml/xml_validator.asp and it validates ok.

Original comment by davidbur...@gmail.com on 5 May 2011 at 11:17

GoogleCodeExporter commented 8 years ago
Anything further on this? i'm getting the same from valid plist data 

Original comment by luke.red...@gmail.com on 26 May 2011 at 2:33

GoogleCodeExporter commented 8 years ago
Sorry everyone, for some reason I failed to get notifications on issues for 
Xmlwise. 

Anyway, on my computer, the sample plist file in comment #2 works fine for me - 
no errors. Could you check that your source is saved as UTF-8?

Original comment by christof...@gmail.com on 30 Sep 2011 at 9:57

GoogleCodeExporter commented 8 years ago
I get the same problem, but only when I run it with the Android emulator. The 
xmlwise lib works fine on my Windows Java VM, but it does not work with Android 
SDK (I use SDK version 14)

Original comment by korn...@gmail.com on 5 Dec 2011 at 2:50

GoogleCodeExporter commented 8 years ago
I had similar issue loading an NITF Xml file and i commented out that Exception 
the Xmlwise.java file at line 50. and it fixed it for me. now i am being able 
to extract XmlEliments from it.

Original comment by xman...@gmail.com on 8 Dec 2011 at 4:24

GoogleCodeExporter commented 8 years ago
I have been trying to use this library to parse my WebHistory plist from my 
iPhone. Unfortunately I get an Exception in thread "main" 
xmlwise.XmlParseException: Failed to parse: <dict>. It seems to be having a 
problem with a particular type in the plist, USTRING, this only occurs for 2 
entries, but seems to be messing things up.

Thanks.

Im not in a position to upload the file causing the problems just yet, ill do 
it as soon as I can. 

Original comment by jtot...@gmail.com on 10 Dec 2012 at 3:29

GoogleCodeExporter commented 8 years ago
Hey, just thought id give you an update, yeh its definately the USTRING value, 
it doenst know how to handle them. I removed them from the PLIST and worked 
fine. The ustring appears with funny characters, such as Irish hyphenated 
letters. Thanks

Original comment by jtot...@gmail.com on 10 Dec 2012 at 5:08