CAS 5.3 error defining custom login exceptions

242 views
Skip to first unread message

Yan Zhou

unread,
Sep 17, 2018, 3:52:46 PM9/17/18
to CAS Community
Hello, 

CAS 5.3.3 overlay on tomcat8.  I wish to display an error message on CAS login that says you have one more attempt or two more attempts to login, before get locked out.

I defined two new exception classes below in cas.properties.

cas.authn.exceptions.exceptions=org.apereo.cas.authentication.exceptions.OneMoreAttempLoginException,org.apereo.cas.authentication.exceptions.TwoMoreAttempLoginException

In message.properties, I provided the message.  When CAS starts up, I got this error. 

What am I missing?  Is this not the correct way to define a list of exception classes?

Thx!

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cas-org.apereo.cas.configuration.CasConfigurationProperties':
 Could not bind properties to CasConfigurationProperties (prefix=cas, ignoreInvalidFields=false, ignoreUnknownFields=false, ignoreNestedProperties=false); neste
d exception is org.springframework.validation.BindException: org.springframework.boot.bind.RelaxedDataBinder$RelaxedBeanPropertyBindingResult: 1 errors
Field error in object 'cas' on field 'authn.exceptions.exceptions': rejected value [org.apereo.cas.authentication.exceptions.OneMoreAttempLoginException,org.ape
reo.cas.authentication.exceptions.TwoMoreAttempLoginException]; codes [typeMismatch.cas.authn.exceptions.exceptions,typeMismatch.authn.exceptions.exceptions,typ
eMismatch.exceptions,typeMismatch.java.util.List,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [cas.authn.
exceptions.exceptions,authn.exceptions.exceptions]; arguments []; default message [authn.exceptions.exceptions]]; default message [Failed to convert property va
lue of type 'java.lang.String' to required type 'java.util.List' for property 'authn.exceptions.exceptions'; nested exception is java.lang.IllegalArgumentExcept
ion: Could not find class [org.apereo.cas.authentication.exceptions.OneMoreAttempLoginException]]
        at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindin
gPostProcessor.java:336)
        at org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor.postProcessBeforeInitialization(ConfigurationPropertiesBindin
gPostProcessor.java:292)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanF
actory.java:409)
Reply all
Reply to author
Forward
0 new messages