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

Jochen Tümmers updated DIGESTER-198:
------------------------------------
    Description: 
When using the "same" XML include rule like
{code:java}
<include url="classpath:<rulesFilePath>" />{code}
multiple times within {*}another XML rules file{*}, Digester 3.2 fails with an 
error message:
{code:java}
java.lang.Error: Loading runtime configuration failed 
[org.apache.commons.digester3.binder.DigesterLoadingException: Digester 
creation errors:1) Circular file inclusion detected for XML rules: 
<rulesFilePath> (AbstractRulesModule.java:46)1 error]
{code}
even if there is no circurlar inclusion of XML rules file (XML rules file A 
includes XML rules file B for procssing two different patterns the same way; no 
additional includes for A in B).

Please see the test included in the attached Maven project.

A single XML rules file should be reusable for parsing different elements of an 
XML file that have the same internal structure (see <element> and 
<anotherElement> in configuration.xml that both contain the same structure (see 
<parameters><parameter name="..." value="..." />...</parameters>)

Therefore, including an XML rules file multiple times within another XML rules 
file for processing different patterns should be allowed as long as the 
included XML rules file does not cause a (real) circular chain of inclusions.

  was:
When using the "same" XML include rule like
{code:java}
<include url="classpath:<rulesFilePath>" />{code}
multiple times within {*}another XML rules file{*}, Digester 3.2 fails with an 
error message:

 
{code:java}
java.lang.Error: Loading runtime configuration failed 
[org.apache.commons.digester3.binder.DigesterLoadingException: Digester 
creation errors:1) Circular file inclusion detected for XML rules: 
<rulesFilePath> (AbstractRulesModule.java:46)1 error]
{code}
even if there is no circurlar inclusion of XML rules file (XML rules file A 
includes XML rules file B for procssing two different patterns the same way; no 
additional includes for A in B).

Please see the test included in the attached Maven project.

A single XML rules file should be reusable for parsing different elements of an 
XML file that have the same internal structure (see <element> and 
<anotherElement> in configuration.xml that both contain the same structure (see 
<parameters><parameter name="..." value="..." />...</parameters>)

Therefore, including an XML rules file multiple times within another XML rules 
file for processing different patterns should be allowed as long as the 
included XML rules file does not cause a (real) circular chain of inclusions.


> Including the same XML rules file multiple times within another XML rules 
> file using <include url="classpath:<rulesFilePath> " /> causes 
> DigesterLoadingException (Circular file inclusion detected for XML rules)
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DIGESTER-198
>                 URL: https://issues.apache.org/jira/browse/DIGESTER-198
>             Project: Commons Digester
>          Issue Type: Bug
>    Affects Versions: 3.2
>         Environment: OS: Windows 7, version 6.1, amt64
> Java JDK 08.00.00-144_x64
> Apache Maven 3.6.2
>  
>            Reporter: Jochen Tümmers
>            Priority: Minor
>         Attachments: testApacheDigester3XmlIncludeRule.zip
>
>
> When using the "same" XML include rule like
> {code:java}
> <include url="classpath:<rulesFilePath>" />{code}
> multiple times within {*}another XML rules file{*}, Digester 3.2 fails with 
> an error message:
> {code:java}
> java.lang.Error: Loading runtime configuration failed 
> [org.apache.commons.digester3.binder.DigesterLoadingException: Digester 
> creation errors:1) Circular file inclusion detected for XML rules: 
> <rulesFilePath> (AbstractRulesModule.java:46)1 error]
> {code}
> even if there is no circurlar inclusion of XML rules file (XML rules file A 
> includes XML rules file B for procssing two different patterns the same way; 
> no additional includes for A in B).
> Please see the test included in the attached Maven project.
> A single XML rules file should be reusable for parsing different elements of 
> an XML file that have the same internal structure (see <element> and 
> <anotherElement> in configuration.xml that both contain the same structure 
> (see <parameters><parameter name="..." value="..." />...</parameters>)
> Therefore, including an XML rules file multiple times within another XML 
> rules file for processing different patterns should be allowed as long as the 
> included XML rules file does not cause a (real) circular chain of inclusions.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to