CAS Ldaptive connectTimeout java.time.Duration

218 views
Skip to first unread message

Brandon Martin

unread,
Oct 17, 2016, 1:19:29 PM10/17/16
to CAS Community
I am currently configuring CAS 4.2.6 with the Docker image here: https://github.com/apereo/cas/tree/dockerized-caswebapp
Using the template from here: https://github.com/apereo/cas-overlay-template

The template and docker container seem to work out of the box, my troubles are connecting to Active Directory (using ldaptive).

I have tried a few deployerContextConfig scenarios now, and when I have one that seems to work, it's failing with this error being the primary cause:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'authenticator': Cannot create inner bean '(inner bean)#77cf329d' of type [org.ldaptive.auth.PooledSearchDnResolver] while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#77cf329d': Cannot create inner bean '(inner bean)#6e78177b' of type [org.ldaptive.pool.PooledConnectionFactory] while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6e78177b': Cannot create inner bean '(inner bean)#798b36fd' of type [org.ldaptive.pool.BlockingConnectionPool] while setting bean property 'connectionPool'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#798b36fd': Cannot create inner bean '(inner bean)#20171cdc' of type [org.ldaptive.DefaultConnectionFactory] while setting bean property 'connectionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#20171cdc': Cannot create inner bean '(inner bean)#6abb44cb' of type [org.ldaptive.ConnectionConfig] while setting bean property 'connectionConfig'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#6abb44cb': Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type [java.lang.String] to required type [java.time.Duration] for property 'connectTimeout'; nested exception is java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [java.time.Duration] for property 'connectTimeout': no matching editors or conversion strategy found


Seems like such a silly error, I have everything the same as others online, but have found no equivalent error reported..

Here's for reference:

Problematic code from deployerContextConfig.xml:

<ldaptive:ad-authenticator id="authenticator"
            ldapUrl="${ldap.url}"
            userFilter="${ldap.searchFilter}"
            bindDn="${ldap.managerDn}"
            bindCredential="${ldap.managerPassword}"
            allowMultipleDns="${ldap.allowMultipleDns:false}"
            connectTimeout="${ldap.connectTimeout}"
            validateOnCheckOut="${ldap.pool.validateOnCheckout}"
            failFastInitialize="true"
            blockWaitTime="${ldap.pool.blockWaitTime}"
            idleTime="${ldap.pool.idleTime}"
            baseDn="${ldap.baseDn}"
            maxPoolSize="${ldap.pool.maxSize}"
            minPoolSize="${ldap.pool.minSize}"
            validatePeriodically="${ldap.pool.validatePeriodically}"
            validatePeriod="${ldap.pool.validatePeriod}"
            prunePeriod="${ldap.pool.prunePeriod}"
            useSSL="${ldap.use.ssl:false}"
            subtreeSearch="${ldap.subtree.search:true}"
            useStartTLS="${ldap.useStartTLS}" />

snippet from cas.properties:

# LDAP connection timeout in milliseconds
ldap.connectTimeout=3000

from pom.xml:

<dependency>
<groupId>org.jasig.cas</groupId>
<artifactId>cas-server-support-ldap</artifactId>
<version>${cas.version}</version>
</dependency>
<dependency>
<groupId>org.ldaptive</groupId>
<artifactId>ldaptive</artifactId>
<version>1.2.0</version>
</dependency>

Possibly different version of ldaptive required?

Daniel Fisher

unread,
Oct 17, 2016, 1:52:41 PM10/17/16
to cas-...@apereo.org
On Mon, Oct 17, 2016 at 1:19 PM, Brandon Martin <mar...@edtools.psd401.net> wrote:

Possibly different version of ldaptive required?

Yes. 1.2.x moved all integer based time properties to durations. So either downgrade to 1.1.x or change your properties.

Note that you've got about a half dozen other properties in your config you'll also need to change to duration syntax.

--Daniel Fisher

Daniel Fisher

unread,
Oct 17, 2016, 3:38:24 PM10/17/16
to cas-...@apereo.org
On Mon, Oct 17, 2016 at 3:32 PM, Martin, Brandon <mar...@edtools.psd401.net> wrote:
Thank you for the information.

3000 is an integer, so my presumption was I need to remove the quotes from xml for the attribute to be an integer and not a string. Well this doesn't work.

You need to convert 3000 to a duration. In this case, 3000 == PT3S
 

I don't understand how to force the data type to integer. Is ldaptive 1.1.x compatible with CAS 4.2.6?

I'm not sure about which versions are compatible where, Misgah can take that one.

--Daniel Fisher

Misagh Moayyed

unread,
Oct 17, 2016, 3:47:35 PM10/17/16
to cas-...@apereo.org

4.2.x runs with ldaptive 1.x by default. I recommend you don’t change that version. You don’t need to explicitly pull in the ldaptive dependency. CAS will do that for you.  Follow the docs. 


-- 

Misagh

I'm not sure about which versions are compatible where, Misagh can take that one.

--Daniel Fisher

--
CAS gitter chatroom: https://gitter.im/apereo/cas
CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
CAS documentation website: https://apereo.github.io/cas
CAS project website: https://github.com/apereo/cas
---
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/CAFC6YwT6V2qyV6ZSqv%2Bn-iZmTdO3EhzUpa3acqyrc30B8qH5hQ%40mail.gmail.com.
For more options, visit https://groups.google.com/a/apereo.org/d/optout.

Martin, Brandon

unread,
Oct 18, 2016, 11:17:39 AM10/18/16
to Misagh Moayyed, CAS Community
Thank you for the insight, I removed the ldaptive dependency from my pom.xml and this seemed to move my deployment farther. 

On Mon, Oct 17, 2016 at 12:47 PM, Misagh Moayyed <misagh....@gmail.com> wrote:

4.2.x runs with ldaptive 1.x by default. I recommend you don’t change that version. You don’t need to explicitly pull in the ldaptive dependency. CAS will do that for you.  Follow the docs. 


-- 

Misagh



From: Daniel Fisher <dfi...@vt.edu>
Reply: Daniel Fisher <dfi...@vt.edu>
Date: October 17, 2016 at 11:08:24 PM
To: cas-...@apereo.org <cas-...@apereo.org>
Subject:  Re: [cas-user] CAS Ldaptive connectTimeout java.time.Duration

On Mon, Oct 17, 2016 at 3:32 PM, Martin, Brandon <mar...@edtools.psd401.net> wrote:
Thank you for the information.

3000 is an integer, so my presumption was I need to remove the quotes from xml for the attribute to be an integer and not a string. Well this doesn't work.

You need to convert 3000 to a duration. In this case, 3000 == PT3S
 

I don't understand how to force the data type to integer. Is ldaptive 1.1.x compatible with CAS 4.2.6?

I'm not sure about which versions are compatible where, Misagh can take that one.

--Daniel Fisher

--
CAS gitter chatroom: https://gitter.im/apereo/cas
CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
CAS documentation website: https://apereo.github.io/cas
CAS project website: https://github.com/apereo/cas
---
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+unsubscribe@apereo.org.

--
CAS gitter chatroom: https://gitter.im/apereo/cas
CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
CAS documentation website: https://apereo.github.io/cas
CAS project website: https://github.com/apereo/cas
---
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/Cv6Y6rUr-Lc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cas-user+unsubscribe@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/.
Reply all
Reply to author
Forward
0 new messages