Log4j2启动报错,ava.lang.NoSuchMethodError 5C

Caused by: java.lang.NoSuchMethodError: org.apache.logging.log4j.core.util.FileUtils.getCorrectedFilePathUri(Ljava/lang/String;)Ljava/net/URI;
at org.apache.logging.log4j.web.Log4jWebInitializerImpl.getConfigURI(Log4jWebInitializerImpl.java:193)
at org.apache.logging.log4j.web.Log4jWebInitializerImpl.initializeNonJndi(Log4jWebInitializerImpl.java:156)
at org.apache.logging.log4j.web.Log4jWebInitializerImpl.start(Log4jWebInitializerImpl.java:107)
at org.apache.logging.log4j.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:57)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5669)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
... 42 more

Jul 02, 2018 1:19:18 PM org.apache.tomcat.util.modeler.BaseModelMBean invoke
严重: Exception invoking method manageApp
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1021)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:993)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1900)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:835)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
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)

Jul 02, 2018 1:19:18 PM org.apache.tomcat.util.modeler.BaseModelMBean invoke
严重: Exception invoking method createStandardContext
javax.management.RuntimeOperationsException: Exception invoking method manageApp
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:309)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:357)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:573)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:835)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:688)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:687)
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)
Caused by: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1021)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:993)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1900)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
... 33 more

Jul 02, 2018 1:19:23 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory /usr/local/apache-tomcat-7.0.88/webapps/manager
Jul 02, 2018 1:19:23 PM org.apache.catalina.startup.TldConfig execute


