にcasv 4.2.5
を配備しました。ログインはうまくいく。私は、ユーザーがTomcatを起動database.Byから属性にアクセスするために3日以来しようとした第二段階では、私はエラーを得た:DBからcas属性を取得した場合の例外
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'personDirectoryPrincipalResolver': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public final void org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver.setAttributeRepository(org.jasig.services.persondir.IPersonAttributeDao); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.jasig.services.persondir.IPersonAttributeDao] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Qualifier(value=attributeRepository)}...
これは私のdeployerConfigContext.xml
ファイル
</util:map>
<util:map id="authenticationHandlersResolvers">
<entry key-ref="proxyAuthenticationHandler" value-ref="proxyPrincipalResolver" />
<entry key-ref="primaryAuthenticationHandler" value-ref="primaryPrincipalResolver" />
</util:map>
<util:list id="authenticationMetadataPopulators">
<ref bean="successfulHandlerMetaDataPopulator" />
<ref bean="rememberMeAuthenticationMetaDataPopulator" />
</util:list>
<bean id="primaryPrincipalResolver"
class="org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver">
<property name="attributeRepository" ref="singleRowJdbcPersonAttributeDao" />
</bean>
<!-- <bean id="attributeRepository" class="org.jasig.services.persondir.support.NamedStubPersonAttributeDao"
p:backingMap-ref="attrRepoBackingMap" /> -->
<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
p:driverClass="${database.driverClass}" p:jdbcUrl="${database.url}"
p:user="${database.user}" p:password="${database.password}"
p:initialPoolSize="${database.pool.minSize}" p:minPoolSize="${database.pool.minSize}"
p:maxPoolSize="${database.pool.maxSize}"
p:maxIdleTimeExcessConnections="${database.pool.maxIdleTime}"
p:checkoutTimeout="${database.pool.maxWait}" p:acquireIncrement="${database.pool.acquireIncrement}"
p:acquireRetryAttempts="${database.pool.acquireRetryAttempts}"
p:acquireRetryDelay="${database.pool.acquireRetryDelay}"
p:idleConnectionTestPeriod="${database.pool.idleConnectionTestPeriod}"
p:preferredTestQuery="${database.pool.connectionHealthQuery}" />
<bean id="singleRowJdbcPersonAttributeDao"
class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
<constructor-arg index="0" ref="dataSource" />
<constructor-arg index="1"
value="SELECT * FROM VIEWNUTZ_ROLLE WHERE {0}" />
<property name="queryAttributeMapping">
<map>
<entry key="username" value="EMAIL" />
</map>
</property>
<property name="resultAttributeMapping">
<map>
<entry key="NUZ_ID" value="nuz_id" />
<entry key="EMAIL" value="username" />
<entry key="ROLLE" value="rolle" />
</map>
</property>
</bean>
<bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl">
<property name="registeredServices">
<list>
<bean class="org.jasig.cas.services.RegisteredServiceImpl">
<property name="id" value="0" />
<property name="name" value="HTTPS Services" />
<property name="description" value="YOUR HTTP Service" />
<property name="serviceId" value="https://**" />
<property name="allowedAttributes">
<list>
<value>NUZ_ID</value>
<value>EMAIL</value>
<value>ROLLE</value>
</list>
</property>
</bean>
</list>
</property>
</bean>
<alias name="queryDatabaseAuthenticationHandler" alias="primaryAuthenticationHandler" />
<alias name="dataSource" alias="queryDatabaseDataSource" />
<!-- -->
<bean id="passwordEncoder"
class="de.nrw.it.portal.dias.cas.authentication.handler.Base64PasswordEncoder" />
<!-- <bean id="iPersonAttributeDao" class="org.jasig.services.persondir.IPersonAttributeDao"
/> -->
<alias name="personDirectoryPrincipalResolver" alias="primaryPrincipalResolver" />
<!-- <util:map id="attrRepoBackingMap"> <entry key="uid" value="uid" />
<entry key="eduPersonAffiliation" value="eduPersonAffiliation" /> <entry
key="groupMembership" value="groupMembership" /> <entry> <key> <value>memberOf</value>
</key> <list> <value>faculty</value> <value>staff</value> <value>org</value>
</list> </entry> </util:map> -->
<alias name="serviceThemeResolver" alias="themeResolver" />
<alias name="jsonServiceRegistryDao" alias="serviceRegistryDao" />
<alias name="defaultTicketRegistry" alias="ticketRegistry" />
<alias name="ticketGrantingTicketExpirationPolicy" alias="grantingTicketExpirationPolicy" />
<alias name="multiTimeUseOrTimeoutExpirationPolicy" alias="serviceTicketExpirationPolicy" />
<alias name="anyAuthenticationPolicy" alias="authenticationPolicy" />
<alias name="acceptAnyAuthenticationPolicyFactory" alias="authenticationPolicyFactory" />
<bean id="auditTrailManager"
class="org.jasig.inspektr.audit.support.Slf4jLoggingAuditTrailManager"
p:entrySeparator="${cas.audit.singleline.separator:|}"
p:useSingleLine="${cas.audit.singleline:false}" />
<alias name="neverThrottle" alias="authenticationThrottle" />
<util:list id="monitorsList">
<ref bean="memoryMonitor" />
<ref bean="sessionMonitor" />
</util:list>
<alias name="defaultPrincipalFactory" alias="principalFactory" />
<alias name="defaultAuthenticationTransactionManager" alias="authenticationTransactionManager" />
<alias name="defaultPrincipalElectionStrategy" alias="principalElectionStrategy" />
<alias name="tgcCipherExecutor" alias="defaultCookieCipherExecutor" />
です
cas.properties
ファイル:
cas.principal.resolver.persondir.return.null=false
:)
私はそれをumcommentedしましたが、私はまだエラーが発生します: – Karima
それは私が得るエラーです:タイプ[org.jasig.services.persondir.IPersonAttributeDao]の修飾Beanが見つかりません:依存性のために見つかった:少なくとも1つのbeanはautowireこの依存関係の候補。依存関係注釈:{@ org.springframework.beans.factory.annotation.Qualifier(value = attributeRepository)} – Karima