<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Use of PropertyPlaceholderConfigurer in Alfresco Modules in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/use-of-propertyplaceholderconfigurer-in-alfresco-modules/m-p/254873#M208003</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Hetal,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for bringing the typo to my attention – it's not part of the code but was introduced when I anonymized my config values for display in the forum.&amp;nbsp; I didn't catch the discrepancy.&amp;nbsp; Sorry about that.&amp;nbsp; It should be fixed now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem remains though – Spring doesn't substitute property references with values read by the PropertyPlaceholderConfigurer class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Darryl&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Nov 2010 16:10:25 GMT</pubDate>
    <dc:creator>darryl_staflund</dc:creator>
    <dc:date>2010-11-15T16:10:25Z</dc:date>
    <item>
      <title>Use of PropertyPlaceholderConfigurer in Alfresco Modules</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/use-of-propertyplaceholderconfigurer-in-alfresco-modules/m-p/254871#M208001</link>
      <description>Hi there,I have spent the last couple of days moving some important configuration values out of the Spring context modules of my Alfresco AMPs into some property files.&amp;nbsp; But when I try to make use of them using a PropertyPlaceholderConfigurer bean, the values defined in the files aren't found.&amp;nbsp; I am</description>
      <pubDate>Fri, 12 Nov 2010 23:20:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/use-of-propertyplaceholderconfigurer-in-alfresco-modules/m-p/254871#M208001</guid>
      <dc:creator>darryl_staflund</dc:creator>
      <dc:date>2010-11-12T23:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use of PropertyPlaceholderConfigurer in Alfresco Modules</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/use-of-propertyplaceholderconfigurer-in-alfresco-modules/m-p/254872#M208002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Check the key that you have give in property file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG&gt;my_module_id.job.workflow_report.minor_correction.cron=0 0/5 * * * ? *&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And check the key that you have given in Spring bean reference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;property name="cronExpression" value="${&lt;/SPAN&gt;&lt;STRONG&gt;my.package.job.workflow_report.minor_correction.cron&lt;/STRONG&gt;&lt;SPAN&gt;}"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I think both are different which is the cause of this issue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;change either one to make it same as other will solve your problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hetal Patel,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CIGNEX Tech&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2010 06:37:51 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/use-of-propertyplaceholderconfigurer-in-alfresco-modules/m-p/254872#M208002</guid>
      <dc:creator>hap234</dc:creator>
      <dc:date>2010-11-15T06:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Use of PropertyPlaceholderConfigurer in Alfresco Modules</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/use-of-propertyplaceholderconfigurer-in-alfresco-modules/m-p/254873#M208003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Hetal,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for bringing the typo to my attention – it's not part of the code but was introduced when I anonymized my config values for display in the forum.&amp;nbsp; I didn't catch the discrepancy.&amp;nbsp; Sorry about that.&amp;nbsp; It should be fixed now.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem remains though – Spring doesn't substitute property references with values read by the PropertyPlaceholderConfigurer class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Darryl&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Nov 2010 16:10:25 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/use-of-propertyplaceholderconfigurer-in-alfresco-modules/m-p/254873#M208003</guid>
      <dc:creator>darryl_staflund</dc:creator>
      <dc:date>2010-11-15T16:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Use of PropertyPlaceholderConfigurer in Alfresco Modules</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/use-of-propertyplaceholderconfigurer-in-alfresco-modules/m-p/254874#M208004</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have figured out how to read spring configuration properties on a project-by-project basis.&amp;nbsp; It turns out that every PropertyPlaceholderConfigurer bean defined in a Spring application has to have a unique placeholder Prefix/Suffix combination – meaning that if you define two or more configurer beans using ${} as your placeholder syntax, only the values read by one of the beans will be used.&amp;nbsp; This is why Alfresco kept throwing an exception when trying to process my bean definitions – it couldn't find the properties defined by my configurer bean because the placeholder syntax was mapped to another bean.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I was able to get it working using the following configurer bean:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="location" value="classpath:alfresco/module/module_id/module_id.properties" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="placeholderPrefix" value="%{module_id:" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="placeholderSuffix" value="}" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;and the following placeholder references:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="module_id_maxVersionPolicy" class="company.id.alfresco.common.policies.MaxVersionPolicy" init-method="init"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="maxVersionPolicyCandidateSpecification" ref="module_id_maxVersionPolicyCandidateSpecification" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="policyComponent" ref="policyComponent" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="versionService" ref="versionService" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="maxVersions" value="%{module_id:policy.document_versioning.maxVersions}" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;My resource file looks as follows:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="language-none line-numbers"&gt;&lt;CODE&gt;&lt;BR /&gt;policy.document_versioning.maxVersions=10&lt;BR /&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Note that '${module:' won't work as a prefix because the '${' portion of the prefix causes Spring to map it to another configurer defined somewhere else in Alfresco.&amp;nbsp; I don't use '#{' so as not to conflict with JSF.&amp;nbsp; Since I have more than one module to support, I include the module id in the placeholder prefix.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this is helpful to someone.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Darryl&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 19 Nov 2010 21:54:30 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/use-of-propertyplaceholderconfigurer-in-alfresco-modules/m-p/254874#M208004</guid>
      <dc:creator>darryl_staflund</dc:creator>
      <dc:date>2010-11-19T21:54:30Z</dc:date>
    </item>
  </channel>
</rss>

