Aha, I didn't realize the existing cas.properties file was loaded via a PropertyPlaceholderConfigurer already.

I was able to get this to work by modifying cas-servlet.xml:

<bean id="casPropertyPlaceholderConfigurer2" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
                p:location="file:/etc/cas/dev.properties" />

and modifying spring-configuration/propertyFileConfigurer.xml:

<bean id="propertyPlaceholderConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
                p:location="file:/etc/cas/dev.properties" />

Thanks for the clue!

        Andy

On Sun, 26 Jun 2011, Scott Battaglia wrote:

There are multiple ApplicationContext loaders and certain properties aren't
available between contexts (i.e. if you look at 3.3.5's version of the
Spring config files it loads the cas.properties twice.  Newer versions both
just import the same bean from an external file to solve the problem.  My
guess is you are running into the context problem.


On Fri, Jun 24, 2011 at 7:42 PM, Andrew Morgan <[email protected]> wrote:

CAS version: 3.3.5

I'm trying to set the value of the host.name parameter, which is normally
in WEB-INF/cas.properties, from an external file.  I created a file
/etc/cas/dev.properties which contains:

host.name=login1

Then I added the following to the bottom of WEB-INF/deployerConfigContext.
**xml:

<!-- pull in some properties from an external file -->
<bean id="propertyConfigurer" class="org.springframework.**
beans.factory.config.**PropertyPlaceholderConfigurer"**>
       <property name="locations">
               <list>
                       <value>file:/etc/cas/dev.**properties</value>
               </list>
       </property>
</bean>

However, when I deploy the WAR, I get the following error:

2011-06-24 16:38:03,830 FATAL 
[org.jasig.cas.web.init.**SafeContextLoaderListener]
- SafeContextLoaderListener:
The Spring ContextLoaderListener we wrap threw on contextInitialized.
But for our having caught this error, the web application context would not
have initialized.
org.springframework.beans.**factory.**BeanDefinitionStoreException:
Invalid bean definition with name '**ticketGrantingTicketUniqueIdGe**nerator'
defined in ServletContext resource 
[/WEB-INF/spring-**configuration/**uniqueIdGenerators.xml]:
Could not resolve placeholder 'host.name'
       at org.springframework.beans.**factory.config.**
PropertyPlaceholderConfigurer.**processProperties(**
PropertyPlaceholderConfigurer.**java:268)
       at org.springframework.beans.**factory.config.**
PropertyResourceConfigurer.**postProcessBeanFactory(**
PropertyResourceConfigurer.**java:75)
       at org.springframework.context.**support.**
AbstractApplicationContext.**invokeBeanFactoryPostProcessor**
s(AbstractApplicationContext.**java:553)
       at org.springframework.context.**support.**
AbstractApplicationContext.**invokeBeanFactoryPostProcessor**
s(AbstractApplicationContext.**java:527)
       at org.springframework.context.**support.**
AbstractApplicationContext.**refresh(**AbstractApplicationContext.**
java:362)
       at org.springframework.web.**context.ContextLoader.**
createWebApplicationContext(**ContextLoader.java:255)

...


I have searched for a while, but I can't figure out why this doesn't work.
Any suggestions?

Thanks,
       Andy

--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/**display/JSG/cas-user<http://www.ja-sig.org/wiki/display/JSG/cas-user>


--
You are currently subscribed to [email protected] as: [email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

--
You are currently subscribed to [email protected] as: 
[email protected]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to