commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Tripodi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DIGESTER-167) Groundless "Circular file inclusion detected" exception when including rules XML file
Date Thu, 30 Aug 2012 13:58:07 GMT

     [ https://issues.apache.org/jira/browse/DIGESTER-167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Simone Tripodi updated DIGESTER-167:
------------------------------------

    Description: 
Looks like org.apache.commons.digester3.xmlrules.IncludeRule doesn't remove the name of included
XML rules resource from the set of included files of the memoryRulesBinder after included
module is installed. Hence, one can include resource actually only once. Parsing  of the following
XML rules (slightly modified example from the documentation) causes unexpected "Circular file
inclusion detected" exception:

rules1.xml
{code:xml} 
<?xml version="1.0"?>
<!DOCTYPE digester-rules PUBLIC
        "-//Apache Commons //DTD digester-rules XML V1.0//EN"
        "http://commons.apache.org/digester/dtds/digester-rules-3.0.dtd">
<digester-rules>
    <pattern value="root/foo">
        <object-create-rule classname="Foo"/>
        <include url="classpath:/rules2.xml"/>
    </pattern>
    <pattern value="root/foo2">
        <object-create-rule classname="Foo"/>
        <include url="classpath:/rules2.xml"/>
    </pattern>
</digester-rules>
{code}

rules2.xml
{code:xml} 
 <?xml version="1.0"?>
<!DOCTYPE digester-rules PUBLIC
        "-//Apache Commons //DTD digester-rules XML V1.0//EN"
        "http://commons.apache.org/digester/dtds/digester-rules-3.0.dtd">
<digester-rules>
    <pattern value="bar">
        <object-create-rule classname="Bar"/>
    </pattern>
</digester-rules>
{code}

  was:
Looks like org.apache.commons.digester3.xmlrules.IncludeRule doesn't remove the name of included
XML rules resource from the set of included files of the memoryRulesBinder after included
module is installed. Hence, one can include resource actually only once. Parsing  of the following
XML rules (slightly modified example from the documentation) causes unexpected "Circular file
inclusion detected" exception:

rules1.xml
<?xml version="1.0"?>
<!DOCTYPE digester-rules PUBLIC
        "-//Apache Commons //DTD digester-rules XML V1.0//EN"
        "http://commons.apache.org/digester/dtds/digester-rules-3.0.dtd">
<digester-rules>
    <pattern value="root/foo">
        <object-create-rule classname="Foo"/>
        <include url="classpath:/rules2.xml"/>
    </pattern>
    <pattern value="root/foo2">
        <object-create-rule classname="Foo"/>
        <include url="classpath:/rules2.xml"/>
    </pattern>
</digester-rules>

rules2.xml
<?xml version="1.0"?>
<!DOCTYPE digester-rules PUBLIC
        "-//Apache Commons //DTD digester-rules XML V1.0//EN"
        "http://commons.apache.org/digester/dtds/digester-rules-3.0.dtd">
<digester-rules>
    <pattern value="bar">
        <object-create-rule classname="Bar"/>
    </pattern>
</digester-rules>

    
> Groundless "Circular file inclusion detected" exception when including rules XML file
> -------------------------------------------------------------------------------------
>
>                 Key: DIGESTER-167
>                 URL: https://issues.apache.org/jira/browse/DIGESTER-167
>             Project: Commons Digester
>          Issue Type: Bug
>    Affects Versions: 3.2
>            Reporter: Eugene Fedotov
>         Attachments: IncludeRule.zip
>
>
> Looks like org.apache.commons.digester3.xmlrules.IncludeRule doesn't remove the name
of included XML rules resource from the set of included files of the memoryRulesBinder after
included module is installed. Hence, one can include resource actually only once. Parsing
 of the following XML rules (slightly modified example from the documentation) causes unexpected
"Circular file inclusion detected" exception:
> rules1.xml
> {code:xml} 
> <?xml version="1.0"?>
> <!DOCTYPE digester-rules PUBLIC
>         "-//Apache Commons //DTD digester-rules XML V1.0//EN"
>         "http://commons.apache.org/digester/dtds/digester-rules-3.0.dtd">
> <digester-rules>
>     <pattern value="root/foo">
>         <object-create-rule classname="Foo"/>
>         <include url="classpath:/rules2.xml"/>
>     </pattern>
>     <pattern value="root/foo2">
>         <object-create-rule classname="Foo"/>
>         <include url="classpath:/rules2.xml"/>
>     </pattern>
> </digester-rules>
> {code}
> rules2.xml
> {code:xml} 
>  <?xml version="1.0"?>
> <!DOCTYPE digester-rules PUBLIC
>         "-//Apache Commons //DTD digester-rules XML V1.0//EN"
>         "http://commons.apache.org/digester/dtds/digester-rules-3.0.dtd">
> <digester-rules>
>     <pattern value="bar">
>         <object-create-rule classname="Bar"/>
>     </pattern>
> </digester-rules>
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message