Main error null object returned for rollingfile in appenders

Type: Bug

  • Type:


    Bug

  • Status:

    Closed


  • Priority:


    Major

  • Resolution:

    Fixed


  • Affects Version/s:



    2.8.2


  • Component/s:



    Core

The initial log4j2.xml file was

<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="INFO" monitorInterval="60">
    <Properties>
        <Property name="LOG_HOME">./logs</Property>
    </Properties>

    <Appenders>
        <RollingFile
            name="RollingFileAppender"
            fileName="${LOG_HOME}/log.log"
            filePattern="${LOG_HOME}/log.log.%d{yyyy-MM-dd}.%i">
            <ThresholdFilter level="INFO" onMatch="ACCEPT" onMismatch="DENY"/>
            <PatternLayout pattern="%d{DEFAULT} %p %t %c %L: %m%n"/>
            <Policies>
                <OnStartupTriggeringPolicy/>
                <!--<TimeBasedTriggeringPolicy/>-->
                <SizeBasedTriggeringPolicy size="256MB"/>
            </Policies>
            <DefaultRolloverStrategy max="8"/>
        </RollingFile>
    </Appenders>

    <Loggers>
        <Root level="INFO">
            <AppenderRef ref="RollingFileAppender"/>
        </Root>
    </Loggers>
</Configuration>

And then I changed filePattern to

filePattern="${LOG_HOME}/log.log.%i"

Log file names still contain date.

duplicates

Bug - A problem which impairs or prevents the functions of the product.

LOG4J2-1725
RollingFileAppender’s filePattern not reloaded when using monitorInterval

  • Major - Major loss of function.
  • Closed
is related to

Bug - A problem which impairs or prevents the functions of the product.

LOG4J2-2766
TimeBasedTriggeringPolicy of RollingRandomAccessFile is not updated instantly

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Closed
relates to

Bug - A problem which impairs or prevents the functions of the product.

LOG4J2-2009
Rolling appender managers broken on pattern/policy reconfiguration

  • Major - Major loss of function.
  • Resolved

Thread Status:

Not open for further replies.
  1. I get an error starting my server, I am the computer administrator and have full permissions and I am getting this error spammed in the console, please help

    C:UsersUsernameDesktopMinecraftServer>java -Xmx1024M -jar craftbukkit.j
    ar -o true
    Loading libraries, please wait…
    2013-12-15 15:26:53,031 ERROR Cannot access RandomAccessFile {}) java.io.FileNot
    FoundException: logslatest.log (Access is denied)
    2013-12-15 15:26:53,033 ERROR Unable to invoke method createAppender in class or
    g.apache.logging.log4j.core.appender.RollingRandomAccessFileAppender for element
    RollingRandomAccessFile java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.logging.log4j.core.config.BaseConfiguration.createPluginOb
    ject(BaseConfiguration.java:841)
    at org.apache.logging.log4j.core.config.BaseConfiguration.createConfigur
    ation(BaseConfiguration.java:595)
    at org.apache.logging.log4j.core.config.BaseConfiguration.createConfigur
    ation(BaseConfiguration.java:587)
    at org.apache.logging.log4j.core.config.BaseConfiguration.doConfigure(Ba
    seConfiguration.java:244)
    at org.apache.logging.log4j.core.config.BaseConfiguration.start(BaseConf
    iguration.java:142)
    at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerCo
    ntext.java:339)
    at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext
    .java:378)
    at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:
    149)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
    4jContextFactory.java:85)
    at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log
    4jContextFactory.java:34)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:387)
    at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:322)
    at net.minecraft.server.v1_7_R1.MinecraftServer.<clinit>(MinecraftServer
    .java:46)
    at org.bukkit.craftbukkit.Main.main(Main.java:153)
    Caused by: java.lang.IllegalStateException: Unable to create a manager
    at org.apache.logging.log4j.core.appender.AbstractManager.getManager(Abs
    tractManager.java:73)
    at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager
    (OutputStreamManager.java:65)
    at org.apache.logging.log4j.core.appender.rolling.RollingRandomAccessFil
    eManager.getRollingRandomAccessFileManager(RollingRandomAccessFileManager.java:6
    2)
    at org.apache.logging.log4j.core.appender.RollingRandomAccessFileAppende
    r.createAppender(RollingRandomAccessFileAppender.java:196)
    … 18 more

    2013-12-15 15:26:53,085 ERROR Null object returned for RollingRandomAccessFile i
    n Appenders

  2. Try a different build, i can’t think of anything else.

  3. Nope, I tried about 5 1.7 most recent bilds and the recconended build for 1.6.4 and they all show the same error spamming my console.

  4. Username does not have access to the location you are running your server in:

    2013-12-15 15:26:53,031 ERROR Cannot access RandomAccessFile {}) java.io.FileNot
    FoundException: logslatest.log (Access is denied)
  5. How can I give my username access?

  6. Better idea: Copy your server to your Documents

  7. Well i have the same problem but i get a random file named ‘Logs’. I have the same problem when i want to run an ‘.exe’ normal minecraft server. I hope you can help us.

  8. Thank you so much, it worked!

