Solution to content is not allowed in Prolog exception in ehcache Configuration

Source: Internet
Author: User

Hibernate is used in the project and ehcache is used as the second-level cache. After the configuration is completed, the following error always occurs when Tomcat is started:

Severe: exception sending context initialized event to listener instance of class org. springframework. Web. Context. contextloaderlistener
Org. springframework. beans. factory. beancreationexception: Error creating bean with name 'entitymanagerfactory 'defined in class path resource [applicationcontext. XML]: Invocation of init method failed; Nested exception is net. SF. ehcache. cacheexception: error handling from file:/D:/tomcat % 206.0/webapps/root/WEB-INF/classes/ehcache. XML. initial cause was error processing from input stream. initial cause was content is not allowed in Prolog.
At org. springframework. Beans. Factory. Support. abstractautowirecapablebeanfactory. initializebean (abstractautowirecapablebeanfactory. Java: 1420)

 

.......

 

 

Caused by: net. SF. ehcache. cacheexception: error handling from file:/D:/tomcat % 206.0/webapps/root/WEB-INF/classes/ehcache. XML. initial cause was error processing from input stream. initial cause was content is not allowed in Prolog.
At net. SF. ehcache. config. configurationfactory. parseconfiguration (configurationfactory. Java: 101)

 

 

.......

 

Caused by: net. SF. ehcache. cacheexception: error handling from input stream. Initial cause was content is not allowed in Prolog.
At net. SF. ehcache. config. configurationfactory. parseconfiguration (configurationfactory. Java: 155)
At net. SF. ehcache. config. configurationfactory. parseconfiguration (configurationfactory. Java: 99)
... 52 more
Caused by: org. xml. Sax. saxparseexception: content is not allowed in Prolog.

 

 

At first, I saw the first error prompt, and thought it was a problem caused by spring or ehcache. After a long time, I found the solution from the content is not allowed in Prolog information:

 

Use NotePad to save the ehcache. xml configuration file as an Anis-encoded file.

 

It took a long time to find the cause and solution to a small problem.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.