-
Notifications
You must be signed in to change notification settings - Fork 580
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
Error: Can't find parser for namespace: http://www.ehcache.org/v3 #3242
Comments
Looks to have been a misconfiguration, the cache needed to be defined as:
I would suggest that error message be improved as it was very cryptic. |
That is weirdly cryptic. The XML failure I'm seeing locally is:
Thats maybe slightly more informative than what you saw, but could obviously be improved too. Could you let me know what JVM version and vendor you were using when you saw that error? FTR that's with this XML: <?xml version="1.0" encoding="UTF-8" ?>
<config xmlns='http://www.ehcache.org/v3'>
<cache alias="mycache">
<key-type>java.lang.String</key-type>
<value-type>java.lang.String</value-type>
<heap unit="entries">50</heap>
<disk unit="bytes">10485760</disk>
</config> |
Thanks @chrisdennis, sure, here are the details: JVM
And if it matters, dependencies: <dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>3.9.6</version>
</dependency>
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.1</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>2.3.1</version>
</dependency> |
Okay... paying a little more attention to your stack traces I understand why you're seeing a more cryptic stack trace than me. You're passing a DOM tree to the constructor and the parsing logic is assuming it's been validated against the assembled schema (which is hasn't, and wouldn't), which means it gets deeper in the config parse than it should have done. I can modify things to validate the passed in DOM against the schema which at least gets you the same error as me, which is still somewhat cryptic... but thats limited by the streaming event nature of a SAX parser. |
I have a basic cache configuration, as follows:
However when this XML gets parsed, I get "Can't find parser for namespace: http://www.ehcache.org/v3":
I don't see anything wrong with this configuration and I'm using 3.9.6.
The text was updated successfully, but these errors were encountered: