我在部署完项目后,debug启动Tomcat会在中间卡住不继续执行,测试发现在不部署项目的时候Tomcat是可以正常启动的。
控制台信息如下:
十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server version: Apache Tomcat/7.0.77 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server built: Mar 28 2017 16:01:48 UTC 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Server number: 7.0.77.0 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Name: Windows 8.1 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: OS Version: 6.3 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Architecture: amd64 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Java Home: D:\Program Files\Java\jdk1.7.0_80\jre 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Version: 1.7.0_80-b15 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: JVM Vendor: Oracle Corporation 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_BASE: D:\apache-tomcat-7.0.77 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: CATALINA_HOME: D:\apache-tomcat-7.0.77 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -agentlib:jdwp=transport=dt_socket,suspend=y,address=localhost:49698 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.home=D:\apache-tomcat-7.0.77 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dcatalina.base=D:\apache-tomcat-7.0.77 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.endorsed.dirs=D:\apache-tomcat-7.0.77/common/endorsed 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.io.tmpdir=D:\apache-tomcat-7.0.77\temp 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Djava.library.path=D:\Program Files\Java\jdk1.7.0_80\bin;D:\apache-tomcat-7.0.77\bin 十月 25, 2017 10:40:44 上午 org.apache.catalina.startup.VersionLoggerListener log 信息: Command line argument: -Dsun.io.useCanonCaches=false 十月 25, 2017 10:40:44 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: Loaded APR based Apache Tomcat Native library 1.2.12 using APR version 1.5.2. 十月 25, 2017 10:40:44 上午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent 信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. 十月 25, 2017 10:40:45 上午 org.apache.catalina.core.AprLifecycleListener initializeSSL 信息: OpenSSL successfully initialized (OpenSSL 1.0.2k 26 Jan 2017) 十月 25, 2017 10:40:45 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["http-apr-8081"] 十月 25, 2017 10:40:45 上午 org.apache.coyote.AbstractProtocol init 信息: Initializing ProtocolHandler ["ajp-apr-8010"] 十月 25, 2017 10:40:45 上午 org.apache.catalina.startup.Catalina load 信息: Initialization processed in 2006 ms 十月 25, 2017 10:40:45 上午 org.apache.catalina.core.StandardService startInternal 信息: Starting service Catalina 十月 25, 2017 10:40:45 上午 org.apache.catalina.core.StandardEngine startInternal 信息: Starting Servlet Engine: Apache Tomcat/7.0.77 十月 25, 2017 10:40:46 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\apache-tomcat-7.0.77\webapps\docs 十月 25, 2017 10:40:46 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\apache-tomcat-7.0.77\webapps\docs has finished in 720 ms 十月 25, 2017 10:40:46 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\apache-tomcat-7.0.77\webapps\examples 十月 25, 2017 10:40:47 上午 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: contextInitialized() 十月 25, 2017 10:40:47 上午 org.apache.catalina.core.ApplicationContext log 信息: SessionListener: contextInitialized() 十月 25, 2017 10:40:47 上午 org.apache.catalina.core.ApplicationContext log 信息: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@187a3885') 十月 25, 2017 10:40:47 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\apache-tomcat-7.0.77\webapps\examples has finished in 524 ms 十月 25, 2017 10:40:47 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\apache-tomcat-7.0.77\webapps\host-manager 十月 25, 2017 10:40:47 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deployment of web application directory D:\apache-tomcat-7.0.77\webapps\host-manager has finished in 106 ms 十月 25, 2017 10:40:47 上午 org.apache.catalina.startup.HostConfig deployDirectory 信息: Deploying web application directory D:\apache-tomcat-7.0.77\webapps\imgcollect 十月 25, 2017 10:40:53 上午 org.apache.catalina.startup.TldConfig execute 信息: 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. 十月 25, 2017 10:40:53 上午 org.apache.catalina.core.ApplicationContext log 信息: No Spring WebApplicationInitializer types detected on classpath 十月 25, 2017 10:40:53 上午 org.apache.catalina.core.ApplicationContext log 信息: Set web app root system property: 'pictwoview' = [D:\apache-tomcat-7.0.77\webapps\imgcollect\] 十月 25, 2017 10:40:53 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing log4j from [classpath:config/log4j/log4j.xml] 十月 25, 2017 10:40:53 上午 org.apache.catalina.core.ApplicationContext log 信息: Initializing Spring FrameworkServlet 'spring' 2017-10-25 10:40:53 [INFO] [org.springframework.web.servlet.DispatcherServlet] - FrameworkServlet 'spring': initialization started 2017-10-25 10:40:53 [INFO] [org.springframework.web.context.support.XmlWebApplicationContext] - Refreshing WebApplicationContext for namespace 'spring-servlet': startup date [Wed Oct 25 10:40:53 CST 2017]; root of context hierarchy 2017-10-25 10:40:53 [INFO] [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] - Loading XML bean definitions from class path resource [config/spring/spring-servlet.xml] 2017-10-25 10:40:54 [INFO] [monitor.common.servlet.PropertyPlaceholderConfigurerInfo] - Loading properties file from class path resource [config/properties/jdbc.properties] SLF4J: The requested version 1.6.99 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11] SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details. 2017-10-25 10:40:57 [INFO] [org.springframework.web.servlet.handler.SimpleUrlHandlerMapping] - Root mapping to handler of type [class org.springframework.web.servlet.mvc.ParameterizableViewController]
发现在加载配置的文件时候卡住了,分析了一下配置文件,项目中所有的xml文件,在其中的一个文件中加载了一个需要连接MQ的类(该类需要连接启动的MQ服务器),问题就出现在这里了。
解决方案一:
开启MQ服务器;
解决方案二:
把改配置注释掉;
亲测好使。。。