ehcache3 XmlConfigurationException

1,293 views
Skip to first unread message

roy

unread,
Apr 13, 2019, 11:36:09 PM4/13/19
to ehcache-users
  1. What version of Ehcache you are currently using; 3.7.1
  2. Paste the configuration for the Cache/CacheManager you have an issue with; below
  3. Add any name and version of other library or framework you use Ehcache with (e.g. Hibernate); mybatis,spring
  4. Providing JDK and OS versions maybe useful as well. jdk 1.8
<?xml version="1.0" encoding="UTF-8"?>
<config
    xsi:schemaLocation="
    
    <service> 
    <jsr107:defaults default-template="defaultCache"> 
       <jsr107:cache name="cache1" template="cache1"/> 
       <jsr107:cache name="cache2" template="cache2"/>
               <jsr107:cache name="cache3" template="cache3"/> 
    </jsr107:defaults>
  </service>
    
    <cache-template name="defaultCache">    
        <expiry>
            <none/>
        </expiry>
        <resources>           
            <heap unit="entries">50</heap>              
        </resources>
    </cache-template>
    
    <cache-template name="cache1">
        <expiry>
      <ttl unit="seconds">36000</ttl>
    </expiry>
        <resources>
        <!-- The maximal number of entries to be held in the Cache, prior to eviction starting -->           
            <heap unit="entries">50</heap>              
        </resources>
     </cache-template>
     
     <cache-template name="cache2">    
        <expiry>
            <none/>
        </expiry>
        <resources>           
            <heap unit="entries">100</heap>              
        </resources>
    </cache-template>
    
    <cache-template name="cache3">    
        <expiry>
            <none/>
        </expiry>
        <resources>           
            <heap unit="entries">100</heap>              
        </resources>
    </cache-template>
    
</config>

roy

unread,
Apr 14, 2019, 12:36:34 AM4/14/19
to ehcache-users
I also tried the following configuration

<ehcache:config xmlns:ehcache="http://www.ehcache.org/v3" xmlns:jcache="http://www.ehcache.org/v3/jsr107">
    <ehcache:cache alias="defaultCache">    
        <ehcache:expiry>
            <none/>
        </ehcache:expiry>
        <ehcache:heap unit="entries">50</ehcache:heap>             
    </ehcache:cache>
    
    <ehcache:cache alias="cache1">
        <ehcache:expiry>
            <ehcache:tti unit="seconds">36000</ehcache:tti>
        </ehcache:expiry>
        <!-- The maximal number of entries to be held in the Cache, prior to eviction starting -->           
        <ehcache:heap unit="entries">50</ehcache:heap>              
     </ehcache:cache>
     
     <ehcache:cache alias="cache2">    
        <ehcache:expiry>
            <none/>
        </ehcache:expiry>
        <ehcache:heap unit="entries">100</ehcache:heap>
    </ehcache:cache>
    
    <ehcache:cache alias="cache3">    
        <ehcache:expiry>
            <none/>
        </ehcache:expiry>
        <ehcache:heap unit="entries">100</ehcache:heap>
    </ehcache:cache>
        
</ehcache:config>

but i still see the following error:
Caused by: javax.cache.CacheException: org.ehcache.xml.exceptions.XmlConfigurationException: ehcache.xml
at org.ehcache.jsr107.EhcacheCachingProvider$ConfigSupplier.getConfiguration(EhcacheCachingProvider.java:331)
at org.ehcache.jsr107.EhcacheCachingProvider.getCacheManager(EhcacheCachingProvider.java:134)
at org.ehcache.jsr107.EhcacheCachingProvider.getCacheManager(EhcacheCachingProvider.java:85)
at org.springframework.cache.jcache.JCacheManagerFactoryBean.afterPropertiesSet(JCacheManagerFactoryBean.java:77)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
... 83 more
Caused by: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:ehcache.xml
at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:122)
at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:88)
at org.ehcache.jsr107.EhcacheCachingProvider$ConfigSupplier.getConfiguration(EhcacheCachingProvider.java:328)
... 88 more

Chris Dennis

unread,
Apr 14, 2019, 9:11:16 AM4/14/19
to ehcach...@googlegroups.com
At a first glance it looks like you need to provide a namespace prefix for the <none> elements.  You might also find it more convenient to define “http://www.ehcache.org/v3” as the default namespace. The exception one deeper in the chain should be pointing you at that.

