1 Reply Latest reply on Jan 10, 2018 3:50 PM by James Perkins

    Error Status Logger

    José Antonio Delgado Trujillo Newbie

      Today i found the next error in the console of wildly (standalone.sh) when i deploy struts2 project without log4j2. In the browser it seems to run correctly but the console complain about the logger.

       

      ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...

       

      If i added log4j-core as dependency in the POM

       

      ERROR [stderr] (default task-2) 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.

       

      And if i added a log4j2.xml

      <?xml version="1.0" encoding="UTF-8"?>
      <Configuration>
         <Appenders>
         <Console name="STDOUT" target="SYSTEM_OUT">
         <PatternLayout pattern="%d %-5p [%t] %C{2} (%F:%L) - %m%n"/>
         </Console>
         </Appenders>
         <Loggers>
         <Logger name="com.opensymphony.xwork2" level="debug"/>
         <Logger name="org.apache.struts2" level="debug"/>
         <Root level="warn">
         <AppenderRef ref="STDOUT"/>
         </Root>
         </Loggers>
      </Configuration>

       

      Then a NotFoundClassError

      18:19:21,609 ERROR [io.undertow.request] (default task-3) UT005023: Exception handling request to /login-struts/index.action: java.lang.NoClassDefFoundError: org/apache/logging/log4j/util/MultiFormatStringBuilderFormattable

        at org.apache.logging.log4j.core.pattern.MessagePatternConverter.format(MessagePatternConverter.java:120)

        at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:38)

        at org.apache.logging.log4j.core.layout.PatternLayout$PatternSerializer.toSerializable(PatternLayout.java:334)

        at org.apache.logging.log4j.core.layout.PatternLayout.toText(PatternLayout.java:233)

        at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:218)

        at org.apache.logging.log4j.core.layout.PatternLayout.encode(PatternLayout.java:58)

        at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.directEncodeEvent(AbstractOutputStreamAppender.java:177)

        at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.tryAppend(AbstractOutputStreamAppender.java:170)

        at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:161)

        at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:156)

        at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:129)

        at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:120)

        at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:84)

        at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:448)

        at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:433)

        at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:417)

        at org.apache.logging.log4j.core.config.LoggerConfig.logParent(LoggerConfig.java:439)

        at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:434)

        at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:417)

        at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:403)

        at org.apache.logging.log4j.core.config.AwaitCompletionReliabilityStrategy.log(AwaitCompletionReliabilityStrategy.java:63)

        at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:146)

        at org.apache.logging.log4j.spi.AbstractLogger.tryLogMessage(AbstractLogger.java:2116)

        at org.apache.logging.log4j.spi.AbstractLogger.logMessageSafely(AbstractLogger.java:2100)

        at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1994)

        at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1966)

        at org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:739)

        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:508)

        at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:73)

        at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:61)

        at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:111)

        at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:84)

        at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:97)

        at io.undertow.servlet.core.ManagedFilter.createFilter(ManagedFilter.java:80)

        at io.undertow.servlet.core.ManagedFilter.getFilter(ManagedFilter.java:66)

        at io.undertow.servlet.core.ManagedFilter.doFilter(ManagedFilter.java:61)

        at io.undertow.servlet.handlers.FilterHandler$FilterChainImpl.doFilter(FilterHandler.java:131)

        at io.undertow.servlet.handlers.FilterHandler.handleRequest(FilterHandler.java:84)

        at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)

        at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)

        at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)

        at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)

        at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)

        at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)

        at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)

        at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)

        at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)

        at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)

        at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)

        at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)

        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)

        at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)

        at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)

        at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)

        at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

        at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1508)

        at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)

        at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)

        at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)

        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:326)

        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:812)

        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)

       

       

      Yesterday it runs without the log4j2

      What does it happen? How can i fix it?