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

0

5个回答

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

1
qq_36325121
爱折腾的Albert lib下面的log4j的jar 有,在IDEA里面看了没有jar的冲突
12 个月之前 回复

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

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

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

0

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

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

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

0
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,tomcat--7.0.16 启动就OOM,蛋疼的问题
升级log4j2 ,官网说要web.xml里的 version 属性改成3.0,发现改了之后,一起动就报错OOM, Exception in thread "main"  Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main" 发现改成2.5就没
elasticsearch JAVA工程报错log4j2错误问题解决
添加JAR包引用 &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.9.1&amp;lt;/version&amp;gt; &amp;lt;/dependency
log4j2异步配置
官方建议一般程序员查看的日志改成异步方式,一些运营日志改成同步。日志异步输出的好处在于,使用单独的进程来执行日志打印的功能,可以提高日志执行效率,减少日志功能对正常业务的影响。异步日志在程序的classpath需要加载disruptor-3.0.0.jar或者更高的版本。 dependency> groupId>com.lmaxgroupId>
在web应用中使用Log4j 2
Using Log4j 2 inWeb Applications(在web应用中使用Log4j 2) 来源:http://logging.apache.org/log4j/2.x/manual/webapp.html在JavaEE环境中使用log4j或者其它任何日志框架时,需要特别小心。当容器关闭或者应用程序卸载时日志资源的正常清除(数据库连接、文件流关闭等)是很重要的。由于web应用程序中类的加
如何将tomcat8的运行日志框架切换到log4j2
很多项目都使用log4j作为日志框架,但是tomcat默认的框架不是log4j的,打印出来的日志也不会保存到项目指定的地方,而对于那些系统运行过程中出现的异常信息,我们是需要监控的,所以我们会希望tomcat和项目的日志放到一个地方,这时我们就需要修改tomcat默认的日志框架。tomcat官网上面有相关日志框架切换的文档,https://tomcat.apache.org/tomcat-8.0-d
应用无法启动,并且不报错的总结log4j的问题
应用启动不起来,并且不报错。没有任何征兆与线索。经过排查,是log4j的问题,log4j配置如下。log4j.rootLogger = INFO,console,logstashlog4j.logger.com.atc=INFOlog4j.appender.console=org.apache.log4j.ConsoleAppenderlog4j.appender.console.target=S...
关于es启动的相关报错
es的版本:5.4.0 之前,我在测试服务器上,安装启动es的时候,出现的报错,因为服务器等各种环境因素不同,所遇到的报错也不相同。这次只遇到下面这两个: ========================== 1、max virtual memory areas vm.max_map_count [65530] is too low, increase to at least [262144
消灭windows2003或windows2kserver的系统启动报错
消灭windows2003或windows2kserver的系统启动报错消灭windows2003或windows2kserver的系统启动报错消灭windows2003或windows2kserver的系统启动报错
log4j报找不到文件的异常
log4j报找不到文件的异常 log4j:ERROR setFile(null,true) call failed. java.io.FileNotFoundException: 新增配置: -Dpafa.log.home=D:\XXXX\Desktop
eclipse报错 eclipse启动报错解决方法
eclipse报错 eclipse启动报错解决方法 eclipse报错 eclipse启动报错解决方法
ES启动常见错误
转载地址:https://blog.csdn.net/u013083576/article/details/78499884 1、unable to install syscall filter:Java.lang.UnsupportedOperationException:seccomp unavailable: requires kernel 3.5+ with CONFIG_SECCOMP...
slf4j+log4j2在tomcat8 下无日志输出
http://blog.mugbya.cn/2014/10/25/slf4j-tomcat/  在写这个问题之前,先声明,这个问题肯定不是大家都能遇到,只是特性条件会出现这个情况,因了解还不是太深入,目前只记录我了解的所有. 参见segmentfault上的问题描述   在问题的版本差异比较时,慢慢发现一些问题: // tomcat7 SLF4J: Found bind
log4j2-2.3
log4j2和log4j在配置文件上有较大的不同,备份一份log4j2
Log4j2 demo (log4j2 version 2.1)
使用log4j2 version2.1写的Demo工程,可以用来了解log4j2的使用
Log4j2 web demo (log4j2 version 2.1)
log4j2使用demo,web工程的,log4j2的版本为2.1
oralce10启动报错!
oralce10启动报错!
Log4j2学习
Log4j2学习笔记,引入log4j2的依赖-log4j2.xml配置模板-application.properties文件配置-使用
Log4j2写日志的艺术
Log4j2中的组件 从配置开始 API基本使用 小细节 写日志的原理 主要流程 同步写 异步写 顺便说一下ArrayBlockingQueue notFull 与 notEmpty 异步写是怎么玩的 巧妙的异步写设计 ByteBuffer与RandomAccessFile Garbage-free避免创建多余对象 异步Logger 性能 写在最后 在程序的世界里,抽象让人像是雾里看花。抽象让程
Log4j_2_配置参数详解
Log4j中有三个主要的组件,它们分别是 Logger、Appender和Layout,Log4j 允许开发人员定义多个Logger,每个Logger拥有自己的名字,Logger之间通过名字来表明隶属关系。有一个Logger称为Root,它永远 存在,且不能通过名字检索或引用,可以通过Logger.getRootLogger()方法获得,其它Logger通过 Logger.getLogger(
log4j2.x架构分析与实战
java 日志系统历史及比较,重点说明log4j2.x架构分析与实战
log4j2配置属性详解
(1)根节点Configuration有两个属性:status和monitorinterval,有两个子节点:Appenders和Loggers(表明可以定义多个Appender和Logger).       status用来指定log4j本身的打印日志的级别.     monitorinterval用于指定log4j自动重新配置的监测间隔时间,单位是s,最小是5s.(如果更改配置文件,不...
Log4j2 进阶使用
在我前一篇文章Log4j2 简单使用中介绍了一些Log4j2的简单使用方法。下面来做一些进阶介绍。使用属性在复杂的项目中,可能有一些约定的属性比如项目名称、配置文件路径等等。这些属性可能会在多个日志的配置中用到。这样就可以将这些属性配置到Log4j2的配置文件中,方便在多个Logger中共享。定义属性需要在配置文件中添加properties节点,然后添加多个property。配置完成之后使用${pr
log4j2配置文件 网上很多自己总结一下
1   导入依赖包使用maven管理 &amp;lt;properties&amp;gt;        &amp;lt;project.build.sourceEncoding&amp;gt;UTF-8&amp;lt;/project.build.sourceEncoding&amp;gt;        &amp;lt;!-- &amp;lt;project.build.jdkVersion&amp;gt;1.7&amp;lt;/project.build.jdkVers...
ORACLE启动报错常见问题解决
ORACLE启动报错常见问题解决
LOG4J2 使用示例
pom: 1.7.10 2.3 3.3.4 org.slf4j slf4j-api ${slf4j.version} org.slf4j jcl-over-slf4j
Log4j2的性能为什么这么好?
**原创:詹嵩 某公司架构部中间件架构师 校对:程超 某公司架构部中间件负责人** 一、logback和log4j2压测比较 1、logback压测数据 logback压测数据,50个线程,500万条日志写入时间。 logback:messageSize = 5000000,threadSize = 50,costTime = 27383ms logback:...
Log4j2+Slf4j快速入门
前言         本文目的在于让RD快速掌握Log4j2+Slf4j在Java Web项目中的使用。         注意:该方法对Servlet3.0+适用,Servlet2.5以前的版本还需额外的步骤,详见:Servlet-2.5。 Maven依赖     org.apache.logging.log4j     l
Log4j2的配置及使用方式
log4j2的配置及使用
Log4j2配置及与Logback对比
Log4j2 使用和配置   一、Maven配置 1、与SpringBoot集成 &amp;lt;!-- ====================log related --&amp;gt;   &amp;lt;dependency&amp;gt; &amp;lt;!-- exclude掉spring-boot的默认log配置 --&amp;gt;       &amp;lt;groupId&amp;gt;org.springf...
Log4j2-Log4j 2介绍及使用
Log4j 2 官网https://logging.apache.org/log4j/2.x/Log4j 2简介Log4j的1.x版本已经被广泛使用于很多应用程序中。然而,它这些年的发展已经放缓。它变得越来越难以维护,因为它需要严格遵循很老的Java版本,并在2015年8月寿终正寝。它的替代品,SLF4J和Logback对框架做了很多必要的改进。那么为什么还要费心去做Log4j 2呢?几个原因如下:
log4j2 支持彩色日志
基本的log4j2配置见上节。1、彩色配置PatternLayout pattern="%highlight{[ %p ] [%-d{yyyy-MM-dd HH:mm:ss}] [ LOGID:%X{logid} ] [%l] %m%n}"/>加上%highlight {}。2、输出
Log4j日志配置详解(Log4j2)
Log4j日志配置详解 一、Log4j升级Log4j2 首先来说一下日志升级,log4j配置的变化,配置文件从log4j.xml变成了log4j2.xml,配置文件的内容也有很大不同,log file现在可以同时支持时间和文件大小分割。而且log4j2支持log的动态变化加载,直接指定监控周期就可。下面给出一个简单配置例子。 例子中使用了async模式,rollfile本身必须设置成immed...
Log4j2与Slf4j的最佳实践
前言日志对于项目的重要性不言而喻,现在市面上的日志框架多种多样:Log4j、Log4j2、Slf4j、JDKLog、Logback等等,如果没有真正深入了解过,可能会被搞得眼花缭乱。本文将介绍目前Java项目中最常见的Log4j2 + Slf4j的使用组合,这也是我自己项目中目前使用的。另外,由于现在项目基本都是Servlet 3.0及以上版本,因此本文针对Servlet 3.0及更高的版本,如果...
log4j2性能分析+原理
官方解释: Log4j 2包含基于LMAX Disruptor库的下一代异步记录器。在多线程场景中,异步记录器的吞吐量比Log4j 1.x和Logback高18倍,延迟低。有关详细信息,请参阅异步日志记录性能否则,Log4j 2明显优于Log4j 1.x,Logback和java.util.logging,尤其是在多线程应用程序中 LMAX Disruptor技术。异步记录器在内部使用Di...
log4j2使用总结
一、Log4j有三个主要的组件:Loggers,Appenders和Layouts,这里可简单理解为日志级别,日志要输出的地方和日志格式1、 LoggerLogger的日志级别有6级,分别是TRACE<DEBUG 2、 appender常用的输出有控制台、文件、数据库等 二、Log4j2配置 1、web.xml配置文件  XML Code  1 2
Log4j2架构分析与实战
Log4j2是Log4j的升级版,与之前的版本Log4j 1.x相比、有重大的改进,在修正了Logback固有的架构问题的同时,改进了许多Logback所具有的功能。
Log4j2 日志级别
Log4j2日志级别级别        在log4j2中, 共有8个级别,按照从低到高为:ALL &amp;lt; TRACE &amp;lt; DEBUG &amp;lt; INFO &amp;lt; WARN &amp;lt; ERROR &amp;lt; FATAL &amp;lt; OFF。                                     All:最低等级的,用于打开所有日志记录.                    ...
log4j2的MDC应用配置
MDC的概念:Manufacturing Data Collection 生产数据实时采集和分析。 有时实际开发过程没有发现的BUG在生产环境才出现,需要到生产环境去分析实时日志来进行BUG跟踪;LOG4J2提供了MDC功能可以将特定用户的日志单独处理输出到特定的文件中。 配置关键字ThreadContext  ,DynamicThresholdFilter  ,ThreadCon
log4j2 输出中文乱码
顺便记录:jedis工具类最新版必须 搭配5.0以上的spring版本,而5.0以上spring版本淘汰了log4j1.x版本的日志框架监听类,推荐使用log4j2,被迫更改成log4j2后运行出现乱码,查了很久,网上推荐在xml配置文件的输出配置的pattern前添加字符集 &amp;lt;PatternLayout charset=&quot;UTF-8&quot; pattern=&quot;${log_pattern}...
文章热词 机器学习教程 Objective-C培训 交互设计视频教程 颜色模型 设计制作学习
相关热词 mysql关联查询两次本表 native底部 react extjs glyph 图标 怎么学习互联网大数据 村干部学习大数据心得