Chris

-- 
You received this message because you are subscribed to the Google Groups "ehcache-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-user...@googlegroups.com.
To post to this group, send email to ehcach...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ehcache-users/e5ff60e5-32a7-4047-b243-8c21834c0b04%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

roy

unread,
Apr 14, 2019, 9:37:00 AM4/14/19
to ehcache-users
Hi Chris,

Thanks for the response. I am not sure how to define “http://www.ehcache.org/v3” as the default namespace, can you please help me with that ?


On Sunday, 14 April 2019 08:11:16 UTC-5, Chris Dennis wrote:
At a first glance it looks like you need to provide a namespace prefix for the <none> elements.  You might also find it more convenient to define “http://www.ehcache.org/v3” as the default namespace. The exception one deeper in the chain should be pointing you at that.

Chris

To unsubscribe from this group and stop receiving emails from it, send an email to ehcach...@googlegroups.com.

roy

unread,
Apr 14, 2019, 9:44:58 AM4/14/19
to ehcache-users
I also tried ehcache3 as default name space, my configuration as follows

but i still see the same error.

Chris Dennis

unread,
Apr 14, 2019, 9:47:43 AM4/14/19
to ehcach...@googlegroups.com
With the attribute xmlns=“http://www.ehcache.org/v3” like you did in your first config.  Incidentally the problem with the first configuration is different. The 107 schema and the main schema are both typing their name attributes (of the jsr107:cache and cache-template:cache elements respectively) as xs:ID. Unfortunately this means you can’t have a template with the same name as a 107 defined cache. This is probably fixable in a future release, but for now you’ll need to define non-colliding names.

Chris

To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-user...@googlegroups.com.

To post to this group, send email to ehcach...@googlegroups.com.

roy

unread,
Apr 14, 2019, 9:57:55 AM4/14/19
to ehcache-users
Sorry, even after trying non-colliding names i do get the same error.

<?xml version="1.0" encoding="UTF-8"?>
<config
    xsi:schemaLocation="
    
    <service> 
        <jsr107:defaults default-template="defaultCache"> 
           <jsr107:cache name="cache1" template="cache1template"/> 
           <jsr107:cache name="cache2" template="cache2template"/>
        </jsr107:defaults>
    </service>
    
    <cache-template name="defaultCache">    
        <expiry>
            <none/>
        </expiry>
        <resources>           
            <heap unit="entries">50</heap>              
        </resources>
    </cache-template>
    
    <cache-template name="cache1template">
        <expiry>
            <ttl unit="seconds">36000</ttl>
        </expiry>
        <resources>
            <!-- The maximal number of entries to be held in the Cache, prior to eviction starting -->           
            <heap unit="entries">50</heap>              
        </resources>
     </cache-template>
     
      <cache-template name="cache2template">
        <expiry>
            <ttl unit="seconds">36000</ttl>
        </expiry>
        <resources>
            <!-- The maximal number of entries to be held in the Cache, prior to eviction starting -->           
            <heap unit="entries">50</heap>              
        </resources>
     </cache-template>
    
    
</config>

On Sunday, 14 April 2019 08:47:43 UTC-5, Chris Dennis wrote:
With the attribute xmlns=“http://www.ehcache.org/v3” like you did in your first config.  Incidentally the problem with the first configuration is different. The 107 schema and the main schema are both typing their name attributes (of the jsr107:cache and cache-template:cache elements respectively) as xs:ID. Unfortunately this means you can’t have a template with the same name as a 107 defined cache. This is probably fixable in a future release, but for now you’ll need to define non-colliding names.

Chris

To unsubscribe from this group and stop receiving emails from it, send an email to ehcach...@googlegroups.com.

To post to this group, send email to ehcach...@googlegroups.com.

roy

unread,
Apr 14, 2019, 1:05:36 PM4/14/19
to ehcache-users
Am i missing something else here ?

Chris Dennis

unread,
Apr 14, 2019, 1:28:39 PM4/14/19
to ehcach...@googlegroups.com
In order for you to figure out whats going on you need to get the message (and stack trace) of the cause of the XmlConfigurationException… without that and given that the XML is valid in principle it’s impossible to say what is going wrong.

