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]")的更多相关文章

  1. 【报错】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 ...

  2. 【报错】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 ...

  3. exception processing, template error resolving template

    错误信息:Exception processing template “/view/df”: Error resolving template “/view/df”, template might n ...

  4. 【异常】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 ...

  5. 异常-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 ...

  6. Exception processing template "success": Exception parsing document: template="success",

    代码很简单 package com.kele.controller; import org.springframework.stereotype.Controller;import org.sprin ...

  7. 理解Python语言里的异常(Exception)

    Exception is as a sort of structured "super go to".异常是一种结构化的"超级goto". 作为一个数十年如一日 ...

  8. Java 里的异常(Exception)详解

    作为一位初学者, 本屌也没有能力对异常谈得很深入.   只不过Java里关于Exception的东西实在是很多. 所以这篇文章很长就是了.. 一, 什么是java里的异常   由于java是c\c++ ...

  9. 05_Java异常(Exception)

    1. 异常的概念 1.1什么是异常 异常指的是程序运行时出现的不正常情况. 1.2异常的层次 Java的异常类是处理运行时的特殊类,每一种异常对应一种特定的运行错误.所有Java异常类都是系统类库中E ...

随机推荐

  1. Unity中接收服务器消息并广播事件的实现

    最近接触的项目,是一个棋牌游戏,棋牌游戏需要在前端进行一些操作,然后向服务器发送数据包,在服务器接收到客户端的数据后,会在服务端进行一系列的判断之后,然后发送给客户端一个返回数据,客户端接收到这个返回 ...

  2. Mybatis入门篇之结果映射,你射准了吗?

    目录 前言 什么是结果映射? 如何映射? 别名映射 驼峰映射 配置文件开启驼峰映射 配置类中开启驼峰映射 resultMap映射 总结 高级结果映射 关联(association) 例子 关联的嵌套 ...

  3. oracle 11g 导入表时 提示 ***值太大错误

    导入数据库时,总是提示**值太大,实际值是**的错误. 具体忘了错误代码是什么了 ——! 经查询,这个是由于字符集设置的不是gbk的,导致导入时遇到中文字符出现的问题, 解决方法: 如果可以的话就把数 ...

  4. 跟着兄弟连系统学习Linux-【day05】

    day05-20200602 p19.其他文件搜索命令 (百度搜索everything,安装,可以实现Windows秒级搜索文件)Linux中同样可以实现此功能. [locate 文件名]locate ...

  5. springboot入门遇到Whitelabel Error Page错误

    错误页面: 解决方法: 启动类要放在最外层,改成下面的

  6. (Python)正则表达式进行匹配

    import os import re pattern=re.compile(r'(\d{4})-(\d{2})-(\d{2})-b(\d{3})') // 要匹配的目录格式 for root,dir ...

  7. 同样是logback1.11,更换了log配置后,无论是否有线程持续不断写入log文件,log文件会按设定以日期序号轮换

    上次发现了logback1.11的一个bug,即有线程持续写入log,则log文件不会按设定模式进行轮换. 但发现同样采用logback1.11的另外一个工程,它的日志文件就没有错误,于是参照其配置文 ...

  8. Java面试炼金系列 (1) | 关于String类的常见面试题剖析

    Java面试炼金系列 (1) | 关于String类的常见面试题剖析 文章以及源代码已被收录到:https://github.com/mio4/Java-Gold 0x0 基础知识 1. '==' 运 ...

  9. 吴恩达《深度学习》-课后测验-第三门课 结构化机器学习项目(Structuring Machine Learning Projects)-Week1 Bird recognition in the city of Peacetopia (case study)( 和平之城中的鸟类识别(案例研究))

    Week1 Bird recognition in the city of Peacetopia (case study)( 和平之城中的鸟类识别(案例研究)) 1.Problem Statement ...

  10. Java架构师方案—多数据源开发详解及原理(二)(附完整项目代码)

    1. mybatis下数据源开发工作 2. 数据源与DAO的关系原理模型 3. 为什么要配置SqlSessionTemplate类的bean 4. 多数据源应用测试 1. mybatis下数据源开发工 ...