下面是pom文件


 <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.konglin</groupId>
    <artifactId>SmartCompus</artifactId>
    <packaging>war</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>SmartCompus Maven Webapp</name>
    <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <spring.version>4.2.5.RELEASE</spring.version>
        <mybatis.version>3.2.8</mybatis.version>
        <slf4j.version>1.7.18</slf4j.version>
        <log4j.version>2.5</log4j.version>
        <mysql.driver.version>5.1.21</mysql.driver.version>
        <commons-fileupload.version>1.3</commons-fileupload.version>
        <servlet.version>3.1.0</servlet.version>
        <spring-mybatis.version>1.2.2</spring-mybatis.version>
        <fastjson.version>1.1.41</fastjson.version>
        <jackson.version>2.3.0</jackson.version>
        <quartz.versison>1.8.5</quartz.versison>
        <httpclient.version>3.1</httpclient.version>
        <jstl.version>1.2</jstl.version>
        <shiro.version>1.2.3</shiro.version>
        <lombok.version>1.16.18</lombok.version>
        <json.version>2.4</json.version>
        <poi.version>3.14</poi.version>
        <gexin.http.version>4.0.1.17</gexin.http.version>
        <maven.pluin.version>2.5.2</maven.pluin.version>
    </properties>

    <dependencies>
        <!--servlet-->
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>javax.servlet-api</artifactId>
            <version>${servlet.version}</version>
        </dependency>
        <!--spring-->
        <!--核心-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-core</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <!--dao-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-tx</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <!--web-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-web</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${spring.version}</version>
        </dependency>
        <!--test-->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-test</artifactId>
            <version>${spring.version}</version>
        </dependency>


        <!--mybatis-->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis</artifactId>
            <version>${mybatis.version}</version>
        </dependency>
        <!-- 添加mybatis/spring整合包依赖 -->
        <dependency>
            <groupId>org.mybatis</groupId>
            <artifactId>mybatis-spring</artifactId>
            <version>${spring-mybatis.version}</version>
        </dependency>

        <!-- jdbc driver -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>${mysql.driver.version}</version>
            <scope>runtime</scope>
        </dependency>

        <!--log4j-->
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-api</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-core</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
            <groupId>org.apache.logging.log4j</groupId>
            <artifactId>log4j-web</artifactId>
            <version>${log4j.version}</version>
        </dependency>
        <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
        </dependency>
        <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
        </dependency>

        <!--alibaba Json-->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>${fastjson.version}</version>
        </dependency>

        <!--jackson Json-->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson.version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson.version}</version>
        </dependency>

        <!--quartz-->
        <dependency>
            <groupId>org.quartz-scheduler</groupId>
            <artifactId>quartz</artifactId>
            <version>${quartz.versison}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/commons-httpclient/commons-httpclient -->
        <dependency>
            <groupId>commons-httpclient</groupId>
            <artifactId>commons-httpclient</artifactId>
            <version>${httpclient.version}</version>
        </dependency>

        <!-- 添加jstl依赖 -->
        <dependency>
            <groupId>jstl</groupId>
            <artifactId>jstl</artifactId>
            <version>${jstl.version}</version>
        </dependency>

        <!-- shiro -->
        <dependency>
            <groupId>org.apache.shiro</groupId>
            <artifactId>shiro-all</artifactId>
            <version>${shiro.version}</version>
        </dependency>
        <!--lombok-->
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${lombok.version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/net.sf.json-lib/json-lib -->
        <!--必须添加jdk1,否则编译不通过》-->
        <dependency>
            <groupId>net.sf.json-lib</groupId>
            <artifactId>json-lib</artifactId>
            <version>${json.version}</version>
            <classifier>jdk15</classifier>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>${poi.version}</version>
        </dependency>
        <!--gexin-->
        <dependency>
            <groupId>com.gexin.platform</groupId>
            <artifactId>gexin-rp-sdk-http</artifactId>
            <version>${gexin.http.version}</version>
        </dependency>
        <!--maven.plugins-->
        <dependency>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-release-plugin</artifactId>
            <version>${maven.pluin.version}</version>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>getui-nexus</id>
            <url>http://mvn.gt.igexin.com/nexus/content/repositories/releases/</url>
        </repository>
    </repositories>

    <build>
        <finalName>SmartCompus</finalName>
        <plugins>
            <plugin>
                <groupId>org.mybatis.generator</groupId>
                <artifactId>mybatis-generator-maven-plugin</artifactId>
                <version>1.3.1</version>
                <configuration>
                    <verbose>true</verbose>
                    <overwrite>true</overwrite>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
            <resource>
                <directory>src/main/java</directory>
                <includes>
                    <include>**/*.xml</include>
                </includes>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
</project>

下面是控制的日志

 Connected to server
[2018-07-02 06:46:01,281] Artifact SmartCompus:war exploded: Artifact is being deployed, please wait...
Jul 02, 2018 6:46:01 PM org.apache.catalina.loader.WebappClassLoaderBase validateJarFile
信息: validateJarFile(/Users/albert/Workspace/IDEA/SmartCompus/target/SmartCompus/WEB-INF/lib/javax.servlet-api-3.1.0.jar) - jar not loaded. See Servlet Spec 3.0, section 10.7.2. Offending class: javax/servlet/Servlet.class
Jul 02, 2018 6:46:06 PM 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.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/albert/Workspace/IDEA/SmartCompus/target/SmartCompus/WEB-INF/lib/slf4j-jdk14-1.5.6.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/albert/Workspace/IDEA/SmartCompus/target/SmartCompus/WEB-INF/lib/slf4j-log4j12-1.7.18.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/albert/Workspace/IDEA/SmartCompus/target/SmartCompus/WEB-INF/lib/slf4j-nop-1.5.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: The requested version 1.5.6 by your slf4j binding is not compatible with [1.6]
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
Jul 02, 2018 6:46:07 PM org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
Jul 02, 2018 6:46:07 PM org.apache.catalina.core.StandardContext startInternal
严重: Context [] startup failed due to previous errors
[2018-07-02 06:46:07,299] Artifact SmartCompus:war exploded: Error during artifact deployment. See server log for details.
Jul 02, 2018 6:46:11 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory /usr/local/apache-tomcat-7.0.88/webapps/manager
Jul 02, 2018 6:46:11 PM 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.
Jul 02, 2018 6:46:11 PM org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory /usr/local/apache-tomcat-7.0.88/webapps/manager has finished in 271 ms

5个回答

如果使用的tomcat发布的。看tomcat里面的项目的lib包里面是不是有jar包冲突,或者缺少jar包

qq_36325121
爱折腾的Albert lib下面的log4j的jar 有,在IDEA里面看了没有jar的冲突
大约一年之前 回复

看一下是不是引入的包有问题,有没有版本冲突。

qq_36325121
爱折腾的Albert 回复qq_38499202: 上传了 maven的依赖。麻烦看下哪里有问题?
大约一年之前 回复
gf0515
Fatal Error 版本号都一致吗?mvn dependency:tree查看依赖树,看看是否有重复依赖
大约一年之前 回复
qq_28691483
qq_28691483 如果使用的tomcat发布的。看tomcat里面的项目的lib包里面是不是有jar包冲突,或者缺少jar包
大约一年之前 回复
qq_38499202
qq_38499202 应该是包有问题
大约一年之前 回复
weixin_42591864
weixin_42591864 回复qq_36325121: 可以的
大约一年之前 回复
weixin_42591864
weixin_42591864 11111111111
大约一年之前 回复
qq_36325121
爱折腾的Albert 回复gf0515: 有三个 log4j-api ,log4j-core,log4j-web
大约一年之前 回复
qq_42591802
qq_42591802 222
大约一年之前 回复
gf0515
Fatal Error IDEA 项目的External Libraries 下面只有2.5一个版本吗?看看有没有其他的版本也被依赖进来了
大约一年之前 回复
sys5923812
sys5923812 包要是引用正确,是不是发布的问题
大约一年之前 回复
qq_36325121
爱折腾的Albert 怎么看版本冲突,我用的是IDEA工具 maven 的依赖 log4j的版本是2.5,可不可能是版本的问题?
大约一年之前 回复

包冲突,如果是maven工程,可以用mvn dependency:tree查看,不是的话,就要复制一份筛查

明显就是包的不对。如果包没引入,那应该报类找不到的错误,而不是方法找不到错误。

qq_36325121
爱折腾的Albert 回复xinnian468153: 我想用的就是log4j2
大约一年之前 回复
xinnian468153
迷路的公民 回复qq_36325121: log4j和slf4j版本可能有冲突,把log4j换成1.2.17,试试。
大约一年之前 回复
qq_36325121
爱折腾的Albert 上面是maven的依赖,麻烦看下哪里有问题?谢谢了
大约一年之前 回复

缺少jar包 maven项目引入依赖
org.slf4j
slf4j-log4j12
1.7.6

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Spring Boot启动报错找不到Log4j2的实现
Spring Boot启动报错 1. 找不到Log4j2的实现 ERROR StatusLogger Log4j2 could not find a logging implementation ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classp...
Log4j2 demo (log4j2 version 2.1)
使用log4j2 version2.1写的Demo工程,可以用来了解log4j2的使用
启动报错
Traceback (most recent call last):rn File "python27.py", line 95, in rn File "proxy.py", line 1584, in rn common = Common()rn File "proxy.py", line 1434, in __init__rn self.HOSTS_MAP = collections.OrderedDict((k, v or k) for k, v in self.CONFIGrn.items(hosts_section) if '\\' not in k and ':' not in k and not k.startswith('.'rn))rn File "C:\Users\yuank\Desktop\goagent-goagent-bcc275b\local\python27.zip\ConfigrnParser.py", line 642, in itemsrnConfigParser.NoSectionError: No section: 'google_hk/hosts'rnException KeyError: KeyError(31558512,) in ignoredrnrn求有经验的帮忙找下 哪里出了问题呀??
WAS启动报错
我使用的是IBM的RAD开发,RAD刚装完,空起WAS报错,求大神指导:rn报错内容:rnAccess is denied.rnADMU0116I: ???? C:\Programrn Files\IBM\SDP\runtimes\base_v61\profiles\was61profile1\logs\server1\startServer.logrn ???????rnADMU0128I: ?????? was61profile1 ???????rnADMU3100I: ???????????server1rnADMU0113E: ????rn com.ibm.websphere.management.exception.AdminException:rn com.ibm.ws.management.launcher.ServerIdentifiers@57d857d8?????????????C:\Programrn Files\IBM\SDP\runtimes\base_v61\profiles\was61profile1\config\cells\SHNDTPDL0893Node01Cell\nodes\SHNDTPDL0893Node01\serverindex.xmlrn (Access is denied.)rnADMU1211I: ????????????? -trace ???rnADMU0211I: ??? C:\Programrn Files\IBM\SDP\runtimes\base_v61\profiles\was61profile1\logs\server1\startServer.logrn ???????????rn
启动报错,,,,
23/03/2016 11:08:27:637 INFO - 56D6B120756B922AC6BE2D10E8536B2E:/hnaircommunicationT : SCESession bound to HttpSession 56D6B120756B922AC6BE2D10E8536B2Ern2016-3-23 11:08:27 org.apache.catalina.core.StandardWrapperValve invokern严重: Servlet.service() for servlet Start threw exceptionrnjava.lang.ClassNotFoundException: org.osgi.framework.BundleActivatorrn at java.net.URLClassLoader$1.run(URLClassLoader.java:202)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:190)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:307)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:248)rn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:616)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)rn at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)rn at java.net.URLClassLoader.access$000(URLClassLoader.java:58)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:197)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:190)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:307)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:248)rn at com.avaya.vp.applog.client.VPAppLogClientBase.debug(VPAppLogClientBase.java:44)rn at com.avaya.vp.applog.client.VPAppLogClientBase.getAxis2PrimaryUrl(VPAppLogClientBase.java:366)rn at com.avaya.vp.applog.client.VPAppLogClientBase.getAxis2Url(VPAppLogClientBase.java:334)rn at com.avaya.vp.applog.client.VPAppLogClientBase.getAxis2AppLogServiceUrl(VPAppLogClientBase.java:311)rn at com.avaya.vp.applog.client.VPAppLogClientBase.getReportUrl(VPAppLogClientBase.java:284)rn at com.avaya.vp.applog.client.ReportWriter.setReportUrl(ReportWriter.java:397)rn at com.avaya.vp.applog.client.ReportWriter.getParametersValue(ReportWriter.java:584)rn at com.avaya.vp.applog.client.ReportWriter.(ReportWriter.java:68)rn at com.avaya.runtimecommon.platforms.vp.tracking.ReportWriter.(ReportWriter.java:32)rn at com.avaya.runtimecommon.platforms.vp.Toolkit.createReportOutput(Toolkit.java:28)rn at com.avaya.sce.runtimecommon.SCESession.getReportOutput(SCESession.java:1856)rn at com.avaya.sce.runtimecommon.SCESession.getSession(SCESession.java:517)rn at com.avaya.sce.runtimecommon.SCESession.getSession(SCESession.java:591)rn at com.avaya.sce.runtime.SCEServlet.requestHandler(SCEServlet.java:198)rn at com.avaya.sce.runtime.SCEServlet.doGet(SCEServlet.java:181)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)rn at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)rn at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)rn at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)rn at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)rn at java.lang.Thread.run(Thread.java:662)rn23/03/2016 11:08:27:764 DEBUG - [VOX] ICConnectorCommon.ChangeConnectionState: VOX() connection is now downrn23/03/2016 11:08:27:770 DEBUG - [VOX] ICConnectorServer.WaitForConnection: Ready to accept VOX connection at port 3000rn
Log4j2手册阅读随笔(Log4j2新特性)
NULL 博文链接:https://ihenu.iteye.com/blog/2318087
log4j2所需jar包和log4j2的详细配置
log4j2的详细配置和所需jar包
Log4j2学习
Log4j2学习笔记,引入log4j2的依赖-log4j2.xml配置模板-application.properties文件配置-使用
log4j2的配置
文章目录log4j2的配置,不同级别日志保存在不同文件夹(基于Springboot)1.前言汇总2.log4j2.xml的实际配置 log4j2的配置,不同级别日志保存在不同文件夹(基于Springboot) 1.前言汇总 目的是想按照按照规定的格式打印在控制台,以及以文件的形式保存下来,并且按照日志的级别,保存为不同的log文件. 首先你得搭建一个简单的springboot项目,这个就直接在...
log4j2学习
log4j2日志如何配置,如何集成到spring
log4j2的配置使用
主要介绍log4j2在maven项目中的应用
log4j2配置
log4j2的配置
log4j2 高性能
原创: http://www.imet.me/post/2018/07-18_log4j2_high_performance/ 开篇词 log4j2 日志性能在某些场景下要优于 logback 等其他日志组件,带来了非常大的性能提升,究竟有多大呢? 这几个新的特性如下: Asynchronous Loggers based on the [LMAX Disruptor library] Garb...
Log4j2简单使用
Log4j 2 包含了基于LMAX 分离库的下一代的异步日志系统,在多线程环境下,异步日志系统比 Log4j 1.x 和Logback 提高了10倍性能提升(吞吐量和延迟率 )。 日志的级别 log4j规定了默认的几个级别:trace &lt; debug &lt; info &lt; warn &lt; error &lt; fatal。这里要说明一下: ...
log4j2 日志配置
1. 导入JAR org.apache.logging.log4j log4j-api 2.4.1 org.apache.logging.log4j log4j-core 2.4.1 2.Java使用 import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.
Log4j2的配置
log4j 2.0使用非常简单,只要用LogManager的getLogger函数获取一个logger,就可以使用logger记录日志,代码如下:
Log4j2配置文件记录hibernate
我本来问题是想要用log4j2去记录hibernate,原来用的log4j也没什么问题 突然就提示我要用log4j2了,用了各种关键词去百度,结果出来的教程也不知道是谁写的,有错误,结果来回转载,每一个对的。 弄了半天总结一下: 1. 首先log4j 2.x版本不再支持像1.x中的.properties后缀的文件配置方式,2.x版本配置文件后缀名只能为”.xml”,”.json”或者”.jsn
log4j2笔记
&amp;lt;!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-api --&amp;gt; &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.apache.logging.log4j&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;log4j-api&amp;lt;/...
log4j2示例
log4j2.xml 示例 &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt; &amp;lt;configuration status=&quot;error&quot;&amp;gt; &amp;lt;!--先定义所有的appender--&amp;gt; &amp;lt;appenders&amp;gt; &amp;lt;!--这个输出控制台的配置--&amp;
log4j2使用
log4j2
log4j2简单的Demo/ log4j2简单的应用
一, 在pom.xml上添加引用 添加到dependencies节点上 &amp;lt;!-- https://mvnrepository.com/artifact/org.apache.logging.log4j/log4j-core --&amp;gt; &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.apache.logging.log4j&amp;lt;/groupId&amp;...
使用log4j2
除了要去掉不相关的bindings,要exclude掉一些dependency. 另外依赖加上: log4j-api &amp;gt;=2 版本 (如2.4.1) log4j-core &amp;gt;=2 版本 log4j-slf4j-impl &amp;gt;=2 版本 (因为很多应用用得还是slf4j日志接口,所以要桥接) 如果使用AsyncLogger,还要依赖com.lmax:disruptor(如3...
Log4j2使用
使用log4j 2基本只需导入两个jar包: log4j-core-xx.jar     log4j-api-xx.jar   log4j 2.0与以往的1.x有一个明显的不同,其配置文件只能采用.xml, .json或者 .jsn。在默认情况下,系统选择configuration文件的优先级如下:(classpath为scr文件夹) 1.classpath下名为 log4j-test...
Log4j2配置详解
一、背景 最近由于项目的需要,需要将日志全部迁移成log4j2版本,之前对于项目日志的配置总是似懂非懂,最近详细整理了下知识点,本文就作为一个记录来详细记录一下log4j2配置的相关知识点。 二、配置详解 ...
log4j2的简单使用
log4j2的官网地址:https://logging.apache.org/log4j/2.x/log4j2的性能比log4j更好,具体优点很多,高并发下性能更好啊,不会发生死锁的情况。SpringBoot使用log4j2需添加如下依赖:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spri
log4j2 辅助类
package com.oas.util; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class Log4jUtil { static Logger log = LogManager.getLogger(Log4jUtil.class); ...
log4j2小试
pom.xml加好,src/main/resources/下新增log4j2.xml。LogManager获取logger,然后就可以debug、info、warn、error了。 log4j2.xml &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt; &amp;lt;Configuration status=&quot;WARN&quot; monitorInterval=&quot;3...
Log4j2 demo
NULL 博文链接:https://ping2010.iteye.com/blog/2017919
Log4j2使用教程
NULL 博文链接:https://bijian1013.iteye.com/blog/2307338
Log4J2基本配置
Log4j2环境搭建 1.去官方下载log4j,导入jar包 log4j-core-xx.jar log4j-api-xx.jar 2.开始使用: 如果要在某个类下使用log4j做日志记录(强烈建议使用slfj的API,不要使用其他日志的系统API): private static Logger logger = LogManager.getLogger(MyApp.class.ge...
Log4j2记录日志
1:导入依赖 &amp;lt;dependency&amp;gt; &amp;lt;groupId&amp;gt;org.apache.logging.log4j&amp;lt;/groupId&amp;gt; &amp;lt;artifactId&amp;gt;log4j-core&amp;lt;/artifactId&amp;gt; &amp;lt;version&amp;gt;2.11.1&amp;lt;/version&amp;gt; &amp;lt;/dependency&amp;gt;
Log4j2配置
log4j2.xml <RollingRandomAccessFile name="RollingFileInfo" fileName="${web:rootDir}/logs/info.log" filePattern="${we
log4j2的使用
它不需要在项目中做任何配置,只需要将它的xml文件放到项目中<?xml version="1.0" encoding="UTF-8"?> <!-- 日志级别从低到高分为TRACE < DEBUG < INFO < WARN < ERROR < FATAL,如果设置为WARN,则低于WARN的信息都不会输出 --> <!-- %d{HH:mm:ss.SSS} 表示输出到毫秒的时间 %t 输出
Log4j2相关
web.xml &amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&amp;gt; &amp;lt;web-app xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns=&quot;http://java.sun.com/xml/ns/javaee&quot; xsi:schemaLocation=&quot;
log4j2 的应用
log4j2 的应用
Log4j2使用手册
参照这份官方使用文档可以很方便的配置Log4j,其中包含了1.x->2.x的主要内容
log4j2 -2.11.1.zip
log4j2-2.11.1版本下载。包含log4j-api-2.11.1.jar和log4j-core-2.11.1.jar两个文件
log4j2配置文件
log4j2配置,文件分割,自动清除等相关配置。
log4j2日志配置
 log4j2相对于log4j 1.x有了脱胎换骨的变化,其官网宣称的优势有多线程下10几倍于log4j 1.x和logback的高吞吐量、可配置的审计型日志、基于插件架构的各种灵活配置等。 官方配置文档:http://logging.apache.org/log4j/2.x/manual/configuration.html 1、所需jar &lt;dependencies&gt; ...
log4j2配置详解
本文只是对log4j的配置文件做一个解释我是在maven 项目中使用的,先引入jar如下 <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-api</artifactId> <version>2.1</version> </dependency> <dependency>
相关热词 c#入门推荐书 c# 解码海康数据流 c# xml的遍历循环 c# 取 查看源码没有的 c#解决高并发 委托 c#日期转化为字符串 c# 显示问号 c# 字典对象池 c#5.0 安装程序 c# 分页算法