Chris

To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-user...@googlegroups.com.

To post to this group, send email to ehcach...@googlegroups.com.

roy

unread,
Apr 14, 2019, 1:37:22 PM4/14/19
to ehcache-users
Here is how i am creating beans

<bean id="myehcache" class="org.springframework.cache.jcache.JCacheManagerFactoryBean">
  <property name="cacheManagerUri" value="classpath:ehcache.xml"/>
</bean>
<bean id="ehCacheManager" class="org.springframework.cache.jcache.JCacheCacheManager">
  <property name="cacheManager" ref="myehcache" />
</bean>

and below is the stacktrace

Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.cache.CacheManager edu.ku.cete.service.impl.OrganizationServiceImpl.cacheManager; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheManager' defined in class path resource [mvc-config.xml]: Cannot create inner bean 'org.springframework.cache.jcache.JCacheManagerFactoryBean#694c9299' of type [org.springframework.cache.jcache.JCacheManagerFactoryBean] while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.jcache.JCacheManagerFactoryBean#694c9299' defined in class path resource [mvc-config.xml]: Invocation of init method failed; nested exception is javax.cache.CacheException: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/ehcache.xml
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:561)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331)
... 61 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ehCacheManager' defined in class path resource [mvc-config.xml]: Cannot create inner bean 'org.springframework.cache.jcache.JCacheManagerFactoryBean#694c9299' of type [org.springframework.cache.jcache.JCacheManagerFactoryBean] while setting bean property 'cacheManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.jcache.JCacheManagerFactoryBean#694c9299' defined in class path resource [mvc-config.xml]: Invocation of init method failed; nested exception is javax.cache.CacheException: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/ehcache.xml
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:313)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:122)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1475)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1220)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1120)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1044)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:942)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:533)
... 63 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.cache.jcache.JCacheManagerFactoryBean#694c9299' defined in class path resource [mvc-config.xml]: Invocation of init method failed; nested exception is javax.cache.CacheException: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/ehcache.xml
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1572)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:299)
... 76 more
Caused by: javax.cache.CacheException: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:/Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/ehcache.xml
at org.ehcache.jsr107.EhcacheCachingProvider$ConfigSupplier.getConfiguration(EhcacheCachingProvider.java:331)
at org.ehcache.jsr107.EhcacheCachingProvider.getCacheManager(EhcacheCachingProvider.java:134)
at org.ehcache.jsr107.EhcacheCachingProvider.getCacheManager(EhcacheCachingProvider.java:85)
at org.springframework.cache.jcache.JCacheManagerFactoryBean.afterPropertiesSet(JCacheManagerFactoryBean.java:77)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
... 79 more
Caused by: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/ehcache.xml
at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:116)
at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:82)
at org.ehcache.jsr107.EhcacheCachingProvider$ConfigSupplier.getConfiguration(EhcacheCachingProvider.java:328)
... 84 more
Caused by: java.io.FileNotFoundException: Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/ehcache.xml (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177)
at org.ehcache.xml.ConfigurationParser.uriToDocument(ConfigurationParser.java:278)
at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:107)
... 86 more

On Sunday, 14 April 2019 12:28:39 UTC-5, Chris Dennis wrote:
In order for you to figure out whats going on you need to get the message (and stack trace) of the cause of the XmlConfigurationException… without that and given that the XML is valid in principle it’s impossible to say what is going wrong.

Chris

To unsubscribe from this group and stop receiving emails from it, send an email to ehcach...@googlegroups.com.

To post to this group, send email to ehcach...@googlegroups.com.

roy

unread,
Apr 14, 2019, 2:08:53 PM4/14/19
to ehcache-users
My understanding from the stacktrace is that there is something wrong with ehcache.xml. I can't think of anything else. Is the stacktrace helpful ?

roy

unread,
Apr 14, 2019, 3:37:40 PM4/14/19
to ehcache-users
Do you see anything wrong with my bean creation ?

roy

unread,
Apr 14, 2019, 7:03:41 PM4/14/19
to ehcache-users
Hi Chris,


