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.