[jbosstools-issues] [JBoss JIRA] (JBIDE-9855) Infinite cycle in parsing seam-beans.xml

Viacheslav Kabanovich (Commented) (JIRA) jira-events at lists.jboss.org
Wed Oct 5 20:46:16 EDT 2011


    [ https://issues.jboss.org/browse/JBIDE-9855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12632618#comment-12632618 ] 

Viacheslav Kabanovich commented on JBIDE-9855:
----------------------------------------------

Our parser sets SAX parser property 'continue-after-fatal-error' to true and suppresses fatal errors in overriden method fatalError(SAXParseException e). That worked nice for all cases until the example above was found. That is certainly a bad behavior of parser, on the other hand it warns of *fatal* error and cannot be expected to do miracles.

There are two ways of fix.
1) Abort on a fatal error. Either set 'continue-after-fatal-error' to 'false' or throw exception in method fatalError(SAXParseException e) or both.
2) Only throw exception in method fatalError(SAXParseException e) if the number of calls of the method in parsing current document exceeds some limit.

The first way is 100% ensures that this issue is fixed. It has a drawback - xml model is not built. In our days XML parsers are very smart and allow to extract a lot of correct information of ill-formed xml. If aborted on first fatal error, tools like content assist, validation, search, etc will have no data from that file. The only clue for a developer why it is so will be an error marker on beans.xml file. 

The second way, in my opinion, solves this issue as 99.(9)%. But no one can guarantee that there exists no unique case that might fail. It seems that everyone stands for the first solution, at least until complaints appear that our tool is not smart enough.

                
> Infinite cycle in parsing seam-beans.xml
> ----------------------------------------
>
>                 Key: JBIDE-9855
>                 URL: https://issues.jboss.org/browse/JBIDE-9855
>             Project: Tools (JBoss Tools)
>          Issue Type: Bug
>          Components: CDI extensions
>    Affects Versions: 3.3.0.M3
>            Reporter: Viacheslav Kabanovich
>            Assignee: Viacheslav Kabanovich
>             Fix For: 3.3.0.M4
>
>
> EXECUTE: Create Seam Config project.
> EXECUTE: Replace content of beans.xml (or seam-beans.xml) with text
> {code}
> <?xml version="1.0" encoding="UTF-8"?>
> </
> {code}
> EXECUTE: Save file.
> FAILURE: Progress shows job building CDI model that sticks forever.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jbosstools-issues mailing list