Ehcache and Tomcat 8 incompatibilities?

I have a webapp configured with a webfilter that uses ehcache. Everything worked fine until I got to Tomcat 8.0.15. The following error is preventing my application from starting:

Caused by: org.xml.sax.SAXException: null:7: Element <cache> does not allow attribute "maxBytesLocalDisk".
        at net.sf.ehcache.config.BeanHandler.setAttribute(BeanHandler.java:282)
        at net.sf.ehcache.config.BeanHandler.startElement(BeanHandler.java:113)
        at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
        at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(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.AbstractSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:195)
        at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:155)
        ... 26 more

      

Here is my ehcache config:

<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ehcache.org/ehcache.xsd" updateCheck="true" monitoring="autodetect" dynamicConfig="true">
<diskStore path="java.io.tmpdir"/>
<cache name="CachingRestFilter"
       maxBytesLocalHeap="100M"
       maxBytesLocalDisk="1G"           
       eternal="false"
       memoryStoreEvictionPolicy="LFU">
       <persistence strategy="localTempSwap"/>      
 </cache>
</ehcache>

      

The same application works with Tomcat 7.0.54. Is this a Tomcat issue?

+3


source to share





All Articles