2

Could someone please help me on below error how to fix it.

22:45:09.431 [restartedMain] DEBUG c.s.w.c.c.c.i.BaseClientConfigurationLoader - Loaded Cache configuration: '{CacheExpirationDuration=600, ServiceAvailabilityCheck=false, CachePassword=, CacheEnabled=true, CacheClientId=, CacheUri=, CacheProviderClass=, ServiceUri=, CacheConnectionTimeout=}'
22:45:09.431 [restartedMain] WARN  c.s.d.c.DefaultNamedCacheProvider - Config URI for Cache Provider is empty, using default fallback option
22:45:09.433 [restartedMain] INFO  org.ehcache.xml.XmlConfiguration - Loading Ehcache XML configuration from file:/C:/Users/nnarvaria/.gradle/caches/modules-2/files-2.1/com.sdl.delivery/udp-discovery-client-lightweight/11.1.0-1063/dd46914fbcb3bffed574be589ebba69cb5a5eca1/udp-discovery-client-lightweight-11.1.0-1063.jar!/ehcache-default.xml.
22:45:09.461 [restartedMain] WARN  c.s.d.c.DefaultNamedCacheProvider - Cannot create a default CIL cache configuration, fallback to default configuration
com.sdl.web.client.configuration.api.ConfigurationException: Cannot load 'default' template from 
    at com.sdl.dxa.caching.DefaultNamedCacheProvider.buildConfigCacheConfiguration(DefaultNamedCacheProvider.java:191)
    at com.sdl.dxa.caching.DefaultNamedCacheProvider.buildDefaultCilCacheConfiguration(DefaultNamedCacheProvider.java:162)
    at com.sdl.dxa.caching.DefaultNamedCacheProvider.buildDefaultCacheConfiguration(DefaultNamedCacheProvider.java:144)
    at com.sdl.dxa.caching.DefaultNamedCacheProvider.getCache(DefaultNamedCacheProvider.java:108)
    at com.sdl.dxa.caching.DefaultNamedCacheProvider.getCache(DefaultNamedCacheProvider.java:123)
    at com.sdl.dxa.caching.wrapper.SimpleCacheWrapper.getCache(SimpleCacheWrapper.java:68)
    at com.sdl.dxa.caching.wrapper.SimpleCacheWrapper.init(SimpleCacheWrapper.java:43)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:366)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:311)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:134)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:409)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1620)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:555)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
    at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)

I have added following properties on dxa.properties file

dxa.caching.disabled.caches=
dxa.caching.required.caches=

dxa.caching.configuration=dxa-ehcache.xml

and dxa-ehcache.xml is

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ehcache.org/v3"
        xsi:schemaLocation="http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.1.xsd">

    <heap-store>
        <max-object-graph-size>100000</max-object-graph-size>
    </heap-store>

    <cache-template name="default">
        <expiry>
            <ttl unit="seconds">300</ttl>
        </expiry>
        <resources>
            <heap unit="entries">10000</heap>
        </resources>
    </cache-template>

    <cache alias="defaultCache" uses-template="default"/>

    <cache alias="pageModels" uses-template="default"/>
    <cache alias="entityModels" uses-template="default"/>
    <cache alias="staticContentItems" uses-template="default"/>
    <cache alias="resolvedLinks" uses-template="default"/>
    <cache alias="queryCache" uses-template="default"/>
    <cache alias="output" uses-template="default"/>
    <cache alias="failures" uses-template="default"/>

    <cache alias="com.sdl.web.discovery.datalayer.model.ContentServiceCapability" uses-template="default">
        <key-type>java.io.Serializable</key-type>
        <value-type>com.sdl.web.discovery.datalayer.model.ContentServiceCapability</value-type>
    </cache>
    <cache alias="com.sdl.context.api.ContextMap" uses-template="default">
        <key-type>java.lang.String</key-type>
        <value-type>com.sdl.context.api.ContextMap</value-type>
    </cache>

    <cache alias="com.sdl.context.api.ContextVocabulary" uses-template="default">
        <key-type>java.lang.String</key-type>
        <value-type>com.sdl.context.api.ContextVocabulary</value-type>
    </cache>

    <cache alias="com.sdl.web.discovery.datalayer.model.ContextServiceCapability" uses-template="default">
        <key-type>java.io.Serializable</key-type>
        <value-type>com.sdl.web.discovery.datalayer.model.ContextServiceCapability</value-type>
    </cache>
    <cache alias="com.sdl.delivery.configuration.ConfigurationResource" uses-template="default">
        <key-type>java.io.Serializable</key-type>
        <value-type>com.sdl.delivery.configuration.ConfigurationResource</value-type>
    </cache>

    <cache alias="java.io.Serializable" uses-template="default">
        <key-type>java.lang.String</key-type>
        <value-type>java.io.Serializable</value-type>
    </cache>
</config>

any help/suggestions is appreciated.

1
  • Thank you for sharing your ehcache.xml. Is there a reason why you've choosen to use heap unit entries and not a memsize (like MB)? Is your jvm max size not exceeded after a while?
    – Harmen
    Commented Aug 16, 2020 at 21:48

1 Answer 1

1

After investigating I found out udp-discovery-client-lightweight:11.1.0-1063 api is trying to find default ehcache file with name : ehcache-default.xml.

In order to fix exception on console, i have renamed dxa-ehcache.xml to ehcache-default.xml

and on dxa.properties also updated the reference for key dxa.caching.configuration

from dxa-ehcache.xml to ehcache-default.xml

which is now

dxa.caching.configuration=ehcache-default.xml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.