On August 13, 2009 07:20:22 pm Marvin Addison wrote:
> >  Finally I tried copying the example file I found with the source at 
> > cas-server-3.3.3/cas-server-support-ldap/src/main/resources/deployerConfigContext.xml.
> >   This also produced errors
> > ...
> > org.springframework.beans.factory.BeanCreationException: Error creating 
> > bean with name 'servicesManager' defined in ServletContext resource 
> > [/WEB-INF/spring-configuration/applicationContext.xml]: Cannot resolve 
> > reference to bean 'serviceRegistryDao' while setting constructor argument; 
> > nested exception is 
> > org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean 
> > named 'serviceRegistryDao' is defined
> 
> I'm not surprised.  That file is provided as a reference, but is not
> maintained with new additions to CAS, so it's not surprising that bean
> defnitions are missing that other CAS components need.  I recommend
> you return to your original approach, following the examples in the
> LDAP page you mentioned, and post the errors and we'll address those.
> I'm confident we can get you up and working.
> 
Thank you, Marvin.  I was able to get it working by starting with the default 
file and editing that.  I had to read the documentation at least ten times 
before it started to make sense...  Below is my working copy of 
deployerConfigContext.xml with the comments removed for anyone that might find 
it useful.

<?xml version="1.0" encoding="UTF-8"?>                                          
                                                                                
      
<beans xmlns="http://www.springframework.org/schema/beans";                      
                                     
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";                    
                                     
       xmlns:p="http://www.springframework.org/schema/p";                        
                                     
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd";>

        <bean id="contextSource" 
class="org.springframework.ldap.core.support.LdapContextSource">
                <property name="urls">                                          
                 
                        <list>                                                  
                 
                                <value>ldap://localhost/</value>                
                 
                        </list>                                                 
                 
                </property>                                                     
                 
                <property name="userDn" value="cn=admin,dc=********,dc=com"/>   
                 
                <property name="password" value="********"/>                    
                 
                <property name="baseEnvironmentProperties">                     
                 
                        <map>                                                   
                 
                                <entry>                                         
                 
                                        <key>                                   
                 
                                                
<value>java.naming.security.authentication</value>
                                        </key>                                  
                  
                                        <value>simple</value>                   
                  
                                </entry>                                        
                  
                        </map>                                                  
                  
                </property>                                                     
                  
        </bean>                                                                 
                  
                                             
        <bean id="authenticationManager"                                        
                                 
                class="org.jasig.cas.authentication.AuthenticationManagerImpl"> 
                                 
                                                                          
                <property name="credentialsToPrincipalResolvers">               
                                                                          
                        <list>                                                  
                                                                                
                                                                                
 
                                <bean                                           
                                                                          
                                        
class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver"
 />                  
                                <bean                                           
                                                                          
                                        
class="org.jasig.cas.authentication.principal.HttpBasedServiceCredentialsToPrincipalResolver"
 />                  
                        </list>                                                 
                                                                          
                </property>                                                     
                                                                          

                <property name="authenticationHandlers">                        
                                                               
                        <list>                                                  
                                                                                
                                           
                                <bean 
class="org.jasig.cas.authentication.handler.support.HttpBasedServiceCredentialsAuthenticationHandler"
              
                                        p:httpClient-ref="httpClient" />        
                                                                                
                                  
                                <bean                                           
                                                                          
                                        
class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler" >             
                                  
                                                <property name="filter" 
value="uid=%u" />                                                               
  
                                                <property name="searchBase" 
value="ou=People,dc=********,dc=com" />                                       
                                                <property name="contextSource" 
ref="contextSource" />                                                     
                                </bean>                                         
                                                                          
                        </list>                                                 
                                                                          
                </property>                                                     
                                                                          
        </bean>                                                                 
                                                                          


        <bean id="userDetailsService" 
class="org.springframework.security.userdetails.memory.InMemoryDaoImpl">
                <property name="userMap">                                       
                              
                        <value>

                    </value>
                </property>
        </bean>

        <bean id="attributeRepository"
                
class="org.jasig.services.persondir.support.StubPersonAttributeDao">
                <property name="backingMap">
                        <map>
                                <entry key="uid" value="uid" />
                                <entry key="eduPersonAffiliation" 
value="eduPersonAffiliation" />
                                <entry key="groupMembership" 
value="groupMembership" />
                        </map>
                </property>
        </bean>

        <bean
                id="serviceRegistryDao"
                class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl" />
</beans>

-- 
Chris Purves

"Opera is where a guy gets stabbed in the back, and instead of dying, he 
sings." - Robert Burns

-- 
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