2016-09-21 67 views
0

無效因爲我有問題與serviceRegisty.conf,我試過serviceRegistryDaoCAS:「allowedAttributes」是CAS 4.2.1

<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" /> 
        <property name="description" value="Only Allows HTTPS Urls" /> 
        <property name="serviceId" value="https://**" /> 
        <property name="evaluationOrder" value="10000001" /> 
        <property name="allowedAttributes"> 
         <list> 
          <value>cn</value> 
          <value>description</value> 
          <value>telephoneNumber</value> 
         </list> 
        </property> 
       </bean> 
      </list> 
     </property> 
    </bean> 

如果我不使用「allowedAttributes」一切工作正常,但我不要獲得我想要的屬性(我沒有)。所以我猜想我需要添加客戶端應該接受的屬性。不過,我得到以下異常:

2016-09-21 16:17:40,674 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed 
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centralAuthenticationService': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'defaultTicketRegistry': Inject 
ion of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasig.cas.logout.LogoutManager org.jasig.cas.ticket.registry.DefaultTicketRegistry.logoutManager; nested exception is org.springframework.beans.fac 
tory.BeanCreationException: Error creating bean with name 'logoutManager': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.jasig.cas.services.ServicesManager org.jasig.cas.logout.LogoutMana 
gerImpl.servicesManager; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'servicesManager' defined in URL [jar:file:/D:/Tomcat%20Servers/Tomcat%20CAS%20Server/webapps/cas/WEB-INF/lib/cas-server-core-services-4.2.0.jar!/org/jasig/cas 
/services/DefaultServicesManagerImpl.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [org.jasig.cas.services.ServiceRegistryDao]: : Error creating bean with name 'serviceRegistryDao' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: C 
annot create inner bean 'org.jasig.cas.services.RegisteredServiceImpl#286fad61' of type [org.jasig.cas.services.RegisteredServiceImpl] while setting bean property 'registeredServices' with key [0]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'org.jasig.cas.services.RegisteredServiceImpl#286fad61' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'allowedAttributes' of bean class [org.jas 
ig.cas.services.RegisteredServiceImpl]: Bean property 'allowedAttributes' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with 
name 'serviceRegistryDao' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot create inner bean 'org.jasig.cas.services.RegisteredServiceImpl#286fad61' of type [org.jasig.cas.services.RegisteredServiceImpl] while setting bean property 'registeredServices' with key [0]; n 
ested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.jasig.cas.services.RegisteredServiceImpl#286fad61' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Error setting property values; nested exception is org.springfram 
ework.beans.NotWritablePropertyException: Invalid property 'allowedAttributes' of bean class [org.jasig.cas.services.RegisteredServiceImpl]: Bean property 'allowedAttributes' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter? 
     at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:311) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1214) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:543) 
     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) 
     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) 
     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) 
     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) 
     at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:838) 
     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) 
     at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:446) 
     at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:328) 
     at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107) 
     at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4812) 
     at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5255) 
     at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
     at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:725) 
     at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:701) 
     at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:717) 
     at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:945) 
     at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1795) 
     at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
     at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 
     at java.lang.Thread.run(Thread.java:745) 

我懷疑是處理服務的方式是通過CAS 4.2.x版不再支持,但我不知道。

編輯:

我也試過這樣:

<bean id="serviceRegistryDao" class="org.jasig.cas.services.InMemoryServiceRegistryDaoImpl"> 
     <property name="registeredServices"> 
      <list> 
       <bean class="org.jasig.cas.services.RegexRegisteredService" 
         p:id="5" p:name="https.all" p:description="Allow HTTPS connection" 
         p:serviceId="^https://.*" p:evaluationOrder="5" > 

        <property name="attributeReleasePolicy"> 
         <bean class="org.jasig.cas.services.ReturnAllAttributeReleasePolicy" /> 
        </property> 
       </bean> 
      </list> 
     </property> 
    </bean> 

我想通過我可能得到的所有屬性。我現在可以運行tomcat服務器並登錄等,但我仍然沒有得到屬性。

+0

我在CAS客戶端和服務器上需要什麼依賴關係? – Goldi

回答

-1

該配置無效,因爲這不是4.2的工作原理。查閱文檔以學習新的語法。您還需要確保您的應用程序正在打到正確的端點。