4.2 - Attribute Resolution via JDBC

107 views
Skip to first unread message

Mike Richards

unread,
Apr 27, 2016, 4:16:56 PM4/27/16
to CAS Community
I'm attempting to configure attribute resolution for a database-centric person directory.

Following the documentation for 4.2 I've done the following
  • Add the commons-collections4 apache dependency to pom.xml
  • Add the "Sample Usage" code for JDBC
    • dataSource bean is already defined
    • I've updated the resultAttributeMapping to match my underscore-less DB schema

On startup I get the following error: java.lang.NoClassDefFoundError: org/springframework/jdbc/core/simple/ParameterizedRowMapper


Looking at the spring framework source it seems that this class was dropped in 4.2 which seems concerning as jasig 4.2 seems to rely heavily on spring 4.2


Nevertheless, I added an explicit dependency for sping-jdbc per mvn repository. On restart I then got a new error: NoSuchMethodError: org.springframework.core.annotation.AnnotationAttributes.getAliasedString


It ... looks like AnnotationAttributes.getAliasedString was added in 4.2


Can anyone advise as to next steps towards resolving this? Is this an "open a bug report and try jasig 4.1 until it gets resolved" sort of situation?


Thank you much,


Mike

Misagh Moayyed

unread,
Apr 27, 2016, 6:48:34 PM4/27/16
to CAS Community

What is the version of PersonDirectory that you have in CAS? Is it 1.7.1? Check your lib directory and you should find the relevant JAR.

 

--
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 cas-user+u...@apereo.org.
To post to this group, send email to cas-...@apereo.org.
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/3841fbcd-85f2-4215-99bc-0a79419ec3f8%40apereo.org.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

Mike

unread,
Apr 27, 2016, 6:56:25 PM4/27/16
to Misagh Moayyed, CAS Community
person-directory-impl and api are 1.7.0

--
You received this message because you are subscribed to a topic in the Google Groups "CAS Community" group.
To unsubscribe from this topic, visit https://groups.google.com/a/apereo.org/d/topic/cas-user/LjF9OqC-HAw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cas-user+u...@apereo.org.

To post to this group, send email to cas-...@apereo.org.
Visit this group at https://groups.google.com/a/apereo.org/group/cas-user/.

Misagh Moayyed

unread,
Apr 27, 2016, 6:58:11 PM4/27/16
to CAS Community

Switch to 1.7.1. It should go away. The next patch release should do this for you automatically when it’s released.

 

Mike Richards

unread,
Apr 28, 2016, 11:40:01 AM4/28/16
to CAS Community, mmoa...@unicon.net
I added a 1.7.1 dependency to pom.xml but now get both 1.7.0 and 1.7.1

I've updated my deploy script to delete the 1.7.0 impl/api files and everything seems to work. Is there a better way, or does it necessitate waiting for the patch you mentioned?

Regardless, thank you much!

Mike

Misagh Moayyed

unread,
Apr 28, 2016, 12:13:20 PM4/28/16
to CAS Community

There is a different way, not necessarily a better way J and that is, in your pom.xml you start excluding that specific dependency from the cas-server-webapp. If you scan the list archives, you’ll find examples on how to do that, and the base overlay does have a few exclusions built in that you can use as a starting point.

 

If you’re already doing it in a deploy script, I’d say leave the pom be for now, upgrade and adjust your script afterwards.

 

Mike

unread,
Apr 28, 2016, 4:32:04 PM4/28/16
to Misagh Moayyed, CAS Community
I've run into further issues. What I believe to be the pertinent log output:

2016-04-28 19:55:59,309 INFO [org.jasig.cas.authentication.PolicyBasedAuthenticationManager] - <QueryDatabaseAuthenticationHandler successfully authenticated test>
2016-04-28 19:55:59,316 INFO [org.jasig.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: test
WHAT: 'principal' cannot be null.
Check the correctness of @Audit annotation at the following audit point: execution(public abstract transient org.jasig.cas.authentication.Authentication org.jasig.cas.authentication.AuthenticationManager.authenticate(org.jasig.cas.authentication.Credential[]))
ACTION: TICKET_GRANTING_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Thu Apr 28 19:55:59 GMT 2016
CLIENT IP ADDRESS: 10.1.128.5
SERVER IP ADDRESS: 10.1.118.81
=============================================================

Full log output at http://pastebin.com/LmJwZfhd (expires 5 May 2016).

I've pushed my working copy of cas-overlay-template to github - link to deployerConfigContext.xml For the changes I attempted to follow the 4.1 documentation with minimal deviation. For what it's worth, I have tried exactly this config with the following 2 changes (to exactly match the docs) and had the same result

-      p:attributeRepository-ref="attributeRepository"
+      p:attributeRepository-ref="singleRowJdbcPersonAttributeDao"
       p:returnNullIfNoAttributes="true" />

     <!-- JDBC attribute repository -->
-    <bean id="attributeRepository"
+    <bean id="singleRowJdbcPersonAttributeDao"


Please note that the 4.2 is not related the jasig version and that my cas-overlay-template is forked from the 4.1 branch. For what it's worth, the previous commit worked for JDBC-based database authentication and still appears to work per the logs ("successfully authenticated test).

Thank you again,

Mike

Misagh Moayyed

unread,
Apr 28, 2016, 4:34:52 PM4/28/16
to CAS Community

Look around in your container logs. There may be more indicators. If not, post your overlay to the cas-issues project.

Reply all
Reply to author
Forward
0 new messages