Java Tomcat:一个或多个侦听器启动失败

Java Tomcat:一个或多个侦听器启动失败,java,tomcat,Java,Tomcat,我有一个应用程序在我添加/升级了一些依赖项后没有启动。它记录了一个错误,说 严重:一个或多个侦听器启动失败。完整的详细信息将在相应的容器日志文件中找到 我看到了所有的日志文件,还有catalina、、localhost、、application.*,但它们似乎都没有stacktrace,因为它导致启动中断 这是tomcat8,java8 如何检查日志,以及除了普通的tomcat文件夹之外,日志可以放在哪里 卡特琳娜日志: Feb 06, 2018 3:07:32 PM org.apache.ca

我有一个应用程序在我添加/升级了一些依赖项后没有启动。它记录了一个错误,说

严重:一个或多个侦听器启动失败。完整的详细信息将在相应的容器日志文件中找到

我看到了所有的日志文件,还有catalina、、localhost、、application.*,但它们似乎都没有stacktrace,因为它导致启动中断

这是tomcat8,java8

如何检查日志,以及除了普通的tomcat文件夹之外,日志可以放在哪里

卡特琳娜日志:

Feb 06, 2018 3:07:32 PM org.apache.catalina.core.AprLifecycleListener lifecycleEvent
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [
/user/name/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
Feb 06, 2018 3:07:32 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-nio-7060"]
Feb 06, 2018 3:07:32 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Feb 06, 2018 3:07:32 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-nio-9060"]
Feb 06, 2018 3:07:32 PM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
INFO: Using a shared selector for servlet write/read
Feb 06, 2018 3:07:32 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 556 ms
Feb 06, 2018 3:07:32 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service [Catalina]
Feb 06, 2018 3:07:32 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/8.5.23
Feb 06, 2018 3:07:32 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/application.war]
Feb 06, 2018 3:07:48 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 06, 2018 3:08:07 PM redis.clients.jedis.JedisSentinelPool initSentinels
INFO: Trying to find master from available Sentinels...
Feb 06, 2018 3:08:07 PM redis.clients.jedis.JedisSentinelPool initSentinels
INFO: Redis master running at 127.0.0.1:6379, starting Sentinel listeners...
Feb 06, 2018 3:08:07 PM redis.clients.jedis.JedisSentinelPool initPool
INFO: Created JedisPool to master at 127.0.0.1:6379
Hibernate: A complicated Hibernate query
Feb 06, 2018 3:08:25 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.2.7 ( 20140610-1547 https://svn.java.net/svn/mojarra~svn/tags/2.2.7@13362) for context '/application'
Feb 06, 2018 3:08:25 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.
Feb 06, 2018 3:08:26 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/application.war] has finished in [53,864] ms
Feb 06, 2018 3:08:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/docs]
Feb 06, 2018 3:08:26 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 06, 2018 3:08:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/docs] has finished in [386] ms
Feb 06, 2018 3:08:26 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/examples]
Feb 06, 2018 3:08:27 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 06, 2018 3:08:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/examples] has finished in [551] ms
Feb 06, 2018 3:08:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/host-manager]
Feb 06, 2018 3:08:27 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 06, 2018 3:08:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/host-manager] has finished in [363] ms
Feb 06, 2018 3:08:27 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/manager]
Feb 06, 2018 3:08:28 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 06, 2018 3:08:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/manager] has finished in [295] ms
Feb 06, 2018 3:08:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/ROOT]
Feb 06, 2018 3:08:28 PM org.apache.jasper.servlet.TldScanner scanJars
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Feb 06, 2018 3:08:28 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory [/usr/local/Cellar/tomcat/8.5.23/libexec/webapps/ROOT] has finished in [298] ms
Feb 06, 2018 3:08:28 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-nio-7060"]
Feb 06, 2018 3:08:28 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-nio-9060"]
Feb 06, 2018 3:08:28 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 55840 ms

找到了识别问题的简单方法

  • 在应用程序的
    WEB-INF/classes
    目录中,创建一个新文件:
    logging.properties

  • 在该文件中添加以下内容:

  • 重新启动tomcat
  • 现在,您将拥有完整的stacktrace,并从此开始调试问题

    对于Maven构建
  • 在模块的
    src/main/resources
    目录中创建一个新的
    logging.properties
  • 将这些条目添加到新文件中
  • 运行mvn清洁安装
  • 重新启动Tomcat

  • 在我的例子中,我在位于Tomcat_Home/logs中的localhost.log文件中找到了日志。希望这对你有所帮助。

    添加
    logging.properties
    文件对我没有任何帮助。而是在
    tomcat/logs/localhost.[YYYY-MM-DD].log中找到了我的错误的堆栈跟踪。这有助于找到错误日志文件和实际错误

    sh bin/startup.sh ; tail -f logs/*.log;
    

    你能检查一下你的日志文件吗?你能和我们分享更多关于这个错误的细节吗?但是,你检查了什么文件?catalina.out?“我看到了所有的日志文件,还有catalina.,localhost.,application.*,但它们似乎都没有stacktrace,因为启动正在中断。”
    org.apache.catalina.core.ContainerBase.[Catalina].level=INFO
    org.apache.catalina.core.ContainerBase.[Catalina].handlers=java.util.logging.ConsoleHandler
    
    sh bin/startup.sh ; tail -f logs/*.log;