启动tomcat服务器报错:ERROR ContextLoader:307 - Context initialization failed

错误详情

十月 01, 2018 7:46:36 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclipse.jst.jee.server:bos19‘ did not find a matching property.十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Server version:        Apache Tomcat/8.5.30十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Server built:          Apr 3 2018 20:04:09 UTC十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Server number:         8.5.30.0十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: OS Name:               Windows 10十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: OS Version:            10.0十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Architecture:          amd64十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Java Home:             D:\learn\Java\JDK\jdk1.8.0_161\jre十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: JVM Version:           1.8.0_161-b12十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: JVM Vendor:            Oracle Corporation十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: CATALINA_BASE:         D:\learn\Java\eclipse-jee-oxygen-2-win32-x86_64\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: CATALINA_HOME:         D:\learn\JavaWeb\apache-tomcat\apache-tomcat-8.5.30十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Dcatalina.base=D:\learn\Java\eclipse-jee-oxygen-2-win32-x86_64\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Dcatalina.home=D:\learn\JavaWeb\apache-tomcat\apache-tomcat-8.5.30十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Dwtp.deploy=D:\learn\Java\eclipse-jee-oxygen-2-win32-x86_64\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Djava.endorsed.dirs=D:\learn\JavaWeb\apache-tomcat\apache-tomcat-8.5.30\endorsed十月 01, 2018 7:46:36 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Dfile.encoding=GBK十月 01, 2018 7:46:36 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent信息: Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3].十月 01, 2018 7:46:36 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].十月 01, 2018 7:46:36 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent信息: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]十月 01, 2018 7:46:37 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL信息: OpenSSL successfully initialized [OpenSSL 1.0.2m  2 Nov 2017]十月 01, 2018 7:46:38 下午 org.apache.coyote.AbstractProtocol init信息: Initializing ProtocolHandler ["http-nio-8080"]十月 01, 2018 7:46:39 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector信息: Using a shared selector for servlet write/read十月 01, 2018 7:46:39 下午 org.apache.coyote.AbstractProtocol init信息: Initializing ProtocolHandler ["ajp-nio-8009"]十月 01, 2018 7:46:39 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector信息: Using a shared selector for servlet write/read十月 01, 2018 7:46:39 下午 org.apache.catalina.startup.Catalina load信息: Initialization processed in 4059 ms十月 01, 2018 7:46:39 下午 org.apache.catalina.core.StandardService startInternal信息: Starting service [Catalina]十月 01, 2018 7:46:39 下午 org.apache.catalina.core.StandardEngine startInternal信息: Starting Servlet Engine: Apache Tomcat/8.5.30十月 01, 2018 7:46:47 下午 org.apache.jasper.servlet.TldScanner scanJars信息: 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.十月 01, 2018 7:46:57 下午 org.apache.jasper.servlet.TldScanner scanJars信息: 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.十月 01, 2018 7:46:57 下午 org.apache.catalina.core.ApplicationContext log信息: No Spring WebApplicationInitializer types detected on classpath十月 01, 2018 7:46:57 下午 org.apache.catalina.core.ApplicationContext log信息: Initializing Spring root WebApplicationContext19:46:57,185  INFO ContextLoader:272 - Root WebApplicationContext: initialization started19:46:57,372  INFO XmlWebApplicationContext:510 - Refreshing Root WebApplicationContext: startup date [Mon Oct 01 19:46:57 CST 2018]; root of context hierarchy19:46:57,487  INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from class path resource [applicationContext.xml]19:46:57,771  INFO ClassPathBeanDefinitionScanner:222 - JSR-250 ‘javax.annotation.ManagedBean‘ found and supported for component scanning19:46:58,203 ERROR ContextLoader:307 - Context initialization failedjava.lang.IllegalArgumentException    at org.springframework.asm.ClassReader.<init>(Unknown Source)    at org.springframework.asm.ClassReader.<init>(Unknown Source)    at org.springframework.asm.ClassReader.<init>(Unknown Source)    at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52)    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)    at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)    at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)    at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)    at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:230)    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:153)    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130)    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:285)    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4776)    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5240)    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)    at java.util.concurrent.FutureTask.run(FutureTask.java:266)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    at java.lang.Thread.run(Thread.java:748)十月 01, 2018 7:46:58 下午 org.apache.catalina.core.StandardContext listenerStart严重: Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]java.lang.IllegalArgumentException    at org.springframework.asm.ClassReader.<init>(Unknown Source)    at org.springframework.asm.ClassReader.<init>(Unknown Source)    at org.springframework.asm.ClassReader.<init>(Unknown Source)    at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:52)    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)    at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)    at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)    at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:298)    at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)    at org.springframework.context.annotation.ConfigurationClassParser.getImports(ConfigurationClassParser.java:300)    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:230)    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:153)    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:130)    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:285)    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:223)    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4776)    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5240)    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)    at java.util.concurrent.FutureTask.run(FutureTask.java:266)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    at java.lang.Thread.run(Thread.java:748)

