【发布时间】:2017-08-21 18:29:53
【问题描述】:
我有一个基本的 SpringBoot 应用程序。使用 Spring Initializer、嵌入式 Tomcat、Thymeleaf 模板引擎,并打包为可执行 JAR 文件。
我在application.properties中有这个属性
server.contextPath=/pecador
server.port=5678
通过Eclipse运行我可以访问应用程序,一切都很好
http://localhost:5678/pecador/login
但是当我在服务器中部署应用程序并使用命令运行它时:
sudo nohup java -jar pecadorCloudApp-0.0.1-SNAPSHOT.jar & /tmp 2>> /dev/null >> /dev/null &
我试试http://149.152.231.117:5678/pecador/login
我收到了这个错误:
org.thymeleaf.exceptions.TemplateInputException: Error resolving template "/pecador/login/login", template might not exist or might not be accessible by any of the configured Template Resolvers
然后解压jar,模板就在下面:
pecadorAPP.jar/BOOT-INF/classes/templates/pecador/login/login.html
【问题讨论】:
标签: java spring spring-mvc spring-boot ubuntu-14.04