Как заставить ehcache 3 работать с плагином безопасности Grails Spring? - PullRequest
0 голосов
/ 30 мая 2019

В моем проекте Grails 3 используются следующие зависимости:

compile ('org.grails.plugins:cache-ehcache:3.0.0.M1') {
    exclude group: 'org.ehcache:ehcache', module: 'ehcache'
}
compile 'org.ehcache:ehcache:3.7.0'
compile 'org.grails.plugins:spring-security-core:3.2.3'

Тем не менее, Spring-Security-Core использует ehcache 2. Иногда приложение не запускается, так как классы с одинаковым именем квалификатора существуют вдве разные банки.

Пример ошибки:

attempt was made to call the method org.terracotta.statistics.StatisticsManager.createPassThroughStatistic(Ljava/lang/Object;Ljava/lang/String;Ljava/util/Set;Lorg/terracotta/statistics/StatisticType;Ljava/util/function/Supplier;)V but it does not exist. Its class, org.terracotta.statistics.StatisticsManager, is available from the following locations:

jar:file:/usr/local/ingenuity/kang/kang-2.2.2942/web/WEB-INF/lib/ehcache-2.10.5.jar!/org/terracotta/statistics/StatisticsManager.class
jar:file:/usr/local/ingenuity/kang/kang-2.2.2942/web/WEB-INF/lib/ehcache-3.7.0.jar!/org/terracotta/statistics/StatisticsManager.class 
...