<bean id="jCacheManager" class="org.springframework.cache.jcache.JCacheManagerFactoryBean">
  <property name="cacheManagerUri" value="classpath:ehcache.xml" />
</bean>
    <bean id="ehCacheManager" class="org.springframework.cache.jcache.JCacheCacheManager">
  <property name="cacheManager" ref="jCacheManager" />
</bean>
   
     spring version: 4.1.9.RELEASE
   jdk version: 1.8.191

I did spend a lot of time trying to debug my issue, also tried different variations of ehcache.xml but i do still get the following error:
ERROR: org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jCacheManager' defined in class path resource [mvc-config.xml]: Invocation of init method failed; nested exception is javax.cache.CacheException: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:/Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/my-ehcache.xml
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1572)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:736)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1420)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1410)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: javax.cache.CacheException: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:/Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/my-ehcache.xml
at org.ehcache.jsr107.EhcacheCachingProvider$ConfigSupplier.getConfiguration(EhcacheCachingProvider.java:331)
at org.ehcache.jsr107.EhcacheCachingProvider.getCacheManager(EhcacheCachingProvider.java:134)
at org.ehcache.jsr107.EhcacheCachingProvider.getCacheManager(EhcacheCachingProvider.java:85)
at org.springframework.cache.jcache.JCacheManagerFactoryBean.afterPropertiesSet(JCacheManagerFactoryBean.java:77)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1631)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1568)
... 21 more
Caused by: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:/Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/my-ehcache.xml
at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:116)
at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:82)
at org.ehcache.jsr107.EhcacheCachingProvider$ConfigSupplier.getConfiguration(EhcacheCachingProvider.java:328)
... 26 more
Caused by: java.io.FileNotFoundException: /Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/my-ehcache.xml (No such file or directory)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:177)
at org.ehcache.xml.ConfigurationParser.uriToDocument(ConfigurationParser.java:278)
at org.ehcache.xml.XmlConfiguration.<init>(XmlConfiguration.java:107)
... 28 more

Please help me out.

roy

unread,
Apr 17, 2019, 12:04:53 PM4/17/19
to ehcache-users
@Ehcache team - can someone help me with this ?

Chris Dennis

unread,
Apr 17, 2019, 12:29:06 PM4/17/19
to ehcach...@googlegroups.com
The root exception here is: java.io.FileNotFoundException: Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/ehcache.xml (No such file or directory)

That doesn’t seem to line up correctly with the spring configuration you inlined below.

My gut instinct at this point is that there isn’t anything wrong with Ehcache, but that this is a Spring configuration issue.  I would double check all your spring configuration and setup, and then try and pursue this through the Spring community channels. In particular I’m doubtful that the spring configuration your quoting is the one being picked up by Spring. 

Chris

To unsubscribe from this group and stop receiving emails from it, send an email to ehcache-user...@googlegroups.com.

To post to this group, send email to ehcach...@googlegroups.com.

roy

unread,
Apr 17, 2019, 6:09:28 PM4/17/19
to ehcache-users
Looks like it but i don't think it is straight forward process. I also looked at this example(https://imhoratiu.wordpress.com/2017/01/26/spring-4-with-ehcache-3-how-to/) but i do still get the same issue.


On Wednesday, 17 April 2019 11:29:06 UTC-5, Chris Dennis wrote:
The root exception here is: java.io.FileNotFoundException: Documents/my-workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/my-web/WEB-INF/classes/ehcache.xml (No such file or directory)

That doesn’t seem to line up correctly with the spring configuration you inlined below.

My gut instinct at this point is that there isn’t anything wrong with Ehcache, but that this is a Spring configuration issue.  I would double check all your spring configuration and setup, and then try and pursue this through the Spring community channels. In particular I’m doubtful that the spring configuration your quoting is the one being picked up by Spring. 

Chris

roy

unread,
Apr 18, 2019, 12:31:49 AM4/18/19
to ehcache-users
I did start my app in debug mode and noticed that the issue is coming from getConfiguration() method in ehcachecachingprovider class.
To be more specific, it is from configuration = new XmlConfiguration(uri.toURL(), classLoader); where it is passing the correct file location as first parameter and 

ParallelWebappClassLoader as the second parameter. I am not sure if it explains anything but wanted to update this thread.

Reply all
Reply to author
Forward
0 new messages