十月 01, 2018 7:46:58 下午 org.apache.catalina.core.StandardContext startInternal严重: One or more listeners failed to start. Full details will be found in the appropriate container log file十月 01, 2018 7:46:58 下午 org.apache.catalina.core.StandardContext startInternal严重: Context [/bos19] startup failed due to previous errors十月 01, 2018 7:46:58 下午 org.apache.catalina.core.ApplicationContext log信息: Closing Spring root WebApplicationContext19:46:58,217  INFO XmlWebApplicationContext:1042 - Closing Root WebApplicationContext: startup date [Mon Oct 01 19:46:57 CST 2018]; root of context hierarchy19:46:58,232  WARN XmlWebApplicationContext:1052 - Exception thrown from ApplicationListener handling ContextClosedEventjava.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call ‘refresh‘ before multicasting events via the context: Root WebApplicationContext: startup date [Mon Oct 01 19:46:57 CST 2018]; root of context hierarchy    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347)    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049)    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:549)    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4823)    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5462)    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)    at java.util.concurrent.FutureTask.run(FutureTask.java:266)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    at java.lang.Thread.run(Thread.java:748)19:46:58,232  WARN XmlWebApplicationContext:1060 - Exception thrown from LifecycleProcessor on context closejava.lang.IllegalStateException: LifecycleProcessor not initialized - call ‘refresh‘ before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Mon Oct 01 19:46:57 CST 2018]; root of context hierarchy    at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)    at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:549)    at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:4823)    at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5462)    at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:226)    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1421)    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1411)    at java.util.concurrent.FutureTask.run(FutureTask.java:266)    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)    at java.lang.Thread.run(Thread.java:748)19:46:58,233  INFO DefaultListableBeanFactory:444 - Destroying singletons in org.s[email protected]75e731d4: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,dataSource,sessionFactory,transactionManager,userDaoImpl,userAction,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy十月 01, 2018 7:46:58 下午 org.apache.coyote.AbstractProtocol start信息: Starting ProtocolHandler ["http-nio-8080"]十月 01, 2018 7:46:58 下午 org.apache.coyote.AbstractProtocol start信息: Starting ProtocolHandler ["ajp-nio-8009"]十月 01, 2018 7:46:58 下午 org.apache.catalina.startup.Catalina start信息: Server startup in 19021 ms

系统框架

  struts2+spring3+hibernate3

  整体来说项目的版本相对来比较老

运行环境

  项目环境是Eclipse企业版4.7.2 + jdk1.8.0_161 + apache-tomcat-8.5.30

问题根源

  经过排查,这个问题就是发生在jdk环境的问题上!

解决方案

  jdk1.8只能支持spring4.0,而spring3只能使用1.7及以下jdk进行配置。

  所以降低jdk的版本即可解决问题。

  Windows --> Preferences --> Java --> Install JREs,安装jdk1.7版本

  

  与此同时,我们需要改变JDK编译器的java版本为jdk1.7,如下图所示:

  

