java – Spring boot 1.5.2 – 加载徽标后Web应用程序停止?

前端之家收集整理的这篇文章主要介绍了java – Spring boot 1.5.2 – 加载徽标后Web应用程序停止?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我对Spring Boot有一个非常奇怪的问题,我不知道为什么使用Spring Boot的Web应用程序无法启动,即使我直接在终端上运行它也没有输出错误.

  1. java -jar /var/lib/tomcat/webapps/rasdaman.war
  2. log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment).
  3. log4j:WARN Please initialize the log4j system properly.
  4. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  5. . ____ _ __ _ _
  6. /\ / ' __ _ () __ __ _ \ \ \
  7. ( ( )__ | '_ | '| | ' / ` | \ \ \
  8. \/ )| |)| | | | | || (| | ) ) ) )
  9. ' || .__|| ||| |_,| / / / /
  10. =========||==============|/=////
  11. :: Spring Boot :: (v1.5.2.RELEASE)
  12. [rasdaman@osBoxes rasdaman]$echo $?
  13. 1

这是应用程序类https://pastebin.com/rinWbp9z,这个Web应用程序使用Liquibase来填充数据库模式和Spring引导版本1.5.2.你能分享一些提示进行调试吗?

最佳答案
所以,问题是,我正在使用log4.properties out of war文件.然后,当我开始这场战争时,它显示了非常好的信息,如下所示:

  1. java -jar target/petascope_main/rasdaman.war
  2. log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment).
  3. log4j:WARN Please initialize the log4j system properly.
  4. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  5. . ____ _ __ _ _
  6. /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
  7. ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
  8. \\/ ___)| |_)| | | | | || (_| | ) ) ) )
  9. ' |____| .__|_| |_|_| |_\__,| / / / /
  10. =========|_|==============|___/=/_/_/_/
  11. :: Spring Boot :: (v1.5.2.RELEASE)
  12. Aug 28,2017 6:00:31 PM org.apache.catalina.core.StandardService startInternal
  13. INFO: Starting service Tomcat
  14. Aug 28,2017 6:00:32 PM org.apache.catalina.core.StandardEngine startInternal
  15. INFO: Starting Servlet Engine: Apache Tomcat/8.5.11
  16. Aug 28,2017 6:00:33 PM org.apache.catalina.core.ApplicationContext log
  17. INFO: Initializing Spring embedded WebApplicationContext
  18. Aug 28,2017 6:00:38 PM org.apache.catalina.core.StandardService stopInternal
  19. INFO: Stopping service Tomcat

然后,我在src / main / resources中添加了一个log4j.properties文件,其中包含以下内容

  1. log4j.rootLogger=debug,stdout
  2. log4j.appender.stdout=org.apache.log4j.ConsoleAppender
  3. log4j.appender.stdout.Target=System.out
  4. log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
  5. log4j.appender.stdout.layout.ConversionPattern=%t %-5p %c{2} - %m%n

之后,我可以看到Spring的详细日志让Tomcat停止:

  1. ***************************
  2. APPLICATION Failed TO START
  3. ***************************
  4. Description:
  5. Field abstractHandler in org.rasdaman.ApplicationMain required a single bean,but 7 were found:
  6. - KVPRasqlServiceHandler: defined in URL [jar:file:/home/rasdaman/build/applications/petascope/target/petascope_main/rasdaman.war!/WEB-INF/classes!/petascope/controller/handler/service/KVPRasqlServiceHandler.class]
  7. - KVPWCPSServiceHandler: defined in URL [jar:file:/home/rasdaman/build/applications/petascope/target/petascope_main/rasdaman.war!/WEB-INF/classes!/petascope/controller/handler/service/KVPWCPSServiceHandler.class]
  8. - SOAPWCSServiceHandler: defined in URL [jar:file:/home/rasdaman/build/applications/petascope/target/petascope_main/rasdaman.war!/WEB-INF/classes!/petascope/controller/handler/service/SOAPWCSServiceHandler.class]
  9. - KVPWCSTServiceHandler: defined in URL [jar:file:/home/rasdaman/build/applications/petascope/target/petascope_main/rasdaman.war!/WEB-INF/classes!/petascope/controller/handler/service/KVPWCSTServiceHandler.class]
  10. - XMLWCSServiceHandler: defined in URL [jar:file:/home/rasdaman/build/applications/petascope/target/petascope_main/rasdaman.war!/WEB-INF/classes!/petascope/controller/handler/service/XMLWCSServiceHandler.class]
  11. - KVPWCSServiceHandler: defined in URL [jar:file:/home/rasdaman/build/applications/petascope/target/petascope_main/rasdaman.war!/WEB-INF/classes!/petascope/controller/handler/service/KVPWCSServiceHandler.class]
  12. - KVPWMSServiceHandler: defined in URL [jar:file:/home/rasdaman/build/applications/petascope/target/petascope_main/rasdaman.war!/WEB-INF/classes!/petascope/controller/handler/service/KVPWMSServiceHandler.class]
  13. Action:
  14. Consider marking one of the beans as @Primary,updating the consumer to accept multiple beans,or using @Qualifier to identify the bean that should be consumed

嗯,我必须说,对于如何隐藏错误真是令人印象深刻.

猜你在找的Spring相关文章