You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by "Michal Stochmialek (JIRA)" <ji...@apache.org> on 2011/05/27 16:30:47 UTC

[jira] [Created] (SYNAPSE-774) loading resources from registry is not based on synapse.home

loading resources from registry is not based on synapse.home
------------------------------------------------------------

                 Key: SYNAPSE-774
                 URL: https://issues.apache.org/jira/browse/SYNAPSE-774
             Project: Synapse
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0
         Environment: tested on windows 
            Reporter: Michal Stochmialek
            Priority: Minor
             Fix For: 2.1


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.




--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org