Uploaded image for project: 'Synapse'
  1. Synapse
  2. SYNAPSE-774

loading resources from registry is not based on synapse.home

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.0
    • NIGHTLY, 3.0.0
    • Core
    • None
    • tested on windows

    Description

      The issue appears when synapse.home is different from current directory of virtual machine.
      In my case it is when I want to run synapse from maven.

      The problem is in the following method:
      org.apache.synapse.config.xml.RegistryFactory.getProperties

      The method should gather properties from the xml element and add to them topLevelProps.
      This is done by using Properties(Properties) constructor, which doesn't copy all element
      from the argument to the object, but it treats properties from the argument as default values.

      In result in AbstractRegistry.init method not all properties are copied. Those top level ones are omitted
      including "synapse.home" property.

      When you change RegistryFactory.getProperties from:
      private static Properties getProperties(OMElement elem, Properties topLevelProps) {
      Iterator params = elem.getChildrenWithName(PARAMETER_Q);
      Properties props = new Properties(topLevelProps);
      while (params.hasNext()) {

      to:
      private static Properties getProperties(OMElement elem, Properties topLevelProps) {
      Iterator params = elem.getChildrenWithName(PARAMETER_Q);
      Properties props = new Properties();
      props.putAll(topLevelProps);

      while (params.hasNext()) {

      ..the issue is gone.

      Attachments

        Activity

          People

            hiranya Hiranya Kasub Jayathilaka
            michal.stochmialek Michal Stochmialek
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: