diff --git a/fineract-provider/dependencies.gradle b/fineract-provider/dependencies.gradle index 3fa3e44ab..85829ed63 100644 --- a/fineract-provider/dependencies.gradle +++ b/fineract-provider/dependencies.gradle @@ -72,6 +72,7 @@ dependencies { // JAX-B dependencies for JDK 9+ 'jakarta.xml.bind:jakarta.xml.bind-api', + 'org.dom4j:dom4j', 'javax.cache:cache-api', @@ -98,8 +99,9 @@ dependencies { implementation ('org.mnode.ical4j:ical4j') { exclude group: 'commons-logging' } - implementation ('org.ehcache:ehcache') { - exclude group: 'org.glassfish.jaxb', module: 'jaxb-runtime' + + runtimeOnly('org.ehcache:ehcache') { + exclude group: 'com.sun.activation' } // runtimeOnly dependencies are things that Fineract code has no direct compile time dependency on, but which must be present at run-time @@ -129,6 +131,7 @@ dependencies { testImplementation ('io.rest-assured:rest-assured') { exclude group: 'commons-logging' exclude group: 'org.apache.sling' + exclude group: 'com.sun.xml.bind' } testImplementation ('org.springframework.boot:spring-boot-starter-test') { exclude group: 'com.jayway.jsonpath', module: 'json-path' diff --git a/fineract-provider/properties/basicauth/application.properties b/fineract-provider/properties/basicauth/application.properties index 406e6b70d..64e5421f6 100644 --- a/fineract-provider/properties/basicauth/application.properties +++ b/fineract-provider/properties/basicauth/application.properties @@ -25,4 +25,3 @@ management.info.git.mode=FULL # FINERACT-914 server.forward-headers-strategy=framework -spring.cache.jcache.config=classpath:/META-INF/spring/ehcache.xml diff --git a/fineract-provider/properties/basicauth/twofactor/application.properties b/fineract-provider/properties/basicauth/twofactor/application.properties index 43cb20bba..a9b13cc5e 100644 --- a/fineract-provider/properties/basicauth/twofactor/application.properties +++ b/fineract-provider/properties/basicauth/twofactor/application.properties @@ -26,4 +26,3 @@ management.info.git.mode=FULL # FINERACT-914 server.forward-headers-strategy=framework -spring.cache.jcache.config=classpath:/META-INF/spring/ehcache.xml diff --git a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java index 5ab511d5d..af9e412d1 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java +++ b/fineract-provider/src/main/java/org/apache/fineract/infrastructure/cache/service/RuntimeDelegatingCacheManager.java @@ -27,6 +27,8 @@ import org.apache.fineract.infrastructure.cache.CacheEnumerations; import org.apache.fineract.infrastructure.cache.data.CacheData; import org.apache.fineract.infrastructure.cache.domain.CacheType; import org.apache.fineract.infrastructure.core.data.EnumOptionData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.cache.Cache; import org.springframework.cache.CacheManager; @@ -43,6 +45,8 @@ import org.springframework.stereotype.Component; @Component(value = "runtimeDelegatingCacheManager") public class RuntimeDelegatingCacheManager implements CacheManager { + private static final Logger LOG = LoggerFactory.getLogger(RuntimeDelegatingCacheManager.class); + private final JCacheCacheManager jcacheCacheManager; private final CacheManager noOpCacheManager = new NoOpCacheManager(); private CacheManager currentCacheManager; @@ -106,6 +110,10 @@ public class RuntimeDelegatingCacheManager implements CacheManager { clearEhCache(); } this.currentCacheManager = this.jcacheCacheManager; + + if (this.currentCacheManager.getCacheNames().size() == 0) { + LOG.error("No caches configured for activated CacheManager {}", this.currentCacheManager); + } break; case MULTI_NODE: if (!distributedCacheEnabled) { diff --git a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java index 478d8ed92..1efc1e9ad 100644 --- a/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java +++ b/fineract-provider/src/main/java/org/apache/fineract/portfolio/client/domain/ClientAddressRepository.java @@ -27,8 +27,8 @@ import org.springframework.data.repository.query.Param; public interface ClientAddressRepository extends JpaRepository, JpaSpecificationExecutor { @Query("SELECT clientAddress FROM ClientAddress clientAddress WHERE clientAddress.client.id = :clientId AND clientAddress.addressType = :addressType AND clientAddress.isActive = :isActive ") - ClientAddress findByClientIdAndAddressTypeAndIsActive(@Param("clientId") final long clientId, final CodeValue addressType, - @Param("isActive") final boolean isActive); + ClientAddress findByClientIdAndAddressTypeAndIsActive(@Param("clientId") final long clientId, + @Param("addressType") final CodeValue addressType, @Param("isActive") final boolean isActive); @Query("SELECT clientAddress FROM ClientAddress clientAddress WHERE clientAddress.client.id = :clientId AND clientAddress.address.id = :addressId ") ClientAddress findByClientIdAndAddressId(@Param("clientId") final long clientId, @Param("addressId") final long addressId); diff --git a/fineract-provider/src/main/resources/META-INF/spring/cache.xml b/fineract-provider/src/main/resources/META-INF/spring/cache.xml index 6cc2361ae..9a2cf89bc 100644 --- a/fineract-provider/src/main/resources/META-INF/spring/cache.xml +++ b/fineract-provider/src/main/resources/META-INF/spring/cache.xml @@ -34,6 +34,6 @@ p:cacheManager-ref="ehcacheInstance" /> + class="org.springframework.cache.jcache.JCacheManagerFactoryBean" p:cacheManagerUri="classpath:/META-INF/spring/ehcache.xml"/> diff --git a/fineract-provider/src/main/resources/META-INF/spring/ehcache.xml b/fineract-provider/src/main/resources/META-INF/spring/ehcache.xml index e9fae206c..9c5effda3 100644 --- a/fineract-provider/src/main/resources/META-INF/spring/ehcache.xml +++ b/fineract-provider/src/main/resources/META-INF/spring/ehcache.xml @@ -24,33 +24,30 @@ - + + + + + + 10000 + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + 7200 + +