Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configuration is invalid in the .xml configuration #3234

Open
willgss opened this issue Jun 24, 2024 · 0 comments
Open

Configuration is invalid in the .xml configuration #3234

willgss opened this issue Jun 24, 2024 · 0 comments

Comments

@willgss
Copy link

willgss commented Jun 24, 2024

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

<ehcache:persistence directory="./tmp/Ehcache3"/>
<ehcache:cache-template name="template">
    <!--        <key-type>java.lang.String</key-type>-->
    <!--        <value-type>java.lang.String</value-type>-->
    <ehcache:expiry>

        <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 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant