That’s the exact problem I was having the other day.  It’s a bug with 4.2 and 
4.2.1.  If you look in the comments on the link about the issue, there is a 
configuration work around.

https://github.com/Jasig/cas/issues/1691

From: [email protected] [mailto:[email protected]] On Behalf Of Harald 
Glanzer
Sent: Monday, May 02, 2016 2:00 PM
To: CAS Community
Subject: [cas-user] cas 4.2 and searchModeSearchDatabaseAuthenticationHandler

hi,

i am struggling with deploying the actual version of cas to our testserver. i 
need to use JDCB / searchModeSearchDatabaseAuthenticationHandler, which gives 
me this exception:

-----------------------------------------------------------------------------------------------------------------------------

2016-05-02 20:44:54,688 WARN 
[org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor]
 - <Inconsistent constructor declaration on bean with name 
'queryAndEncodeDatabaseAuthenticationHandler': single autowire-marked 
constructor flagged as optional - this constructor is effectively required 
since there is no default constructor to fall back to: public 
org.jasig.cas.adaptors.jdbc.QueryAndEncodeDatabaseAuthenticationHandler(javax.sql.DataSource,java.lang.String,java.lang.String)>
2016-05-02 20:44:54,690 WARN 
[org.springframework.web.context.support.XmlWebApplicationContext] - <Exception 
encountered during context initialization - cancelling refresh attempt: 
org.springframework.beans.factory.UnsatisfiedDependencyException: Error 
creating bean with name 'queryAndEncodeDatabaseAuthenticationHandler' defined 
in URL 
[jar:file:/var/lib/tomcat8/webapps/cas/WEB-INF/lib/cas-server-support-jdbc-4.2.1.jar!/org/jasig/cas/adaptors/jdbc/QueryAndEncodeDatabaseAuthenticationHandler.class]:
 Unsatisfied dependency expressed through constructor argument with index 0 of 
type [javax.sql.DataSource]: : No qualifying bean of type 
[javax.sql.DataSource] 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=queryEncodeDatabaseDataSource)}<mailto:%[email protected](value=queryEncodeDatabaseDataSource)%7d>;
 nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying 
bean of type [javax.sql.DataSource] 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=queryEncodeDatabaseDataSource)}<mailto:%[email protected](value=queryEncodeDatabaseDataSource)%7d>>
2016-05-02 20:44:54,735 WARN 
[org.jasig.cas.services.JsonServiceRegistryConfigWatcher] - <Directory key is 
no longer valid. Quitting watcher service>

-----------------------------------------------------------------------------------------------------------------------------

what have i done:

) git clone https://github.com/Jasig/cas-overlay-template.git
) edited pom.xml to include jdbc drivers
) mvn clean package
) copy cas.war to webapps dir of tomcat
) edited deployerConfigContext.xml as written in cas-doku:

-----------------------------------------------------------------------------------------------------------------------------

<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}" />

<alias name="searchModeSearchDatabaseAuthenticationHandler" 
alias="primaryAuthenticationHandler" />
<alias name="dataSource" alias="searchModeDatabaseDataSource" />

-----------------------------------------------------------------------------------------------------------------------------

) edited cas.properties to set database url / pass / ...

according to the doku @ 
https://jasig.github.io/cas/4.2.x/installation/Database-Authentication.html#database-authentication
 this should work, but i keep getting exceptions. plz be aware that i really 
need to
used 'searchModeDatabaseDataSource' as dataSource. it seems like other people 
have/had the same troubles.

thx in avance!
harri
--
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected]<mailto:[email protected]>.
To post to this group, send email to 
[email protected]<mailto:[email protected]>.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/bdc3dec3-36e3-4481-989f-214b98b9ede3%40apereo.org<https://groups.google.com/a/apereo.org/d/msgid/cas-user/bdc3dec3-36e3-4481-989f-214b98b9ede3%40apereo.org?utm_medium=email&utm_source=footer>.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "CAS 
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/aa36abdf5a0e4c7999a82484d7407762%40TGI-EX13BE03.pgac.com.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

Reply via email to