org.thymeleaf.exceptions.TemplateInputException: Exception parsing document: template="login", line 36 - column 3
<p>Before changing the original source, I'm attempting to access the default login page for a <a href="http://wrapbootstrap.com" rel="nofollow noreferrer">wrapbootstrap.com</a> template. Use of templating engine was solved in <a href="https://stackoverflow.com/questions/35979484/how-to-properly-configure-my-springmvc-4-application-to-use-thymeleaf/35979621?noredirect=1#comment59613793_35979621">this question</a>. </p>

<p>My ViewResolver bean is defined by:</p>

<pre><code>@Configuration
@EnableWebMvc
@ComponentScan(basePackages = "b.c.m.h")
public class HConfiguration extends WebMvcConfigurerAdapter {

    @Bean
    public ViewResolver viewResolver() {
        ClassLoaderTemplateResolver templateResolver = new ClassLoaderTemplateResolver();
        templateResolver.setTemplateMode("HTML5");
        templateResolver.setPrefix("/WEB-INF/html/");
        templateResolver.setSuffix(".html");
        SpringTemplateEngine engine = new SpringTemplateEngine();
        engine.setTemplateResolver(templateResolver);

        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
        return viewResolver;
    }
    (...)
}
</code></pre>

<p>But, when I try to access the <code>login.html</code> page defined by:</p>

<pre><code>@RequestMapping(value = "/login", method = RequestMethod.GET)
public String loginPage() {
    return "login";
}
</code></pre>

<p>And the <code>login.html</code> page being:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;!--
Beyond Admin - Responsive Admin Dashboard Template build with Twitter    Bootstrap 3
Version: 1.3
Purchase: http://wrapbootstrap.com
--&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;!--Head--&gt;
&lt;head&gt;
    &lt;meta charset="utf-8" /&gt;
    &lt;title&gt;Login Page&lt;/title&gt;

    &lt;meta name="description" content="login page" /&gt;
    &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"    /&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge" /&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
    &lt;link rel="shortcut icon" href="assets/img/favicon.png" type="image/x-icon"&gt;

    &lt;!--Basic Styles--&gt;
    &lt;link href="assets/css/bootstrap.min.css" rel="stylesheet" /&gt;
    &lt;link id="bootstrap-rtl-link" href="" rel="stylesheet" /&gt;
    &lt;link href="assets/css/font-awesome.min.css" rel="stylesheet" /&gt;

    &lt;!--Fonts--&gt;
    &lt;link href="http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,400,600,700,300" rel="stylesheet" type="text/css" &gt;

    &lt;!--Beyond styles--&gt;
    &lt;link id="beyond-link" href="assets/css/beyond.min.css"    rel="stylesheet" /&gt;
    &lt;link href="assets/css/demo.min.css" rel="stylesheet" /&gt;
    &lt;link href="assets/css/animate.min.css" rel="stylesheet" /&gt;
    &lt;link id="skin-link" href="" rel="stylesheet" type="text/css" /&gt;

    &lt;!--Skin Script: Place this script in head to load scripts for skins    and rtl support--&gt;
    &lt;script src="assets/js/skins.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;!--Head Ends--&gt;