效果截图

  再次启动tomcat,控制台没有报错了!

十月 01, 2018 8:41:27 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclipse.jst.jee.server:bos19‘ did not find a matching property.十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Server version:        Apache Tomcat/8.5.30十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Server built:          Apr 3 2018 20:04:09 UTC十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Server number:         8.5.30.0十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: OS Name:               Windows 8.1十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: OS Version:            6.3十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Architecture:          amd64十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Java Home:             D:\learn\Java\JRE\jre1.7.0_80十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: JVM Version:           1.7.0_80-b15十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: JVM Vendor:            Oracle Corporation十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: CATALINA_BASE:         D:\learn\Java\eclipse-jee-oxygen-2-win32-x86_64\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: CATALINA_HOME:         D:\learn\JavaWeb\apache-tomcat\apache-tomcat-8.5.30十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Dcatalina.base=D:\learn\Java\eclipse-jee-oxygen-2-win32-x86_64\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Dcatalina.home=D:\learn\JavaWeb\apache-tomcat\apache-tomcat-8.5.30十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Dwtp.deploy=D:\learn\Java\eclipse-jee-oxygen-2-win32-x86_64\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Djava.endorsed.dirs=D:\learn\JavaWeb\apache-tomcat\apache-tomcat-8.5.30\endorsed十月 01, 2018 8:41:27 下午 org.apache.catalina.startup.VersionLoggerListener log信息: Command line argument: -Dfile.encoding=GBK十月 01, 2018 8:41:27 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent信息: Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3].十月 01, 2018 8:41:27 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent信息: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].十月 01, 2018 8:41:27 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent信息: APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true]十月 01, 2018 8:41:27 下午 org.apache.catalina.core.AprLifecycleListener initializeSSL信息: OpenSSL successfully initialized [OpenSSL 1.0.2m  2 Nov 2017]十月 01, 2018 8:41:28 下午 org.apache.coyote.AbstractProtocol init信息: Initializing ProtocolHandler ["http-nio-8080"]十月 01, 2018 8:41:28 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector信息: Using a shared selector for servlet write/read十月 01, 2018 8:41:28 下午 org.apache.coyote.AbstractProtocol init信息: Initializing ProtocolHandler ["ajp-nio-8009"]十月 01, 2018 8:41:28 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector信息: Using a shared selector for servlet write/read十月 01, 2018 8:41:28 下午 org.apache.catalina.startup.Catalina load信息: Initialization processed in 1613 ms十月 01, 2018 8:41:28 下午 org.apache.catalina.core.StandardService startInternal信息: Starting service [Catalina]十月 01, 2018 8:41:28 下午 org.apache.catalina.core.StandardEngine startInternal信息: Starting Servlet Engine: Apache Tomcat/8.5.30十月 01, 2018 8:41:32 下午 org.apache.jasper.servlet.TldScanner scanJars信息: 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.十月 01, 2018 8:41:32 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom警告: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [290] milliseconds.十月 01, 2018 8:41:37 下午 org.apache.jasper.servlet.TldScanner scanJars信息: 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.十月 01, 2018 8:41:37 下午 org.apache.catalina.core.ApplicationContext log信息: No Spring WebApplicationInitializer types detected on classpath十月 01, 2018 8:41:37 下午 org.apache.catalina.core.ApplicationContext log信息: Initializing Spring root WebApplicationContext20:41:37,128  INFO ContextLoader:272 - Root WebApplicationContext: initialization started20:41:37,270  INFO XmlWebApplicationContext:510 - Refreshing Root WebApplicationContext: startup date [Mon Oct 01 20:41:37 CST 2018]; root of context hierarchy20:41:37,361  INFO XmlBeanDefinitionReader:315 - Loading XML bean definitions from class path resource [applicationContext.xml]20:41:37,535  INFO ClassPathBeanDefinitionScanner:222 - JSR-250 ‘javax.annotation.ManagedBean‘ found and supported for component scanning20:41:37,892  INFO PropertySourcesPlaceholderConfigurer:177 - Loading properties file from class path resource [JdbcInfo.properties]20:41:37,965  INFO DefaultListableBeanFactory:577 - Pre-instantiating singletons in org.s[email protected]16015cf6: defining beans [org.springframework.context.support.PropertySourcesPlaceholderConfigurer#0,dataSource,sessionFactory,transactionManager,userDaoImpl,userAction,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,org.springframework.context.annotation.internalPersistenceAnnotationProcessor,org.springframework.aop.config.internalAutoProxyCreator,org.springframework.transaction.annotation.AnnotationTransactionAttributeSource#0,org.springframework.transaction.interceptor.TransactionInterceptor#0,org.springframework.transaction.config.internalTransactionAdvisor,org.springframework.context.annotation.ConfigurationClassPostProcessor.importAwareProcessor]; root of factory hierarchy20:41:37,990  INFO MLog:80 - MLog clients using log4j logging.20:41:38,096  INFO C3P0Registry:204 - Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]20:41:38,469  INFO Version:37 - Hibernate Commons Annotations 3.2.0.Final20:41:38,478  INFO Environment:603 - Hibernate 3.6.10.Final20:41:38,480  INFO Environment:636 - hibernate.properties not found20:41:38,483  INFO Environment:814 - Bytecode provider name : javassist20:41:38,489  INFO Environment:695 - using JDK 1.4 java.sql.Timestamp handling20:41:38,609  INFO Configuration:495 - Reading mappings from file: D:\learn\Java\eclipse-jee-oxygen-2-win32-x86_64\eclipse-workspace\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\bos19\WEB-INF\classes\com\itheima\bos\domain\User.hbm.xml20:41:38,771  INFO HbmBinder:353 - Mapping class: com.itheima.bos.domain.User -> t_user20:41:38,803  INFO Configuration:1676 - Hibernate Validator not found: ignoring20:41:38,806  INFO LocalSessionFactoryBean:780 - Building new Hibernate SessionFactory20:41:38,813  INFO HibernateSearchEventListenerRegister:75 - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.20:41:38,819  INFO ConnectionProviderFactory:173 - Initializing connection provider: org.springframework.orm.hibernate3.LocalDataSourceConnectionProvider20:41:38,930  INFO AbstractPoolBackedDataSource:462 - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hgeby99yd7y1p712w0xgs|19d8b741, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgeby99yd7y1p712w0xgs|19d8b741, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql:///bos19, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]20:41:39,241  INFO Dialect:136 - Using dialect: org.hibernate.dialect.MySQL5Dialect20:41:39,257  INFO JdbcSupportLoader:108 - Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException20:41:39,257  INFO SettingsFactory:126 - Database ->       name : MySQL    version : 5.5.27      major : 5      minor : 520:41:39,257  INFO SettingsFactory:132 - Driver ->       name : MySQL Connector Java    version : mysql-connector-java-5.1.46 ( Revision: 9cc87a48e75c2d2e87c1a293b2862ce651cb256e )      major : 5      minor : 120:41:39,266  INFO TransactionFactoryFactory:65 - Transaction strategy: org.springframework.orm.hibernate3.SpringTransactionFactory20:41:39,268  INFO TransactionManagerLookupFactory:83 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)20:41:39,269  INFO SettingsFactory:179 - Automatic flush during beforeCompletion(): disabled20:41:39,269  INFO SettingsFactory:183 - Automatic session close at end of transaction: disabled20:41:39,269  INFO SettingsFactory:190 - JDBC batch size: 1520:41:39,269  INFO SettingsFactory:193 - JDBC batch updates for versioned data: disabled20:41:39,271  INFO SettingsFactory:198 - Scrollable result sets: enabled20:41:39,271  INFO SettingsFactory:206 - JDBC3 getGeneratedKeys(): enabled20:41:39,271  INFO SettingsFactory:214 - Connection release mode: auto20:41:39,274  INFO SettingsFactory:238 - Maximum outer join fetch depth: 220:41:39,275  INFO SettingsFactory:241 - Default batch fetch size: 120:41:39,275  INFO SettingsFactory:245 - Generate SQL with comments: disabled20:41:39,275  INFO SettingsFactory:249 - Order SQL updates by primary key: disabled20:41:39,276  INFO SettingsFactory:253 - Order SQL inserts for batching: disabled20:41:39,276  INFO SettingsFactory:431 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory20:41:39,281  INFO ASTQueryTranslatorFactory:47 - Using ASTQueryTranslatorFactory20:41:39,281  INFO SettingsFactory:261 - Query language substitutions: {}20:41:39,281  INFO SettingsFactory:266 - JPA-QL strict compliance: disabled20:41:39,282  INFO SettingsFactory:271 - Second-level cache: enabled20:41:39,282  INFO SettingsFactory:275 - Query cache: disabled20:41:39,282  INFO SettingsFactory:406 - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory20:41:39,284  INFO SettingsFactory:285 - Optimize cache for minimal puts: disabled20:41:39,285  INFO SettingsFactory:294 - Structured second-level cache entries: disabled20:41:39,292  INFO SettingsFactory:314 - Echoing all SQL to stdout20:41:39,294  INFO SettingsFactory:323 - Statistics: disabled20:41:39,294  INFO SettingsFactory:327 - Deleted entity synthetic identifier rollback: disabled20:41:39,294  INFO SettingsFactory:343 - Default entity-mode: pojo20:41:39,295  INFO SettingsFactory:347 - Named query checking : enabled20:41:39,295  INFO SettingsFactory:351 - Check Nullability in Core (should be disabled when Bean Validation is on): enabled20:41:39,322  INFO SessionFactoryImpl:202 - building session factory20:41:39,329  INFO BasicTypeRegistry:150 - Type registration [clob] overrides previous : [email protected]20:41:39,330  INFO BasicTypeRegistry:150 - Type registration [java.sql.Clob] overrides previous : [email protected]20:41:39,330  INFO BasicTypeRegistry:150 - Type registration [characters_clob] overrides previous : [email protected]20:41:39,330  INFO BasicTypeRegistry:150 - Type registration [blob] overrides previous : [email protected]20:41:39,330  INFO BasicTypeRegistry:150 - Type registration [java.sql.Blob] overrides previous : [email protected]20:41:39,330  INFO BasicTypeRegistry:150 - Type registration [wrapper_characters_clob] overrides previous : [email protected]20:41:39,331  INFO BasicTypeRegistry:150 - Type registration [materialized_blob] overrides previous : [email protected]20:41:39,331  INFO BasicTypeRegistry:150 - Type registration [wrapper_materialized_blob] overrides previous : [email protected]20:41:39,331  INFO BasicTypeRegistry:150 - Type registration [materialized_clob] overrides previous : [email protected]20:41:39,585  INFO SessionFactoryObjectFactory:105 - Not binding factory to JNDI, no JNDI name configured20:41:39,594  INFO SchemaUpdate:155 - Running hbm2ddl schema update20:41:39,594  INFO SchemaUpdate:167 - fetching database metadata20:41:39,598  INFO SchemaUpdate:179 - updating schema20:41:39,642  INFO TableMetadata:65 - table found: bos19.t_user20:41:39,643  INFO TableMetadata:66 - columns: [id, birthday, username, remark, station, gender, salary, telephone, password]20:41:39,643  INFO TableMetadata:68 - foreign keys: []20:41:39,643  INFO TableMetadata:69 - indexes: [primary]20:41:39,644  INFO SchemaUpdate:217 - schema update complete20:41:39,715  INFO HibernateTransactionManager:415 - Using DataSource [com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, dataSourceName -> 1hgeby99yd7y1p712w0xgs|19d8b741, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hgeby99yd7y1p712w0xgs|19d8b741, idleConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:mysql:///bos19, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, properties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false ]] of Hibernate SessionFactory for HibernateTransactionManager20:41:39,763  INFO ContextLoader:301 - Root WebApplicationContext: initialization completed in 2632 ms20:41:40,102  INFO XmlConfigurationProvider:42 - Parsing configuration file [struts-default.xml]20:41:40,193  INFO XmlConfigurationProvider:42 - Parsing configuration file [struts-plugin.xml]20:41:40,205  INFO XmlConfigurationProvider:42 - Parsing configuration file [struts.xml]20:41:40,210  INFO BeanSelectionProvider:42 - Choosing bean (spring) for (com.opensymphony.xwork2.ObjectFactory)20:41:40,211  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.FileManagerFactory)20:41:40,211  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.XWorkConverter)20:41:40,211  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.CollectionConverter)20:41:40,211  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.ArrayConverter)20:41:40,211  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.DateConverter)20:41:40,211  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.NumberConverter)20:41:40,211  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.impl.StringConverter)20:41:40,212  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionPropertiesProcessor)20:41:40,212  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionFileProcessor)20:41:40,212  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ConversionAnnotationProcessor)20:41:40,212  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterCreator)20:41:40,212  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.TypeConverterHolder)20:41:40,212  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.TextProvider)20:41:40,212  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.LocaleProvider)20:41:40,213  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.ActionProxyFactory)20:41:40,213  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.conversion.ObjectTypeDeterminer)20:41:40,213  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.dispatcher.mapper.ActionMapper)20:41:40,213  INFO BeanSelectionProvider:42 - Choosing bean (jakarta) for (org.apache.struts2.dispatcher.multipart.MultiPartRequest)20:41:40,213  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.views.freemarker.FreemarkerManager)20:41:40,215  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.components.UrlRenderer)20:41:40,216  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.validator.ActionValidatorManager)20:41:40,216  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.util.ValueStackFactory)20:41:40,216  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionProvider)20:41:40,216  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.util.reflection.ReflectionContextFactory)20:41:40,216  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.util.PatternMatcher)20:41:40,216  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.dispatcher.StaticContentLoader)20:41:40,217  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.UnknownHandlerManager)20:41:40,217  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (org.apache.struts2.views.util.UrlHelper)20:41:40,217  INFO BeanSelectionProvider:42 - Choosing bean (struts) for (com.opensymphony.xwork2.util.TextParser)20:41:40,217  INFO DefaultConfiguration:42 - Overriding property struts.i18n.reload - old value: false new value: true20:41:40,217  INFO DefaultConfiguration:42 - Overriding property struts.configuration.xml.reload - old value: false new value: true20:41:40,240  INFO StrutsSpringObjectFactory:42 - Initializing Struts-Spring integration...20:41:40,241  INFO SpringObjectFactory:42 - Setting autowire strategy to name20:41:40,241  INFO StrutsSpringObjectFactory:42 - ... initialized Struts-Spring integration successfully十月 01, 2018 8:41:40 下午 org.apache.coyote.AbstractProtocol start信息: Starting ProtocolHandler ["http-nio-8080"]十月 01, 2018 8:41:40 下午 org.apache.coyote.AbstractProtocol start信息: Starting ProtocolHandler ["ajp-nio-8009"]十月 01, 2018 8:41:40 下午 org.apache.catalina.startup.Catalina start信息: Server startup in 12761 ms

新的问题

  我们发现,控制台第一行出现一个警告:

  十月 01, 2018 8:41:27 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
  警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclipse.jst.jee.server:bos19‘ did not find a matching property.

问题原因

  这是因为我们在eclipse下,通过tomcat部署web工程时,tomcat的配置文件server.xml中会自动生成一个关于该web工程的配置信息,类似于下面的东西:

  xml代码:

<Context docBase="webPoject" path="/webProject" reloadable="true" source="org.eclipse.jst.jee.server:webProject"/> 

  而默认情况下,server.xml的 Context元素不支持名称为source的属性,所以会发出警告。

解决办法

  关闭tomcat,双击eclipse下tomcat服务器,在出来的 Tomcat server at localhost 页面中找到 Server Options 选项,选中其中的选项 ”Publish modual contexts to separat XML files“,Ctrl+s,重新启动tomcat。没有警告了!

  

参考链接:

  https://blog.csdn.net/jiadajing267/article/details/78957443

  https://blog.csdn.net/wearegouest/article/details/5175247

原文地址:https://www.cnblogs.com/chenmingjun/p/9735862.html

时间: 2024-10-08 03:14:59

启动tomcat服务器报错:ERROR ContextLoader:307 - Context initialization failed的相关文章

启动Tomcat服务器报错

启动Tomcat服务器报错: Several ports (8005, 8080, 8009) required by Tomcat v5.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to sto

Android 启动Tomcat服务报错,端口占用解决方案

启动Tomcat服务器报错:Several ports (8005, 8080, 8009) required by Tomcat v5.5 Server at localhost are already in use. The server may already be running in another process, or a system process may be using the port. To start this server you will need to stop

【IntellJ IDEA】idea启动测试类报错Error running &#39;Test1.test&#39;: Command line is too long. Shorten command line for Test1.test or also for JUnit default configuration.

idea启动测试类报错 Error running 'Test1.test': Command line is too long. Shorten command line for Test1.test or also for JUnit default configuration. 注意: 最简单的方法,就是你重新创建一个新的测试类,在里面重新写一遍测试方法,代码都可以粘贴过去. 解决方法: 1.打开本项目的.idea文件夹,找到文件夹中的workspace.xml文件 2.搜索 Proper

配置ssh框架启动tomcat服务器报异常Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]

