日期:2014-05-20  浏览次数:20933 次

求cas高手
我做了一个简单的cas应用在布置服务器端的时候一直报一个错误不知道怎么改,求高手解释 下面是贴出错误信息和 配置文件

2012-10-10 16:51:31,847 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'centralAuthenticationService' defined in ServletContext resource [/WEB-INF/spring-configuration/applicationContext.xml]: Cannot resolve reference to bean 'authenticationManager' while setting bean property 'authe
nticationManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticationManager' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot create inner bean 'org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthentica
tionHandler#19fe451' of type [org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler] while setting bean property 'authenticationHandlers' with key [3]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.jasig.cas.adaptors.jdbc.Que
ryDatabaseAuthenticationHandler#19fe451' defined in ServletContext resource [/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named
 'dataSource' is defined
   

这里是配置文件
 <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">  
<property name="driverClassName"><value>com.microsoft.sqlserver.jdbc.SQLServerDriver</value></property>  
<property name="url"><value>jdbc:sqlserver://192.168.20.42:1433;DatabaseName=iplat_eca_cas</value></property>  
<property name="username"><value>sa</value></property>  
<property name="password"><value>sa</value></property>
</bean>

<bean id="MD5PasswordEncoder" class="org.jasig.cas.authentication.handler.DefaultPasswordEncoder">  
<constructor-arg index="0">  
<value>MD5</value>  
</constructor-arg>
</bean>

<bean class="org.jasig.cas.adaptors.jdbc.QueryDatabaseAuthenticationHandler">  
<property ref="dataSource" name="dataSource"></property>  
<property name="sql" value="select passWord from iplat_eca_cas where userName=?"></property>  

<property ref="MD5PasswordEncoder" name="passwordEncoder"></property>
</bean>

------解决方案--------------------
spring的错误,和cas没关系啊
------解决方案--------------------
探讨

引用:

spring的错误,和cas没关系啊

不太明白这个错误什么意思 该怎么改呢?最后想问下cas服务器端配置的时候是不是只要将modules下面的war包跟cas-server-support-jdbc-3.4.3.1.jar和数据库连接的jar包导入就行了,还需要改其他的地方吗?我试过如果不改deployerConfigContext.xmL这个配置文件中的数……