Thread Status:

Not open for further replies.

Share This Page


Bukkit Forums

After upgrading from Struts 2.3 to Struts 2.5 in a web application that uses the Struts 2 framework, when tomcat was started to debug with eclipse, the log 4j used in Struts 2.3 was versioned to log 4j 2. I got an error to upload.
Since eclipse is imported as a maven project, version upgrade to log4j2 was performed as follows.
1. Log4j library»log4j1.2.7.jar»is removed from pom.xml and log4j2 library»log4j-core2.7.jar»and»log4j-api2.7.jar»are added to pom.xml< br />
2. Change log4j.xml (* 1) to log4j2.xml (* 2)

After the above version upgrade, error (* 3) occurred when starting tomcat with eclipse.
I think log4j2.xml is OK, can you tell me about the cause of the error?

■ log4j.xml (* 1)

■ log4j2.xml (* 2)

■ Error (* 3)

log4j: WARN Continuable parsing error 3 and column 16
log4j: WARN The document root element "configuration" must match the DOCTYPE root "null".
log4j: WARN Continuable parsing error 3 and column 16
log4j: WARN Invalid document: syntax not found.
log4j: WARN The&lt;configuration&gt;element has been deprecated.
log4j: WARN Use the&lt;log4j: configuration&gt;element instead.
log4j: WARN Unrecognized element Appenders
log4j: WARN Unrecognized element Loggers
10 04, 2017 11:50:55 am org.apache.catalina.core.ApplicationContext log
Info: Initializing Spring root WebApplicationContext
log4j: WARN No appenders could be found for logger (org.springframework.web.context.ContextLoader).
log4j: WARN Please initialize the log4j system properly.
log4j: WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
2017-10-04 11: 50: 59,015 localhost-startStop-1 ERROR The parameter is null: policy2017-10-04 11: 50: 59,019 localhost-startStop-1 ERROR Unable to inject fields into builder class for plugin type class org.apache.logging.log4j.core.appender.RollingFileAppender, element RollingFile.org.apache.logging. log4j.core.config.ConfigurationException: Arguments given for element RollingFile are invalid
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.injectFields (PluginBuilder.java:198)
    at ...
    at java.lang.Thread.run (Thread.java:748)
2017-10-04 11: 50: 59,020 localhost-startStop-1 ERROR Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile.java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod (PluginBuilder.java:224)
    at ...
    at java.lang.Thread.run (Thread.java:748)
2017-10-04 11: 50: 59,021 localhost-startStop-1 ERROR The parameter is null: policy
2017-10-04 11: 50: 59,022 localhost-startStop-1 ERROR Unable to inject fields into builder class for plugin type class org.apache.logging.log4j.core.appender.RollingFileAppender, element RollingFile.org.apache.logging. log4j.core.config.ConfigurationException: Arguments given for element RollingFile are invalid
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.injectFields (PluginBuilder.java:198)
    at ...
    at java.lang.Thread.run (Thread.java:748)
2017-10-04 11: 50: 59,023 localhost-startStop-1 ERROR Unable to invoke factory method in class class org.apache.logging.log4j.core.appender.RollingFileAppender for element RollingFile.java.lang.IllegalStateException: No factory method found for class org.apache.logging.log4j.core.appender.RollingFileAppender
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.findFactoryMethod (PluginBuilder.java:224)
    at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build (PluginBuilder.java:130)
    at… at java.lang.Thread.run (Thread.java:748)
2017-10-04 11: 50: 59,103 localhost-startStop-1 ERROR Null object returned for RollingFile in Appenders.
2017-10-04 11: 50: 59,103 localhost-startStop-1 ERROR Null object returned for RollingFile in Appenders.
2017-10-04 11: 50: 59,110 localhost-startStop-1 ERROR Unable to locate appender "APP_LOG" for logger config "root"
2017-10-04 11: 50: 59,110 localhost-startStop-1 ERROR Unable to locate appender "ACCESS_LOG" for logger config "aaa.bbb.ccc.AccessLogInterceptor"
10 04, 2017 11:51:01 am org.apache.coyote.AbstractProtocol start
Information: Starting ProtocolHandler ["ajp-bio-8009"]
10 04, 2017 11:51:01 am org.apache.catalina.startup.Catalina start
Info: Server startup in 27375 ms

Понравилась статья? Поделить с друзьями:
  • Main device init error no description 2
  • Make fewer http requests как исправить вордпресс
  • Main decoder error failed to create audio output
  • Make exe error 126
  • Make error codes