在Spring中配置jdbc时,引用的是dbcp.jar包,在db.properties配置文件中,使用了之前的properties配置文件的用户名username(MySql用户名) 然后在启动服务器报了如下几个异常: 1.org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [a

启动hadoop,报错Error JAVA_HOME is not set and could not be found

报如错误:JAVA_HOME is not set and could not be found,可能是因为JAVA_HOME环境没配置正确,还有一种情况是即使各结点都正确地配置了JAVA_HOME,但在集群环境下还是报该错误,解决方法是显示地重新声明一遍JAVA_HOME 1.检查JAVA_HOME是否配置正确(伪分布式环境) 启动start-all.sh时报错,如下所示 解决方法: 输入java –version,查看jdk是否安装成功 输入export,查看jdk环境变量是否设置成功 2.

tomcat服务器报错(8005, 8080, 8009)端口被占用

使用eclipse编辑jsp时重启了一下tomcat然后编译的时候报错Severalports (8005, 8080, 8009) required by MyEclipseTomcat v7.0 are already in use.从网上搜出了解决办法,打开任务管理器------>详细信息然后找到javax.exe进程结束进程,然后重启eclipse,如果还是报错的话,多次重复操作一下.网上还有别的方法,我只用了一下这种方法. 原文地址:http://blog.51cto.com/1093

idea 启动 tomcat 不报错 但是跑不成功

idea 启动 tomcat 跑不起来 经百度之后,重新配置 Artifact 没解决,重新载入tomcat ,重新配置tomcat 还是解决不了. 结果是因为jpa 的实体类 @Column(name="CREATE_DATE")  同名了 原文地址:https://www.cnblogs.com/ljt123/p/10620533.html

Citrix 核心服务器报错Error: IMA Service Error Message -2147483647

ima服务不能启动的问题Error: IMA Service Error Message -214748364 http://support.citrix.com/article/CTX032712 可能是C:\Program Files\Citrix\Independent Management Architecture\ imalhc.mdb文件坏了,先删除这个文件.然后运行dsmaint recreatelhc重新创建这个文件.再重新启动机器或者服务,应该可以解决此问题. 日常要备份c:\

Eclipse 启动Tomcat 超时报错的解决方案

在用eclipse开发项目  用tomcat发布项目的时候  会提示超时, Server Tomcat v7.0 Server at localhost was unable to start within 45 seconds. If the server requires more time, try increasing the timeout in the server editor. 解决方案: 1.在 eclipse菜单->window->preferencs里找到server 中