Generated Spring applicationContext root names are different across platforms 
for the same configuration
--------------------------------------------------------------------------------------------------------

                 Key: CDV-517
                 URL: https://jira.terracotta.org/jira//browse/CDV-517
             Project: Community Development
          Issue Type: Bug
          Components: SpringRuntime
    Affects Versions: 2.4.5
            Reporter: Gary Keim
            Assignee: Issue Review Board


If you run the same Spring application on both Windows and Unix, using the same 
server, you'll get two different roots because the generated root name for the 
applicationContext are different due to differing values for the line.separator 
system property.

By default, if no custom appContext root-name is declared in the config, 
DistributableBeanFactoryMixin.calculateId generates a string that combines the 
application name and all bean definition locations. For the JMX demo that would 
be:

app jmx
params demo/jmx/applicationContext.xml

This string is then MD5'd and ASCII-encoded resulting in the root name:

0303010B060B0F0D080B0A070C020405

Because there are platform-dependent newline characters in the source string, 
the generated root names are different for the same configuration.

Fix: in the source string, replace System.getProperty("line.separator") --> 
some other character
Workaround: specify a custom root-name for your application-context:

<application-context>
  <paths>
    <path>*/applicationContext.xml</path>
  </paths>
  <root-name>applicationContext</root-name>
</application-context>




-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://jira.terracotta.org/jira//secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        
_______________________________________________
tc-dev mailing list
[email protected]
http://lists.terracotta.org/mailman/listinfo/tc-dev

Reply via email to