Wildfly org.xml.sax.SAXParseException文档根元素“;“ehcache”;,必须匹配DOCTYPE root“;空";

Wildfly org.xml.sax.SAXParseException文档根元素“;“ehcache”;,必须匹配DOCTYPE root“;空";,wildfly,ehcache,saxparseexception,Wildfly,Ehcache,Saxparseexception,我正在尝试将基于spring+cxf+maven的web服务部署到wildfly。部署时,面对此异常 2017-06-13 03:20:18,874 INFO [org.springframework.context.support.PropertySourcesPlaceholderConfigurer] (ServerService Thread Pool -- 60) Loading properties file from VFS resource ["/C:/xxxx/wildfly

我正在尝试将基于spring+cxf+maven的web服务部署到wildfly。部署时,面对此异常

2017-06-13 03:20:18,874 INFO  [org.springframework.context.support.PropertySourcesPlaceholderConfigurer] (ServerService Thread Pool -- 60) Loading properties file from VFS resource ["/C:/xxxx/wildfly-9.0.2.Final/bin/content/ServiceWrapper-0.0.1-SNAPSHOT.ear/lib/ehcache-2.10.4.jar/ehcache-failsafe.xml"]
2017-06-13 03:20:18,883 WARN  [org.springframework.web.context.support.XmlWebApplicationContext] (ServerService Thread Pool -- 60) Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.util.InvalidPropertiesFormatException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 118; Document root element "ehcache", must match DOCTYPE root "null".
2017-06-13 03:20:18,886 ERROR [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 60) Context initialization failed: org.springframework.beans.factory.BeanInitializationException: Could not load properties; nested exception is java.util.InvalidPropertiesFormatException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 118; Document root element "ehcache", must match DOCTYPE root "null".

有人能帮忙吗。

我在这里猜一下,但是您似乎加载了ehcache配置文件,就好像它是一个Spring配置文件一样。这显然行不通


如果您向我们展示实际代码,我可以确认。

您的ehcache-failsafe.xml是什么样子的?嗨,詹姆斯,谢谢您的回复,xml是maxElementsInMemory=“10000”external=“false”timeToIdleSeconds=“120”timeToLiveSeconds=“120”maxElementsOnDisk=“10000000”diskExpiryThreadIntervalSeconds=“120”MemoryStoreReceivingPolicy=“LRU”>可能是粘贴问题,您可能应该编辑问题,而不是将其粘贴到注释中,但这是无效的XML,因此很难说。这可能就是问题所在。查看
MaxElementsMemory=“10000”
。这看起来像一个属性,但它只是文本数据。嗨,詹姆斯,你是对的,这就是粘贴问题。你现在可以检查一下xml了吗?嗨,亨利,谢谢你的回复。请让我知道我应该显示哪些代码,spring配置还是使用ehcache jar的类。您没有将ehcache配置为CacheManager吗?我对spring配置感兴趣Hi Henri,我既不能复制spring配置文件,也不能编辑问题。我该如何发送文件传输。据我所知,你应该可以编辑这个问题。您还可以做一个要点,并在注释中提及它-