【发布时间】:2016-05-07 14:09:39
【问题描述】:
我跟随 this blog post 使用 Boot Dashboard 将 Spring example application 部署到 Pivotal Cloud Foundry。示例应用程序是一个 Spring Boot 应用程序(1.3.2.RELEASE),使用 JSP 并具有 WAR 封装。
应用程序似乎启动正常,但主页是空白的。尝试 cURL,我看到了以下输出:
但是,当我使用命令行部署应用程序时:
cf push np-spring-tutorial -p spring-tutorial-0.0.1-SNAPSHOT.war
应用程序已部署并运行良好。
那么,是不是 Boot Dashboard 部署到 PWS 的方式还不支持带有 JSP 的 WAR 文件?在使用 Boot Dashboard 部署 JSP 少 JAR 文件之前,我曾尝试过,它们运行良好。
更新:
根据 Sanjay Rawat 的建议,我将 Spring Boot 版本更新为 1.3.4,并且现在还有一个 manifest.yml,如下所示:
---
applications:
- name: np-spring-tutorial
buildpack: https://github.com/cloudfoundry/java-buildpack.git
path: target/spring-tutorial-0.0.1-SNAPSHOT.war
env:
application_url: http://np-spring-tutorial.cfapps.io
services:
- np-spring-tutorial-db
timeout: 180
通过点击和试用,我注意到实际需要的唯一设置是path: target/spring-tutorial-0.0.1-SNAPSHOT.war。
现在应用程序正在运行,我可以看到页面。但是,在启动应用程序时,控制台上会出现以下错误:
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/vcap/app/WEB-INF/lib/logback-classic-1.1.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/vcap/app/WEB-INF/lib/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
【问题讨论】:
-
它是 Spring Boot 应用程序吗?如果是,请提及引导版本号。
-
是的,它是一个 Spring Boot 应用程序。版本是 1.3.2.RELEASE。 (更新了问题)
标签: spring spring-boot np-spring