logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joern Huxhorn (JIRA)" <j...@apache.org>
Subject [jira] [Reopened] (LOG4J2-139) NPE while using SocketAppender
Date Sun, 09 Jun 2013 14:59:19 GMT

     [ https://issues.apache.org/jira/browse/LOG4J2-139?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Joern Huxhorn reopened LOG4J2-139:
----------------------------------


beta7 introduced a regression that causes the following NPE in the absence of a protocol attribute:

2013-06-09 16:31:30,634 ERROR Unable to invoke method createAppender in class org.apache.logging.log4j.core.appender.SocketAppender
for element Socket java.lang.reflect.InvocationTargetException 
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) 
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
at java.lang.reflect.Method.invoke(Method.java:601) 
at org.apache.logging.log4j.core.config.BaseConfiguration.createPluginObject(BaseConfiguration.java:765)

at org.apache.logging.log4j.core.config.BaseConfiguration.createConfiguration(BaseConfiguration.java:529)

at org.apache.logging.log4j.core.config.BaseConfiguration.createConfiguration(BaseConfiguration.java:521)

at org.apache.logging.log4j.core.config.BaseConfiguration.doConfigure(BaseConfiguration.java:170)

at org.apache.logging.log4j.core.config.BaseConfiguration.start(BaseConfiguration.java:123)

at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:331) 
at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:370) 
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:149) 
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:85)

at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:34)

at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:360) 
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:319) 
at de.huxhorn.lilith.sandbox.Log4j2Sandbox.main(Log4j2Sandbox.java:43) 
Caused by: java.lang.NullPointerException 
at org.apache.logging.log4j.core.appender.SocketAppender.createAppender(SocketAppender.java:120)

... 17 more 

                
> NPE while using SocketAppender
> ------------------------------
>
>                 Key: LOG4J2-139
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-139
>             Project: Log4j 2
>          Issue Type: Bug
>    Affects Versions: 2.0-beta3
>         Environment: ------------------------------------------------------------
> Gradle 1.3
> ------------------------------------------------------------
> Gradle build time: Dienstag, 20. November 2012 11:37 Uhr UTC
> Groovy: 1.8.6
> Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
> Ivy: 2.2.0
> JVM: 1.7.0_10 (Oracle Corporation 23.6-b04)
> OS: Mac OS X 10.8.2 x86_64
>            Reporter: Joern Huxhorn
>             Fix For: 2.0-beta4
>
>         Attachments: log4j2-139.diff
>
>
> I try to use the SocketAppender and get the following ERROR/NPE:
> 2013-01-06 00:54:14,024 DEBUG Generated plugins in 0.000032000 seconds
> 2013-01-06 00:54:14,044 DEBUG Calling createLayout on class org.apache.logging.log4j.core.layout.PatternLayout
for element PatternLayout with params(pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36}
--- %msg%n", Configuration(/Users/jhuxhorn/Documents/Projects/huxi/lilith/sandbox/log4j2-sandbox/build/resources/main/log4j2.xml),
null, charset="null")
> 2013-01-06 00:54:14,045 DEBUG Generated plugins in 0.000029000 seconds
> 2013-01-06 00:54:14,049 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.ConsoleAppender
for element Console with params(PatternLayout(%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} ---
%msg%n), null, target="SYSTEM_OUT", name="Console", suppressExceptions="null")
> 2013-01-06 00:54:14,049 DEBUG Calling createLayout on class org.apache.logging.log4j.core.layout.SerializedLayout
for element SerializedLayout
> 2013-01-06 00:54:14,052 DEBUG Calling createAppender on class org.apache.logging.log4j.core.appender.SocketAppender
for element Socket with params(host="localhost", port="4560", protocol="null", reconnectionDelay="null",
name="Socket", immediateFlush="null", suppressExceptions="null", SerializedLayout(org.apache.logging.log4j.core.layout.SerializedLayout@5cc4211b),
null)
> 2013-01-06 00:54:14,054 ERROR Unable to invoke method createAppender in class org.apache.logging.log4j.core.appender.SocketAppender
for element Socket java.lang.reflect.InvocationTargetException
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> 	at java.lang.reflect.Method.invoke(Method.java:601)
> 	at org.apache.logging.log4j.core.config.BaseConfiguration.createPluginObject(BaseConfiguration.java:711)
> 	at org.apache.logging.log4j.core.config.BaseConfiguration.createConfiguration(BaseConfiguration.java:477)
> 	at org.apache.logging.log4j.core.config.BaseConfiguration.createConfiguration(BaseConfiguration.java:469)
> 	at org.apache.logging.log4j.core.config.BaseConfiguration.doConfigure(BaseConfiguration.java:156)
> 	at org.apache.logging.log4j.core.config.BaseConfiguration.start(BaseConfiguration.java:114)
> 	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:251)
> 	at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:267)
> 	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:134)
> 	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:75)
> 	at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:30)
> 	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:165)
> 	at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:174)
> 	at de.huxhorn.lilith.sandbox.Log4j2Sandbox.main(Log4j2Sandbox.java:43)
> Caused by: java.lang.NullPointerException
> 	at org.apache.logging.log4j.core.appender.SocketAppender.createSocketManager(SocketAppender.java:95)
> 	at org.apache.logging.log4j.core.appender.SocketAppender.createAppender(SocketAppender.java:86)
> 	... 17 more
> 2013-01-06 00:54:14,056 ERROR Null object returned for Socket in appenders
> My configuration looks like this:
> <?xml version="1.0" encoding="UTF-8"?>
> <configuration status="debug">
> 	<appenders>
> 		<Console name="Console" target="SYSTEM_OUT">
> 			<PatternLayout pattern="%d{HH:mm:ss.SSS} [%t] %-5level %logger{36} --- %msg%n"/>
> 		</Console>
> 		<Socket name="Socket" host="localhost" port="4560">
> 			<SerializedLayout />
> 		</Socket>
> 	</appenders>
> 	<loggers>
> 		<root level="all">
> 			<appender-ref ref="Console"/>
> 			<appender-ref ref="Socket"/>
> 		</root>
> 	</loggers>
> </configuration>

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org


Mime
View raw message