Thymeleaf 异常:Exception processing template "index": An error happened during template parsing (template: "class path resource [templates/index.html]")
Spring Boot 项目,在 Spring Tool Suite 4, Version: 4.4.0.RELEASE 运行没有问题,将项目中的静态资源和页面复制到 IDEA 的项目中,除了 IDE 不同,其他基本相同。
运行 IDEA 中的项目,然后访问,出现异常:
Exception processing template "index": An error happened during template parsing (template: "class path resource [templates/index.html]")
具体异常:
1 2019-12-10 21:37:40.896 ERROR 10276 --- [nio-8081-exec-1] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-8081-exec-1] Exception processing template "index": An error happened during template parsing (template: "class path resource [templates/index.html]")
2
3 org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/index.html]")
4 at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:241)
5 at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100)
6 at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666)
7 at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098)
8 at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072)
9 at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:362)
10 at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:189)
11 at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1373)
12 at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1118)
13 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1057)
14 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
15 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
16 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
17 at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
18 at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
19 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
20 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
21 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
22 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
23 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
24 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
25 at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
26 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
27 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
28 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
29 at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
30 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
31 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
32 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
33 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
34 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
35 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
36 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
37 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
38 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
39 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)
40 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
41 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
42 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
43 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
44 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)
45 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
46 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)
47 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591)
48 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
49 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
50 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
51 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
52 at java.lang.Thread.run(Thread.java:748)
53 Caused by: org.attoparser.ParseException: Error resolving template [_fragment], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "index" - line 3, col 11)
54 at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:393)
55 at org.attoparser.MarkupParser.parse(MarkupParser.java:257)
56 at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230)
57 ... 48 common frames omitted
58 Caused by: org.thymeleaf.exceptions.TemplateInputException: Error resolving template [_fragment], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "index" - line 3, col 11)
59 at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:869)
60 at org.thymeleaf.engine.TemplateManager.parseStandalone(TemplateManager.java:250)
61 at org.thymeleaf.standard.expression.FragmentExpression.resolveExecutedFragmentExpression(FragmentExpression.java:588)
62 at org.thymeleaf.standard.processor.AbstractStandardFragmentInsertionTagProcessor.computeFragment(AbstractStandardFragmentInsertionTagProcessor.java:379)
63 at org.thymeleaf.standard.processor.AbstractStandardFragmentInsertionTagProcessor.doProcess(AbstractStandardFragmentInsertionTagProcessor.java:110)
64 at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74)
65 at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95)
66 at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633)
67 at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314)
68 at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleOpenElementEnd(TemplateHandlerAdapterMarkupHandler.java:304)
69 at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleOpenElementEnd(InlinedOutputExpressionMarkupHandler.java:278)
70 at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleOpenElementEnd(OutputExpressionInlinePreProcessorHandler.java:186)
71 at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleOpenElementEnd(InlinedOutputExpressionMarkupHandler.java:124)
72 at org.attoparser.HtmlElement.handleOpenElementEnd(HtmlElement.java:109)
73 at org.attoparser.HtmlMarkupHandler.handleOpenElementEnd(HtmlMarkupHandler.java:297)
74 at org.attoparser.MarkupEventProcessorHandler.handleOpenElementEnd(MarkupEventProcessorHandler.java:402)
75 at org.attoparser.ParsingElementMarkupUtil.parseOpenElement(ParsingElementMarkupUtil.java:159)
76 at org.attoparser.MarkupParser.parseBuffer(MarkupParser.java:710)
77 at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:301)
78 ... 50 common frames omitted
79
80 2019-12-10 21:37:40.900 ERROR 10276 --- [nio-8081-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "class path resource [templates/index.html]")] with root cause
81
82 org.thymeleaf.exceptions.TemplateInputException: Error resolving template [_fragment], template might not exist or might not be accessible by any of the configured Template Resolvers (template: "index" - line 3, col 11)
83 at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:869)
84 at org.thymeleaf.engine.TemplateManager.parseStandalone(TemplateManager.java:250)
85 at org.thymeleaf.standard.expression.FragmentExpression.resolveExecutedFragmentExpression(FragmentExpression.java:588)
86 at org.thymeleaf.standard.processor.AbstractStandardFragmentInsertionTagProcessor.computeFragment(AbstractStandardFragmentInsertionTagProcessor.java:379)
87 at org.thymeleaf.standard.processor.AbstractStandardFragmentInsertionTagProcessor.doProcess(AbstractStandardFragmentInsertionTagProcessor.java:110)
88 at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74)
89 at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95)
90 at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633)
91 at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314)
92 at org.thymeleaf.engine.TemplateHandlerAdapterMarkupHandler.handleOpenElementEnd(TemplateHandlerAdapterMarkupHandler.java:304)
93 at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler$InlineMarkupAdapterPreProcessorHandler.handleOpenElementEnd(InlinedOutputExpressionMarkupHandler.java:278)
94 at org.thymeleaf.standard.inline.OutputExpressionInlinePreProcessorHandler.handleOpenElementEnd(OutputExpressionInlinePreProcessorHandler.java:186)
95 at org.thymeleaf.templateparser.markup.InlinedOutputExpressionMarkupHandler.handleOpenElementEnd(InlinedOutputExpressionMarkupHandler.java:124)
96 at org.attoparser.HtmlElement.handleOpenElementEnd(HtmlElement.java:109)
97 at org.attoparser.HtmlMarkupHandler.handleOpenElementEnd(HtmlMarkupHandler.java:297)
98 at org.attoparser.MarkupEventProcessorHandler.handleOpenElementEnd(MarkupEventProcessorHandler.java:402)
99 at org.attoparser.ParsingElementMarkupUtil.parseOpenElement(ParsingElementMarkupUtil.java:159)
100 at org.attoparser.MarkupParser.parseBuffer(MarkupParser.java:710)
101 at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:301)
102 at org.attoparser.MarkupParser.parse(MarkupParser.java:257)
103 at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230)
104 at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parseStandalone(AbstractMarkupTemplateParser.java:100)
105 at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:666)
106 at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098)
107 at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072)
108 at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:362)
109 at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:189)
110 at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1373)
111 at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1118)
112 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1057)
113 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
114 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
115 at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
116 at javax.servlet.http.HttpServlet.service(HttpServlet.java:634)
117 at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
118 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
119 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
120 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
121 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
122 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
123 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
124 at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
125 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
126 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
127 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
128 at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
129 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
130 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
131 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
132 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
133 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
134 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
135 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
136 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
137 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
138 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526)
139 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
140 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
141 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
142 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
143 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)
144 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
145 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860)
146 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591)
147 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
148 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
149 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
150 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
151 at java.lang.Thread.run(Thread.java:748)
起初是直接运行项目,即 Shift + F10:
后来重新编译项目,再访问,就没有出现异常:
Thymeleaf 异常:Exception processing template "index": An error happened during template parsing (template: "class path resource [templates/index.html]")的更多相关文章
- 【报错】An error happened during template parsing (template: "class path resource [templates/hello1.html]")
页面显示: Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing t ...
- 【报错】An error happened during template parsing (template: "class path resource [templates/adminManageCourse.html]")
页面显示: Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing t ...
- exception processing, template error resolving template
错误信息:Exception processing template “/view/df”: Error resolving template “/view/df”, template might n ...
- 【异常】Maxwell异常 Exception in thread "main" net.sf.jsqlparser.parser.TokenMgrError: Lexical error at line 1, column 596. Encountered: <EOF> after : ""
1 详细异常 Exception in thread "main" net.sf.jsqlparser.parser.TokenMgrError: Lexical error at ...
- 异常-Exception in thread "main" net.sf.jsqlparser.parser.TokenMgrError: Lexical error at line 1, column 596. Encountered: <EOF> after :
1 详细异常 Exception in thread "main" net.sf.jsqlparser.parser.TokenMgrError: Lexical error at ...
- Exception processing template "success": Exception parsing document: template="success",
代码很简单 package com.kele.controller; import org.springframework.stereotype.Controller;import org.sprin ...
- 理解Python语言里的异常(Exception)
Exception is as a sort of structured "super go to".异常是一种结构化的"超级goto". 作为一个数十年如一日 ...
- Java 里的异常(Exception)详解
作为一位初学者, 本屌也没有能力对异常谈得很深入. 只不过Java里关于Exception的东西实在是很多. 所以这篇文章很长就是了.. 一, 什么是java里的异常 由于java是c\c++ ...
- 05_Java异常(Exception)
1. 异常的概念 1.1什么是异常 异常指的是程序运行时出现的不正常情况. 1.2异常的层次 Java的异常类是处理运行时的特殊类,每一种异常对应一种特定的运行错误.所有Java异常类都是系统类库中E ...
随机推荐
- Git深入浅出使用教程:Git安装、远程控制、常用命令(全)
一.软件安装 1.先安装[Git-2.24.1.2-64-bit.exe]软件.(官网下载的很慢,可以在百度云盘下载我的) 链接:https://pan.baidu.com/s/1uoIS9DWSBp ...
- ETC1
对纹理进行Alpha通道分离的好处 https://blog.csdn.net/u011926026/article/details/53982180 拆分贴图的Alpha通道 --对抗ETC1的原罪 ...
- Forward Rendering VS Deferred Rendering
http://gad.qq.com/article/detail/32731 Forward Rendering Deferred Rendering
- java初探(1)之秒杀的安全
在秒杀的场景中还存在着很多的安全问题 暴露秒杀地址 秒杀请求可以很频繁 接口流量大,恶意刷接口 隐藏秒杀接口 为什么需要隐藏,事实上,页面上的所有东西都能被客户端拿到,包括js代码,因此,分析商品详情 ...
- Oracle12C安装配置文档
Oracle12C安装配置文档 Oracle12C安装配置文档 准备软件: 开始安装: 打开从官网下载下来的两个压缩包,进行解压 打开解压好的后缀为2of2的文件夹找到路径为database下的“ ...
- nginx安装第三方模块echo
要使用第三方模块ngx_echo的功能,请重新配置添加到nginx插件中 ##下载第三方模块 wget https://github.com/openresty/echo-nginx-module/a ...
- HashSet保证元素唯一原理以及HashMap扩容机制
一.HashSet保证元素唯一原理: 依赖于hashCode()和equals()方法1.唯一原理: 1.1 当HashSet集合要存储元素的时候,会调用该元素的hashCode()方法计算哈希值 1 ...
- PHP 类的构造方法 __construct()
1. 构造方法简介 构造方法 __construct() 是一种类结构特有的特殊方法,该方法由系统规定好 实例化一个类时:先调用该方法,再返回类的对象 构造方法也是普通方法,不同之处就是在实例化类时会 ...
- Linux:用tar解压文件出现错误Not found in archive
问题:用tar解压文件出现错误Not found in archive 解决办法:加上-C参数 tar -zxvf ZenTaoPMS.8.1.3.zbox_64.gz -C /usr 因为压缩文件 ...
- Selenium-WebDriver安装
一.chrome浏览器: 根据chrome浏览器版本,下载对应的驱动 chromedriver版本 支持的Chrome版本 v2.37 v64-66 v2.36 v63-65 v2.35 v62-64 ...