【问题标题】:Spring Boot + ClearDB mySQL App deploy Heroku problemSpring Boot + ClearDB mySQL App 部署 Heroku 问题
【发布时间】:2022-01-18 17:02:14
【问题描述】:

我尝试在 Heroku 上部署应用程序,但在连接 ClearDB mySQL 后出现错误 500

heroku 日志:

2022-01-18 18:09:20.331 ERROR 4 --- [io-57013-exec-3] 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: Error resolving template [home], template might not exist or might not be accessible by any of the configured Template Resolvers] with root cause
2022-01-18T18:09:20.332252+00:00 app[web.1]:
2022-01-18T18:09:20.332253+00:00 app[web.1]: org.thymeleaf.exceptions.TemplateInputException: Error resolving template [home], template might not exist or might not be accessible by any of the configured Template Resolvers

【问题讨论】:

  • 欢迎来到 Stack Overflow。 HTTP 500 是一般的服务器端错误消息。它本身并没有告诉我们任何有用的信息。每当您看到这一点时,您的第一步应该是检查您的错误日志以获取更多详细信息。在 Heroku 上,您可以通过运行 heroku logs 来做到这一点。
  • @Chris,谢谢,但错误 4[io-57013-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in带有路径 [] 的上下文抛出异常 [请求处理失败;嵌套异常是 org.thymeleaf.exceptions.TemplateInputException:解析模板时出错 [home],模板可能不存在或可能无法被任何已配置的模板解析器访问],根本原因。 我的 home.html 是找到默认的 src/main/resources/Templates/home.html 和 thymeleaf 有连接 thymeleaf.org"> 。我在这里没有看到问题。
  • 您可能看不到问题,但这就是您在这里提出问题的原因。其他人可能会看到你错过的东西。请edit 将您的问题作为代码块以及之前可能出现的任何其他错误消息。
  • @Chris,非常感谢。编辑了问题:)

标签: java mysql spring-boot heroku cleardb


【解决方案1】:

通过更改文件夹结构解决的问题:

src/main/resources/模板 -> src/main/resources/模板

PS: 在这种情况下,Heroku 必须严格遵循文件夹名称。

【讨论】:

  • 正如目前所写,您的答案尚不清楚。请edit 添加其他详细信息,以帮助其他人了解这如何解决所提出的问题。你可以找到更多关于如何写好答案的信息in the help center
猜你喜欢
  • 1970-01-01
  • 2019-12-06
  • 1970-01-01
  • 2021-12-21
  • 2022-11-08
  • 1970-01-01
  • 2019-05-05
  • 2019-08-03
  • 1970-01-01
相关资源
最近更新 更多