Sorry for the spam here, but I have one last update:
I changed propertyFileConfigurer.xml to look like so:
<bean id="propertyPlaceholderConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreResourceNotFound"
value="true"/>
<property name="locations">
<list>
<value>/WEB-INF/cas.properties</value>
</list>
</property>
</bean>
Hence, I added back in ignoreResourceNotFound, and I tweaked the location of
cas.properties value (removing the "classpath:" qualifier).
When I re-build and deploy, I now get this exception:
2014-06-12 16:01:55,511 ERROR
[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 'ticketGrantingTicketUniqueIdGenerator' defined in
ServletContext resource [/WEB-INF/spring-configuration/uniqueIdGenerators.xml]:
Could not resolve placeholder 'host.name' in string value "${host.name}"
at
org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:209)
at
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:220)
I am totally out of ideas at this point. I would think host.name would be a
property that CAS would be able to define by default.
From: Zac Harvey
Sent: Thursday, June 12, 2014 3:56 PM
To: '[email protected]'
Subject: RE: CAS securityContext exception
Update:
In propertyFileConfigurer.xml I removed this property:
<property name="ignoreResourceNotFound"
value="true"/>
Then I built and re-deployed cas.war to Tomcat. Now the exception I see is:
Caused by: java.io.FileNotFoundException: class path resource
[WEB-INF/cas.properties] cannot be opened because it does not exist
at
org.springframework.core.io.ClassPathResource.getInputStream(ClassPathResource.java:157)
at
org.springframework.core.io.support.EncodedResource.getInputStream(EncodedResource.java:143)
at
org.springframework.core.io.support.PropertiesLoaderUtils.fillProperties(PropertiesLoaderUtils.java:98)
at
org.springframework.core.io.support.PropertiesLoaderSupport.loadProperties(PropertiesLoaderSupport.java:175)
at
org.springframework.core.io.support.PropertiesLoaderSupport.mergeProperties(PropertiesLoaderSupport.java:156)
at
org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:78)
... 21 more
So it's almost like cas.properties can't be "seen" by CAS (although it
certainly exists under WEB-INF), and it's almost like CAS's default
cas.properties isn't defining a cas.securityContext.status.allowedSubnet
property. Very bizarre...
From: Zac Harvey
Sent: Thursday, June 12, 2014 3:37 PM
To: '[email protected]'
Subject: CAS securityContext exception
My WEB-INF/spring-configuration/propertyFileConfigurer.xml defines a location
for cas.properties as:
<bean id="propertyPlaceholderConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="ignoreResourceNotFound"
value="true"/>
<property name="locations">
<list>
<value>classpath:/WEB-INF/cas.properties</value>
</list>
</property>
</bean>
My WEB-INF/cas.properties file (the entire file):
## Log4j
log4j.config.location=classpath:log4j.xml
## CAS core
cas.securityContext.status.allowedSubnet=127.0.0.1
My src/main/log4j.xml file has CAS logging to a /var/log/mycas.log file.
When I deploy cas.war (using 4.0.0) to my Tomcat7 server, I see the following
exception in mycas.log:
2014-06-12 15:00:37,200 ERROR
[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
'org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0'
defined in null: Could not resolve placeholder
'cas.securityContext.status.allowedSubnet' in string value
"hasIpAddress('${cas.securityContext.status.allowedSubnet}')"
at
org.springframework.beans.factory.config.PlaceholderConfigurerSupport.doProcessProperties(PlaceholderConfigurerSupport.java:209)
at
org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:220)
at
org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:84)
at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:694)
at
org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:669)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
... rest of stack trace omitted for brevity
I get this exception regardless of whether my cas.properties file has a
"cas.securityContext.status.allowedSubnet" property or not. Ideas?
--
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