org.springframework.beans.factory.BeanCreationException,Invocation of init method failed,Context initialization failed

G:\javaanzhuang\apache-tomcat-8.5.32\bin\catalina.bat run
[2019-03-29 08:23:23,784] Artifact ssm_qingmu02_web:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE:   "C:\Users\Administrator\.IntelliJIdea2017.3\system\tomcat\Unnamed_ssm_qingmu"
Using CATALINA_HOME:   "G:\javaanzhuang\apache-tomcat-8.5.32"
Using CATALINA_TMPDIR: "G:\javaanzhuang\apache-tomcat-8.5.32\temp"
Using JRE_HOME:        "G:\javaanzhuang\JDK"
Using CLASSPATH:       "G:\javaanzhuang\apache-tomcat-8.5.32\bin\bootstrap.jar;G:\javaanzhuang\apache-tomcat-8.5.32\bin\tomcat-juli.jar"
29-Mar-2019 20:23:24.952 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.5.32
29-Mar-2019 20:23:24.955 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Jun 20 2018 19:50:35 UTC
29-Mar-2019 20:23:24.955 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.5.32.0
29-Mar-2019 20:23:24.955 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Windows 7
29-Mar-2019 20:23:24.955 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            6.1
29-Mar-2019 20:23:24.955 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
29-Mar-2019 20:23:24.955 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             G:\javaanzhuang\JDK\jre
29-Mar-2019 20:23:24.955 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.8.0_162-b12
29-Mar-2019 20:23:24.955 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
29-Mar-2019 20:23:24.955 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         C:\Users\Administrator\.IntelliJIdea2017.3\system\tomcat\Unnamed_ssm_qingmu
29-Mar-2019 20:23:24.956 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         G:\javaanzhuang\apache-tomcat-8.5.32
29-Mar-2019 20:23:24.956 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=C:\Users\Administrator\.IntelliJIdea2017.3\system\tomcat\Unnamed_ssm_qingmu\conf\logging.properties
29-Mar-2019 20:23:24.956 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
29-Mar-2019 20:23:24.956 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote=
29-Mar-2019 20:23:24.956 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.port=1099
29-Mar-2019 20:23:24.957 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.ssl=false
29-Mar-2019 20:23:24.957 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcom.sun.management.jmxremote.authenticate=false
29-Mar-2019 20:23:24.957 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.rmi.server.hostname=127.0.0.1
29-Mar-2019 20:23:24.957 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
29-Mar-2019 20:23:24.957 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
29-Mar-2019 20:23:24.957 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
29-Mar-2019 20:23:24.957 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=C:\Users\Administrator\.IntelliJIdea2017.3\system\tomcat\Unnamed_ssm_qingmu
29-Mar-2019 20:23:24.957 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=G:\javaanzhuang\apache-tomcat-8.5.32
29-Mar-2019 20:23:24.958 信息 [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=G:\javaanzhuang\apache-tomcat-8.5.32\temp
29-Mar-2019 20:23:24.958 信息 [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [G:\javaanzhuang\JDK\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;G:\javaanzhuang\JDK\bin;G:\javaanzhuang\JDK\jre\bin;G:\javaanzhuang\MySQL\MySQL Server 5.5\bin;G:\javaanzhuang\Mysql\MySQL Server 5.0\bin;G:\javaanzhuang\apache-maven-3.3.9\bin;F:\qmtools\svnserver\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\SSH Communications Security\SSH Secure Shell;.]
29-Mar-2019 20:23:25.126 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8080"]
29-Mar-2019 20:23:25.140 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Mar-2019 20:23:25.146 信息 [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
29-Mar-2019 20:23:25.150 信息 [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
29-Mar-2019 20:23:25.150 信息 [main] org.apache.catalina.startup.Catalina.load Initialization processed in 666 ms
29-Mar-2019 20:23:25.197 信息 [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
29-Mar-2019 20:23:25.197 信息 [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.5.32
29-Mar-2019 20:23:25.213 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
29-Mar-2019 20:23:25.227 信息 [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
29-Mar-2019 20:23:25.230 信息 [main] org.apache.catalina.startup.Catalina.start Server startup in 79 ms
Connected to server
[2019-03-29 08:23:25,428] Artifact ssm_qingmu02_web:war exploded: Artifact is being deployed, please wait...
29-Mar-2019 20:23:28.325 信息 [RMI TCP Connection(3)-127.0.0.1] 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.
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.
[2019-03-29 08:23:33,332] Artifact ssm_qingmu02_web:war exploded: Artifact is deployed successfully
[2019-03-29 08:23:33,332] Artifact ssm_qingmu02_web:war exploded: Deploy took 7,904 milliseconds
29-Mar-2019 20:23:35.241 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [G:\javaanzhuang\apache-tomcat-8.5.32\webapps\manager]
29-Mar-2019 20:23:35.384 信息 [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [G:\javaanzhuang\apache-tomcat-8.5.32\webapps\manager] has finished in [137] ms
[2019-03-29 08:28:16,818] Artifact ssm_qingmu02_web:war exploded: Artifact is being deployed, please wait...
29-Mar-2019 20:28:16.924 警告 [RMI TCP Connection(6)-127.0.0.1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [ROOT] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
29-Mar-2019 20:28:20.588 信息 [RMI TCP Connection(8)-127.0.0.1] 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.
ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.
20:28:25.103 [RMI TCP Connection(8)-127.0.0.1] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.filterChainProxy': Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: A universal match pattern ('/**') is defined  before other patterns in the filter chain, causing them to be ignored. Please check the ordering in your <security:http> namespace or FilterChainProxy bean configuration
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1710) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:502) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:312) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:310) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:758) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) ~[spring-context-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:409) ~[spring-web-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:291) ~[spring-web-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:103) ~[spring-web-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792) ~[catalina.jar:8.5.32]
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256) ~[catalina.jar:8.5.32]
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) ~[catalina.jar:8.5.32]
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754) ~[catalina.jar:8.5.32]
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730) ~[catalina.jar:8.5.32]
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) ~[catalina.jar:8.5.32]
    at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1736) ~[catalina.jar:8.5.32]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162]
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) ~[tomcat-coyote.jar:8.5.32]
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_162]
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_162]
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:483) ~[catalina.jar:8.5.32]
    at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:432) ~[catalina.jar:8.5.32]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162]
    at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300) ~[tomcat-coyote.jar:8.5.32]
    at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819) ~[?:1.8.0_162]
    at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801) ~[?:1.8.0_162]
    at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468) ~[?:1.8.0_162]
    at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76) ~[?:1.8.0_162]
    at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309) ~[?:1.8.0_162]
29-Mar-2019 20:28:25.123 严重 [RMI TCP Connection(8)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file
29-Mar-2019 20:28:25.124 严重 [RMI TCP Connection(8)-127.0.0.1] org.apache.catalina.core.StandardContext.startInternal Context [] startup failed due to previous errors
29-Mar-2019 20:28:25.136 警告 [RMI TCP Connection(8)-127.0.0.1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesJdbc The web application [ROOT] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
    at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401) ~[?:1.8.0_162]
    at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829) ~[?:1.8.0_162]
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_162]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_162]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_162]
    at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_162]
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:361) ~[?:1.8.0_162]
    at sun.rmi.transport.Transport$1.run(Transport.java:200) ~[?:1.8.0_162]
    at sun.rmi.transport.Transport$1.run(Transport.java:197) ~[?:1.8.0_162]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_162]
    at sun.rmi.transport.Transport.serviceCall(Transport.java:196) ~[?:1.8.0_162]
    at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568) ~[?:1.8.0_162]
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826) ~[?:1.8.0_162]
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683) ~[?:1.8.0_162]
    at java.security.AccessController.doPrivileged(Native Method) [?:1.8.0_162]
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682) [?:1.8.0_162]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:1.8.0_162]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:1.8.0_162]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_162]
Caused by: java.lang.IllegalArgumentException: A universal match pattern ('/**') is defined  before other patterns in the filter chain, causing them to be ignored. Please check the ordering in your <security:http> namespace or FilterChainProxy bean configuration
    at org.springframework.security.config.http.DefaultFilterChainValidator.checkPathOrder(DefaultFilterChainValidator.java:68) ~[spring-security-config-5.0.1.RELEASE.jar:5.0.1.RELEASE]
    at org.springframework.security.config.http.DefaultFilterChainValidator.validate(DefaultFilterChainValidator.java:55) ~[spring-security-config-5.0.1.RELEASE.jar:5.0.1.RELEASE]
    at org.springframework.security.web.FilterChainProxy.afterPropertiesSet(FilterChainProxy.java:168) ~[spring-security-web-5.0.1.RELEASE.jar:5.0.1.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1769) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1706) ~[spring-beans-5.0.2.RELEASE.jar:5.0.2.RELEASE]
    ... 57 more
[2019-03-29 08:28:25,651] Artifact ssm_qingmu02_web:war exploded: Error during artifact deployment. See server log for details.

解决方法:

 

 改完以后的代码为:

然后tomcat可以正常运行了.

posted @ 2019-03-29 20:35  King-DA  阅读(969)  评论(0编辑  收藏  举报