问题
After a recent upgrade of a Spring Boot application that relies on CAS for authentication, the project no longer compiles due to the fact that the setCasServerUrlPrefix
method can't be found on SingleSignOutFilter
:
java: cannot find symbol
symbol: method setCasServerUrlPrefix(java.lang.String)
location: variable singleSignOutFilter of type org.jasig.cas.client.session.SingleSignOutFilter
The involved code is:
@Bean
public SingleSignOutFilter singleSignOutFilter() {
SingleSignOutFilter singleSignOutFilter = new SingleSignOutFilter();
singleSignOutFilter.setCasServerUrlPrefix("...");
singleSignOutFilter.setIgnoreInitConfiguration(true);
return singleSignOutFilter;
}
How to update the code to still set this value even though the setter doesn't exist anymore?
回答1:
It looks like this method has been removed since cas-client
3.6.0 (reference commit) as it was not used internally so calling setCasServerUrlPrefix
is no longer needed.
Not really semantic-version-friendly as there were no deprecation cycle and this change is introduced in a point release but at least, it is safe to remove from your code base.
来源:https://stackoverflow.com/questions/64354432/cannot-resolve-setcasserverurlprefix-in-singlesignoutfilter