Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.5
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      Hello,

      I am trying to define my rules in a xml file, read it once and reuse them
      throughout the application. I experienced the following problems by doing so:

      I defined my rules in a rule-file and created a RulesSet with the
      org.apache.commons.digester.xmlrules.FromXmlRuleSet. However when i reused this
      RuleSet for the second Digester call:

      Digester digester = new Digester()
      digester.addRuleSet(rsh.getRuleSet());

      (where rsh.getRuleSet() returns the one instance of the RuleSet), the call
      addRuleSet failed with a
      "java.lang.NoSuchMethodException: No such accessible method: add() on object:
      org.apache.commons.digester.ObjectCreateRule."
      This is logical because there is no such method in ObjectCreateRule.

      If i create a new RuleSet for each digester it works fine.

      I did some debugging and i found out that when you add a RuleSet to a Digester
      the Digester performs a [ruleSet.addRuleInstances(this);] Is it true that this
      call adds all the standard rules to the RulesSet again so they are now devined
      double in the RuleSet?

      What is the proper way to define your rules in a xml file and create Rules from
      that file. In http://wiki.apache.org/jakarta-commons/Digester/FAQ 1.3 is stated
      that one can reuse a RulesBase safely, but how can a RulesBase be created from
      a xml file? Does the FAQ 1.3 not apply to a RulesSet?

      Regards,
      Lars Vonk

        Activity

        lars created issue -
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 31137 12341710
        Henri Yandell made changes -
        Key COM-1558 DIGESTER-12
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Affects Version/s 1.5 Final [ 12311664 ]
        Project Commons [ 12310458 ] Commons Digester [ 12310471 ]
        Component/s Digester [ 12311111 ]
        Henri Yandell made changes -
        Affects Version/s 1.5 Final [ 12311691 ]
        Henri Yandell made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            lars
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development