ehcache / ehcache3

Ehcache 3.x line
http://www.ehcache.org
Apache License 2.0
2k stars 578 forks source link

Configuration is invalid in the .xml configuration #3234

Open willgss opened 2 months ago

willgss commented 2 months ago

The following is my .xml configuration: <ehcache:config xmlns:ehcache="http://www.ehcache.org/v3"

        <ehcache:ttl>10</ehcache:ttl>
        **<ehcache:tti>10</ehcache:tti>**
    </ehcache:expiry>

    <ehcache:resources>

        <ehcache:heap>100</ehcache:heap>
        <ehcache:offheap unit="MB">5</ehcache:offheap>
        <ehcache:disk unit="MB">1024</ehcache:disk>
    </ehcache:resources>
</ehcache:cache-template>

<ehcache:cache alias="indexArticleList" uses-template="template">
</ehcache:cache>

</ehcache:config>

the following is part of the error when i try to start my service:

Caused by: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:/C:/Java_Projects/micro-service-tpm-updateToJava21/service/target/classes/ehcache.xml at org.ehcache.xml.XmlConfiguration.(XmlConfiguration.java:126) at org.ehcache.xml.XmlConfiguration.(XmlConfiguration.java:92) at org.ehcache.jsr107.EhcacheCachingProvider$ConfigSupplier.getConfiguration(EhcacheCachingProvider.java:328) ... 127 common frames omitted Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.d: Invalid content was found starting with element 'ehcache:tti'. No child element is expected at this point. at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204) at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:135) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284) at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:512) at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3596) at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1989) at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:830) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:376) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2726) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:114) at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:542) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:889) at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:825) at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at java.xml/com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:247) at java.xml/com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:342) at java.xml/javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:178) at org.ehcache.xml.ConfigurationParser.uriToDocument(ConfigurationParser.java:225) at org.ehcache.xml.XmlConfiguration.(XmlConfiguration.java:117) ... 129 common frames omitted

image

also the Intelij IDE reminds me that the line for tti is invalid, but it is ok when i only have under the . It seems i can only have one item under , i do not know why. What should i do if i need to config both ttl and tti? Thank you !