2017-08-28 3 views
1

Ich habe ein sehr seltsames Problem mit Spring Boot, ich weiß nicht, warum die Webanwendung, die Spring Boot verwendet, nicht starten kann, und es hat keine Ausgabefehler, auch wenn ich es direkt auf dem Terminal ausführen.Spring Boot 1.5.2 - Web-Anwendung stoppt nach dem Laden des Logos?

java -jar /var/lib/tomcat/webapps/rasdaman.war 
log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment). 
log4j:WARN Please initialize the log4j system properly. 
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 

. ____ _ __ _ _ 
/\/' __ _() __ __ _ \ \ \ 
(()__ | '_ | '| | '/` | \ \ \ 
\/)| |)| | | | | || (| |)))) 
' || .__|| ||| |_, |//// 
=========||==============|/=//// 
:: Spring Boot :: (v1.5.2.RELEASE) 

[[email protected] rasdaman]$ echo $? 
1 

Hier ist die Anwendungsklasse https://pastebin.com/rinWbp9z, diese Web-Anwendung verwendet Liquibase version 1.5.2 Datenbankschema und Spring-Boot zu füllen. Kannst du bitte einen Tipp zum Debuggen teilen?

+1

Hört es wirklich auf oder stoppt nur die Protokollierung ... log4j wird in Spring Boot 1.5 und höher (log4j2) nicht mehr unterstützt. –

+1

Ihr Logging-System ist nicht richtig initialisiert, deshalb sehen Sie hinter dem Logo nichts. Bist du sicher, dass deine App nicht verfügbar ist? Versuchen Sie, alle Anpassungen, die Sie an der Protokollierungskonfiguration vorgenommen haben, zunächst zu entfernen. –

+0

Ich kann Log4j mit einer Eigenschaftendatei verwenden, und diese Webanwendung kann ohne Fehler auf meinem Entwicklungssystem ausgeführt werden (d. H. Es wird so lange ausgeführt, bis das Protokoll über die Spring Boot-Anwendung nach ... Sekunden angezeigt wird). Aber ich verstehe nicht, warum diese Anwendung, wenn sie auf eine neue virtuelle Maschine kopiert wird, direkt nach dem Logo (?) Stoppt. Ich habe versucht, Log-Level in der Log4j-Eigenschaft Datei auf DEBUG und es zeigt auch nichts. Ich denke, Spring Boot hat ein fettes Glas erstellt, so dass alle Abhängigkeiten bereits in dieser Datei (WAR/JAR) enthalten sind. –

Antwort

0

Also, das Problem ist, ich verwende log4.properties aus Kriegs-Datei. Dann, als ich diesen Krieg beginnt, Es zeigt sehr schön Informationen wie folgt aus:

java -jar target/petascope_main/rasdaman.war 
log4j:WARN No appenders could be found for logger (org.springframework.web.context.support.StandardServletEnvironment). 
log4j:WARN Please initialize the log4j system properly. 
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info. 

    . ____   _   __ _ _ 
/\\/___'_ __ _ _(_)_ __ __ _ \ \ \ \ 
(()\___ | '_ | '_| | '_ \/ _` | \ \ \ \ 
\\/ ___)| |_)| | | | | || (_| | )))) 
    ' |____| .__|_| |_|_| |_\__, |//// 
=========|_|==============|___/=/_/_/_/ 
:: Spring Boot ::  (v1.5.2.RELEASE) 

Aug 28, 2017 6:00:31 PM org.apache.catalina.core.StandardService startInternal 
INFO: Starting service Tomcat 
Aug 28, 2017 6:00:32 PM org.apache.catalina.core.StandardEngine startInternal 
INFO: Starting Servlet Engine: Apache Tomcat/8.5.11 
Aug 28, 2017 6:00:33 PM org.apache.catalina.core.ApplicationContext log 
INFO: Initializing Spring embedded WebApplicationContext 
Aug 28, 2017 6:00:38 PM org.apache.catalina.core.StandardService stopInternal 
INFO: Stopping service Tomcat 

Dann habe ich eine Datei log4j.properties in src/main/resources mit diesem Inhalt:

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

Danach kann ich das Detailprotokoll von Frühling sehen, die Tomcat Stopp machen:

*************************** 
APPLICATION FAILED TO START 
*************************** 

Description: 

Field abstractHandler in org.rasdaman.ApplicationMain required a single bean, but 7 were found: 
    - 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] 
    - 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] 
    - 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] 
    - 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] 
    - 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] 
    - 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] 
    - 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] 


Action: 

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 

Nun, ich muss sagen, es wirklich beeindrucken ie darüber, wie Fehler versteckt werden könnten.

Verwandte Themen