Spring无法正常工作但没有错误消息

时间:2017-03-24 18:29:05

标签: java spring hibernate

我目前正在使用Spring Hibernate开发一个项目。

通常,当我使用Tomcat部署并运行我的项目时,我会在控制台中看到类似下图的内容:

enter image description here

但是,我目前的版本不再显示Spring签名了。

我在控制台上收到的输出只是:

Connected to server
[2017-03-24 01:14:19,058] Artifact Gradle : com.enocom : jddp-112.112.112.war (exploded): Artifact is being deployed, please wait...
[2017-03-24 01:14:19,416] Artifact Gradle : com.enocom : jddp-112.112.112.war (exploded): Artifact is deployed successfully
[2017-03-24 01:14:19,416] Artifact Gradle : com.enocom : jddp-112.112.112.war (exploded): Deploy took 358 milliseconds
24-Mar-2017 13:14:28.886 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager
24-Mar-2017 13:14:28.949 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory C:\Program Files\Apache Software Foundation\Tomcat 8.5\webapps\manager has finished in 63 ms

没有错误消息,服务器已连接,并且部署了war文件。但是为什么Spring标志消失了,项目是否正常运行?可能是什么原因造成的?

感谢。

2 个答案:

答案 0 :(得分:4)

检查属性中spring.main.banner-mode的值。您可以使用System.getProperty("prop")/System.env("prop")打印该属性,或者只需将Actuator依赖项添加到POM,您就可以看到/env端点中的所有属性。

有3种可能的值from the documentation here

  • 控制台
  • 日志

如果值为off,则不会打印横幅。

最简单的方法是手动将值设置为console/log并查看是否已打印。

答案 1 :(得分:0)

您的jar中错过了const opts = { params: { notify_url: `${ process.env.SELF }/services/trans/${ jwToken }`, steps: { import: { robot: '/s3/import', use: ':original', bucket: process.env.S3_INGEST, path: ingest.key, key: process.env.AWS_ID, secret: process.env.AWS_SECRET, }, encode: { robot: '/audio/encode', use: 'import', ffmpeg_stack: 'v2.2.3', preset: 'aac', ffmpeg: { ab: '128k', }, }, export: { robot: '/s3/store', use: 'encode', bucket: s3Export, path: `${ prefix }/${ token }.m4a`, headers: { 'Content-Type': 'audio/mp4', 'x-amz-server-side-encryption': 'AES256', }, key: process.env.AWS_ID, secret: process.env.AWS_SECRET, }, }, }, }; 类(其中包含ApplicationLauncher注释),因此未启动spring boot。

您可以查看here以查找有关spring bootstrapping如何工作的示例。