[prev in list] [next in list] [prev in thread] [next in thread]
List: xmlbeans-dev
Subject: [jira] Updated: (XMLBEANS-78) NPE when processing XMLStreamReader Midstream
From: "Dan Diephouse (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date: 2004-10-28 21:30:37
Message-ID: 1575719629.1098999037260.JavaMail.apache () nagoya
[Download RAW message or body]
[ http://issues.apache.org/jira/browse/XMLBEANS-78?page=history ]
Dan Diephouse updated XMLBEANS-78:
----------------------------------
Attachment: prefixanddepth.patch
This patch fixes both issues. With this patch it keeps track of the depth and only \
hits as many END_ELEMENTS as it hit START_ELEMENTS.
Still waiting to hear for StAX experts on what the resolution is for the QName \
problem, but this definitely needs to be in there as a near term fix. I've submitted \
a patch to Woodstox. Haven't looked at the BEA-RI yet.
> NPE when processing XMLStreamReader Midstream
> ---------------------------------------------
>
> Key: XMLBEANS-78
> URL: http://issues.apache.org/jira/browse/XMLBEANS-78
> Project: XMLBeans
> Type: Bug
> Versions: Version 2
> Environment: Latest CVS, Windows XP, Java 1.5
> Reporter: Dan Diephouse
> Priority: Blocker
> Attachments: XMLStreamReaderBug.java, amazon2.xml, prefix.patch, \
> prefixanddepth.patch
> I am attempting to read in a SOAP response into XmlBeans with an XMLStreamReader. \
> I've skipped to body in the XMLStreamReader. When doing a XmlObject.Factory.parse( \
> streamReader ) it throws this:
> java.lang.IllegalArgumentException: prefix cannot be "null" when creating a QName
> at javax.xml.namespace.QName.<init>(Unknown Source)
> at com.bea.xml.stream.MXParser.getName(MXParser.java:1432)
> at org.apache.xmlbeans.impl.newstore2.Locale.loadXMLStreamReader(Locale.java:979)
> at org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:703)
> at org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:693)
> at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:217)
> at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:645)
> at XMLStreamReaderBug.testBug(XMLStreamReaderBug.java:25)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
> This is fixed easily enough, by checking if the prefix is null in the Locale class \
> and acting accordingly. Once this is done though, I get: \
> java.lang.NullPointerException at \
> org.apache.xmlbeans.impl.newstore2.Cur$CurLoadContext.finish(Cur.java:3032) at \
> org.apache.xmlbeans.impl.newstore2.Locale.loadXMLStreamReader(Locale.java:1069) at \
> org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:703) at \
> org.apache.xmlbeans.impl.newstore2.Locale.parseToXmlObject(Locale.java:693) at \
> org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:217)
> at org.apache.xmlbeans.XmlObject$Factory.parse(XmlObject.java:645)
> at XMLStreamReaderBug.testBug(XMLStreamReaderBug.java:25)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at junit.framework.TestCase.runTest(TestCase.java:154)
> at junit.framework.TestCase.runBare(TestCase.java:127)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:118)
> at junit.framework.TestSuite.runTest(TestSuite.java:208)
> at junit.framework.TestSuite.run(TestSuite.java:203)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:421)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
> I'll attach a testcase showing this bug and my patch for Locale which checks for a \
> null prefix. The null prefix bug could also be problem with the StAX RI - however \
> I'ved tried it with both the RI and Woodstox. Both give me the same issue with the \
> prefix being null.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic