CASS 4.2.2 SingleRowJdbcPersonAttributeDao problem

125 views
Skip to first unread message

Eric PAPET

unread,
Jul 21, 2016, 4:14:13 PM7/21/16
to CAS Community
hi evry boby,

I am some problem for create the Principal with SingleRowJdbcPersonAttributeDao for poupulate data in my Pricipal.
My Config : 
<bean id="primaryPrincipalResolver"
          class="org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver"
          p:principalFactory-ref="principalFactory"
          p:attributeRepository-ref="singleRowJdbcPersonAttributeDao" />

<bean id="singleRowJdbcPersonAttributeDao"
class="org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao">
<constructor-arg index="0" ref="dbCasDataSource" />
<constructor-arg index="1"
value="SELECT login FROM my_schema.my_table WHERE {0}" />
<property name="queryAttributeMapping">
<map>
<entry key="username" value="login" />
</map>
</property>
<property name="resultAttributeMapping">
       <map>
                 <entry key="login" value="login" />
       </map>
   </property>
</bean>


In database log the sql request is good :
LOG:  exécute <unnamed>: SELECT login  FROM my_schema.my_table WHERE login = $1
 paramètres : $1 = 'test'


My cas log :
2016-07-21 21:53:36,406 DEBUG [org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver] - <Attempting to resolve a principal...>
2016-07-21 21:53:36,407 DEBUG [org.jasig.cas.authentication.principal.PersonDirectoryPrincipalResolver] - <Creating SimplePrincipal for [test]>
2016-07-21 21:53:36,407 DEBUG [org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] - <Created seed map='{username=[test]}' for uid='test'>
2016-07-21 21:53:36,407 DEBUG [org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] - <Adding attribute 'login' with value 'test]' to query builder 'null'>
2016-07-21 21:53:36,407 DEBUG [org.jasig.services.persondir.support.jdbc.SingleRowJdbcPersonAttributeDao] - <Generated query builder 'sql=[login = ?] args=[test]' from query Map {username=[test]}.>
2016-07-21 21:53:36,410 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - <Executing prepared SQL query>
2016-07-21 21:53:36,410 DEBUG [org.springframework.jdbc.core.JdbcTemplate] - <Executing prepared SQL statement [SELECT login, password FROM agadir_annuaire.compte_utilisateur WHERE login = ?]>
2016-07-21 21:53:36,415 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - <Fetching JDBC Connection from DataSource>
2016-07-21 21:53:36,418 TRACE [org.springframework.jdbc.core.StatementCreatorUtils] - <Setting SQL statement parameter value: column index 1, parameter value [test], value class [java.lang.String], SQL type unknown>
2016-07-21 21:53:36,422 DEBUG [org.springframework.jdbc.datasource.DataSourceUtils] - <Returning JDBC Connection to DataSource>
2016-07-21 21:53:36,424 WARN [org.jasig.cas.web.flow.token.TokenAuthenticationAction] - <'principal' cannot be null.
Check the correctness of @Audit annotation at the following audit point: execution(public abstract org.jasig.cas.authentication.Authentication org.jasig.cas.authentication.AuthenticationManager.authenticate(org.jasig.cas.authentication.AuthenticationTransaction))
java.lang.IllegalArgumentException: 'principal' cannot be null.

Somme body use SingleRowJdbcPersonAttributeDao problem ?

I tested since 3 days.

Best regards
Eric Papet

Karima

unread,
Oct 11, 2016, 4:54:40 PM10/11/16
to CAS Community
Hi Eric,

i am using cas 4,2.5 and i have also the same problem like you. Did you resolve your issue ? if yes, please advise how to solve it.

Thank you

elha...@googlemail.com

unread,
Jul 7, 2017, 4:23:45 AM7/7/17
to CAS Community
Hi Eric,

please try to add this dependency in your pom.xml if you re working with maven:

<dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-collections4</artifactId>
            <version>4.1</version>
 </dependency>

that solved my problem.

Best regards,
Karima


Am Donnerstag, 21. Juli 2016 22:14:13 UTC+2 schrieb Eric PAPET:
Reply all
Reply to author
Forward
0 new messages