Closed subijayb closed 5 months ago
I was having <expiry>
after <resource>
tag. Thats why it was not working After i added <expiry>
before <resource>
, it worked.
Below is working sample
<cache alias="myCacheName">
<expiry>
<none />
</expiry>
<resources>
<heap unit="entries">30</heap>
</resources>
</cache>
Hi,
In my project we are upgrading ehcache 2 to ehcache 3. In order to understand the ehcache 3 and JSP107 implementation we were going though the samples https://github.com/ehcache/ehcache3-samples
I have a doubt. If I add
<expiry>
under<cache>
in the XML, why does it not work with org.ehcache.xml.XmlConfiguration. If we have this XMLAnd when we run BasicXML class, The following code throws exception
Configuration xmlConfig = new XmlConfiguration(BasicXML.class.getResource("/ehcache.xml"));
Exception is
ehcache3-samples/basic/target/classes/ehcache.xml; lineNumber: 15; columnNumber: 21; cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.ehcache.org/v3":expiry}'. One of '{"http://www.ehcache.org/v3":heap-store-settings, "http://www.ehcache.org/v3":disk-store-settings, "http://www.ehcache.org/v3":service-configuration}' is expected.
While, it works when JSR107 is used . This code works
Why is the difference? Can someone please explain?