You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Volker Kleinschmidt (JIRA)" <xe...@xml.apache.org> on 2010/12/31 05:48:45 UTC

[jira] Created: (XERCESJ-1491) InternalError when parsing invalid XML

InternalError when parsing invalid XML
--------------------------------------

                 Key: XERCESJ-1491
                 URL: https://issues.apache.org/jira/browse/XERCESJ-1491
             Project: Xerces2-J
          Issue Type: Bug
    Affects Versions: 2.9.1
         Environment: XercesJ 2.9.1, JDK6, at least on Linux and Solaris
            Reporter: Volker Kleinschmidt


We're getting java.lang.InternalError from scanDocument() instead of some sensible exception when trying to parse XML that contains unclosed tags - this should be handled more gracefully.
{noformat}
processing event: -1 - java.lang.InternalError: processing event: -1
        at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:507)
        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 blackboard.xml.NonValidatingDOMParser.parse(NonValidatingDOMParser.java:115)
{noformat}
Note how the <handle>, <create> and <remove> tags are not terminated, i.e it should read <create .... />.
Clearly the document fragment is invalid XML, but that shouldn't cause an InternalError under any circumstance!

Example of a malformatted document fragment triggering this behavior:
{noformat}
    <!-- Custom content types defined by this extension -->
    <content-handlers>
	<content-handler>
		<name value="Document Package" />
		<handle value="resource/x-jjc-docset">
		<http-actions>
			<create value="modules/create.jsp">
			<remove value="modules/remove.jsp">
		</http-actions>
		<icons>
			<!--toolbar value="/images/add_ch1.gif"-->
			<!--listitem value="assignment_on.gif"-->
		</icons>
	</content-handler>
    </content-handlers>
{noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Commented: (XERCESJ-1491) InternalError when parsing invalid XML

Posted by "Volker Kleinschmidt (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977008#action_12977008 ] 

Volker Kleinschmidt commented on XERCESJ-1491:
----------------------------------------------

Oops, sorry. Certainly right.

> InternalError when parsing invalid XML
> --------------------------------------
>
>                 Key: XERCESJ-1491
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1491
>             Project: Xerces2-J
>          Issue Type: Bug
>    Affects Versions: 2.9.1
>         Environment: XercesJ 2.9.1, JDK6, at least on Linux and Solaris
>            Reporter: Volker Kleinschmidt
>
> We're getting java.lang.InternalError from scanDocument() instead of some sensible exception when trying to parse XML that contains unclosed tags - this should be handled more gracefully.
> {noformat}
> processing event: -1 - java.lang.InternalError: processing event: -1
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:507)
>         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 blackboard.xml.NonValidatingDOMParser.parse(NonValidatingDOMParser.java:115)
> {noformat}
> Note how the <handle>, <create> and <remove> tags are not terminated, i.e it should read <create .... />.
> Clearly the document fragment is invalid XML, but that shouldn't cause an InternalError under any circumstance!
> Example of a malformatted document fragment triggering this behavior:
> {noformat}
>     <!-- Custom content types defined by this extension -->
>     <content-handlers>
> 	<content-handler>
> 		<name value="Document Package" />
> 		<handle value="resource/x-jjc-docset">
> 		<http-actions>
> 			<create value="modules/create.jsp">
> 			<remove value="modules/remove.jsp">
> 		</http-actions>
> 		<icons>
> 			<!--toolbar value="/images/add_ch1.gif"-->
> 			<!--listitem value="assignment_on.gif"-->
> 		</icons>
> 	</content-handler>
>     </content-handlers>
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Resolved: (XERCESJ-1491) InternalError when parsing invalid XML

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XERCESJ-1491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Glavassevich resolved XERCESJ-1491.
-------------------------------------------

    Resolution: Invalid

You are not using Apache Xerces at all. The com.sun.org.apache.xerces.internal.* packages are part of Oracle/Sun's fork which they ship in their JDK. If you are experiencing issues with that code base you would need to pursue it with Oracle. We have no influence over what they include in their versions.

> InternalError when parsing invalid XML
> --------------------------------------
>
>                 Key: XERCESJ-1491
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1491
>             Project: Xerces2-J
>          Issue Type: Bug
>    Affects Versions: 2.9.1
>         Environment: XercesJ 2.9.1, JDK6, at least on Linux and Solaris
>            Reporter: Volker Kleinschmidt
>
> We're getting java.lang.InternalError from scanDocument() instead of some sensible exception when trying to parse XML that contains unclosed tags - this should be handled more gracefully.
> {noformat}
> processing event: -1 - java.lang.InternalError: processing event: -1
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:507)
>         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 blackboard.xml.NonValidatingDOMParser.parse(NonValidatingDOMParser.java:115)
> {noformat}
> Note how the <handle>, <create> and <remove> tags are not terminated, i.e it should read <create .... />.
> Clearly the document fragment is invalid XML, but that shouldn't cause an InternalError under any circumstance!
> Example of a malformatted document fragment triggering this behavior:
> {noformat}
>     <!-- Custom content types defined by this extension -->
>     <content-handlers>
> 	<content-handler>
> 		<name value="Document Package" />
> 		<handle value="resource/x-jjc-docset">
> 		<http-actions>
> 			<create value="modules/create.jsp">
> 			<remove value="modules/remove.jsp">
> 		</http-actions>
> 		<icons>
> 			<!--toolbar value="/images/add_ch1.gif"-->
> 			<!--listitem value="assignment_on.gif"-->
> 		</icons>
> 	</content-handler>
>     </content-handlers>
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org


[jira] Commented: (XERCESJ-1491) InternalError when parsing invalid XML

Posted by "Volker Kleinschmidt (JIRA)" <xe...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XERCESJ-1491?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12976187#action_12976187 ] 

Volker Kleinschmidt commented on XERCESJ-1491:
----------------------------------------------

This has also been seen by others, e.g. [Netbeans bug 180924|http://netbeans.org/bugzilla/show_bug.cgi?id=180924]

> InternalError when parsing invalid XML
> --------------------------------------
>
>                 Key: XERCESJ-1491
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1491
>             Project: Xerces2-J
>          Issue Type: Bug
>    Affects Versions: 2.9.1
>         Environment: XercesJ 2.9.1, JDK6, at least on Linux and Solaris
>            Reporter: Volker Kleinschmidt
>
> We're getting java.lang.InternalError from scanDocument() instead of some sensible exception when trying to parse XML that contains unclosed tags - this should be handled more gracefully.
> {noformat}
> processing event: -1 - java.lang.InternalError: processing event: -1
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:507)
>         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 blackboard.xml.NonValidatingDOMParser.parse(NonValidatingDOMParser.java:115)
> {noformat}
> Note how the <handle>, <create> and <remove> tags are not terminated, i.e it should read <create .... />.
> Clearly the document fragment is invalid XML, but that shouldn't cause an InternalError under any circumstance!
> Example of a malformatted document fragment triggering this behavior:
> {noformat}
>     <!-- Custom content types defined by this extension -->
>     <content-handlers>
> 	<content-handler>
> 		<name value="Document Package" />
> 		<handle value="resource/x-jjc-docset">
> 		<http-actions>
> 			<create value="modules/create.jsp">
> 			<remove value="modules/remove.jsp">
> 		</http-actions>
> 		<icons>
> 			<!--toolbar value="/images/add_ch1.gif"-->
> 			<!--listitem value="assignment_on.gif"-->
> 		</icons>
> 	</content-handler>
>     </content-handlers>
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org