&lt;!--Body--&gt;
&lt;body&gt;
    &lt;div class="login-container animated fadeInDown"&gt;
        &lt;div class="loginbox bg-white"&gt;
            &lt;div class="loginbox-title"&gt;SIGN IN&lt;/div&gt;
            &lt;div class="loginbox-social"&gt;
                &lt;div class="social-title "&gt;Connect with Your Social Accounts&lt;/div&gt;
                &lt;div class="social-buttons"&gt;
                    &lt;a href="" class="button-facebook"&gt;
                        &lt;i class="social-icon fa fa-facebook"&gt;&lt;/i&gt;
                    &lt;/a&gt;
                    &lt;a href="" class="button-twitter"&gt;
                        &lt;i class="social-icon fa fa-twitter"&gt;&lt;/i&gt;
                    &lt;/a&gt;
                    &lt;a href="" class="button-google"&gt;
                        &lt;i class="social-icon fa fa-google-plus"&gt;&lt;/i&gt;
                    &lt;/a&gt;
                &lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="loginbox-or"&gt;
                &lt;div class="or-line"&gt;&lt;/div&gt;
                &lt;div class="or"&gt;OR&lt;/div&gt;
            &lt;/div&gt;
            &lt;div class="loginbox-textbox"&gt;
                &lt;input type="text" class="form-control" placeholder="Email" /&gt;
            &lt;/div&gt;
            &lt;div class="loginbox-textbox"&gt;
                &lt;input type="text" class="form-control" placeholder="Password" /&gt;
            &lt;/div&gt;
            &lt;div class="loginbox-forgot"&gt;
                &lt;a href=""&gt;Forgot Password?&lt;/a&gt;
            &lt;/div&gt;
            &lt;div class="loginbox-submit"&gt;
                &lt;input type="button" class="btn btn-primary btn-block" value="Login"&gt;
            &lt;/div&gt;
            &lt;div class="loginbox-signup"&gt;
                &lt;a href="register.html"&gt;Sign Up With Email&lt;/a&gt;
            &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="logobox"&gt;
        &lt;/div&gt;
    &lt;/div&gt;

    &lt;!--Basic Scripts--&gt;
    &lt;script src="assets/js/jquery-2.0.3.min.js"&gt;&lt;/script&gt;
    &lt;script src="assets/js/bootstrap.min.js"&gt;&lt;/script&gt;
    &lt;script src="assets/js/slimscroll/jquery.slimscroll.min.js"&gt;&lt;/script&gt;

    &lt;!--Beyond Scripts--&gt;
    &lt;script src="assets/js/beyond.js"&gt;&lt;/script&gt;


&lt;/body&gt;
&lt;!--Body Ends--&gt;
&lt;/html&gt;
</code></pre>

<p>I get this error on console:</p>

<pre><code>SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/hrm] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: Exception parsing document: template="login", line 36 - column 3] with root cause
org.xml.sax.SAXParseException; lineNumber: 36; columnNumber: 3; The element type "link" must be terminated by the matching end-tag "&lt;/link&gt;".
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:198)
at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1749)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2973)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332)
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.doParse(AbstractNonValidatingSAXTemplateParser.java:209)
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplateUsingPool(AbstractNonValidatingSAXTemplateParser.java:134)
at org.thymeleaf.templateparser.xmlsax.AbstractNonValidatingSAXTemplateParser.parseTemplate(AbstractNonValidatingSAXTemplateParser.java:116)
at org.thymeleaf.TemplateRepository.getTemplate(TemplateRepository.java:278)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1104)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1060)
at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1011)
at org.thymeleaf.spring4.view.ThymeleafView.renderFragment(ThymeleafView.java:335)
at org.thymeleaf.spring4.view.ThymeleafView.render(ThymeleafView.java:190)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1244)
at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1027)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:971)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:316)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:126)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:90)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:69)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:122)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:149)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter.doFilter(RememberMeAuthenticationFilter.java:149)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:168)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:168)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:48)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:205)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:120)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:68)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:91)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:53)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:213)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:176)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.__invoke(StandardContextValve.java:122)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)
at org.apache.catalina.core.StandardHostValve.__invoke(StandardHostValve.java:169)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:956)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:436)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1078)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:625)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
</code></pre>

<p>Which claims <code>org.xml.sax.SAXParseException; lineNumber: 36; columnNumber: 3; The element type "link" must be terminated by the matching end-tag "&lt;/link&gt;"</code>. But at line 36 there's only <code>&lt;/head&gt;</code>.</p>

<p>I noticed the <code>&lt;link&gt;</code> element on the <code>&lt;!--Fonts--&gt;</code> section does not ends with a <code>&lt;/link&gt;</code> or <code>/&gt;</code> but it does not seems to matter whether I correct it or not.</p>

<p>How can I solve this?</p>