0

I am trying to deploy spring+cxf+maven based web service to wildfly. While deploying, Facing this exception

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".

Could someone please help.

James R. Perkins
  • 16,800
  • 44
  • 60
Jyo
  • 1
  • 2
  • What does your ehcache-failsafe.xml look like? – James R. Perkins Jun 14 '17 at 16:37
  • Hi James, Thanks for the reply, XML is maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" maxElementsOnDisk="10000000" diskExpiryThreadIntervalSeconds="120" memoryStoreEvictionPolicy="LRU"> – Jyo Jun 15 '17 at 06:58
  • Maybe it was a paste problem and you should probably edit the question rather than paste it into comments, but that is invalid XML so it's tough to say. Which is maybe the issue. Look at `maxElementsInMemory="10000"`. That looks like an attribute, but it's just text data. – James R. Perkins Jun 15 '17 at 15:11
  • Hi James, You are right, that is paste problem. Could you please check the xml now. – Jyo Jun 19 '17 at 07:43

1 Answers1

0

I will guess a bit here but you seem to load the ehcache configuration file as if it was a Spring configuration file. Which obviously won't work.

I can confirm that if you show us the actual code.

Henri
  • 5,551
  • 1
  • 22
  • 29
  • Hi Henri, thanks for the reply. Please let me know which code shall I show, spring configuration or the class in which ehcache jar is used. – Jyo Jun 19 '17 at 06:49
  • You are not configuring Ehcache as a CacheManager anywhere? I'm interested in the spring configuration – Henri Jun 21 '17 at 00:50
  • Hi Henri, I could neither copy the spring configuration file, nor edit the question. How shall I send the file – Jyo Jun 21 '17 at 12:04
  • Strange. You should be able to edit the question from as far as I know. You can also do a gist and mention it in a comment. – Henri Jun 21 '17 at 19:21
  • In spring config- – Jyo Jun 22 '17 at 12:59
  • In db-config.properties:ea.db.cache.provider.class = org.hibernate.cache.NoCacheProvider and configured this property in spring -config file as <...>${ea.db.show.sql} ${ea.db.cache.provider.class}... – Jyo Jun 22 '17 at 13:01