Re: EmptyStackException in Log4j2 beta5 and beta6

2013-05-17 Thread Nick Williams
I have verified that this is fixed in 2.0-beta7-SNAPSHOT. Thanks!

Nick

On May 15, 2013, at 11:29 AM, Ralph Goers wrote:

 Nick,
 
 Have you verified the fix I made to avoid the exception below?  I have looked 
 at the Java 8 source but I can't find the source for the sun classes - I'm 
 not even sure where (or if) you found the javadoc.  But so far I haven't 
 found a replacement for getCallerClass in Java 8.  Since Java 8 isn't even 
 final yet though I'm reluctant to spend a lot of energy investigating how to 
 deal with that - especially since I recall that you opened an issue (although 
 my experience is those kinds of issues just get ignored).
 
 In any case, we said we would do a new release once this issue was fixed so I 
 am thinking that I will probably do that sometime on Sunday (PDT).   We have 
 plenty of other issues that should be addressed and I am hoping I can use the 
 time between now and then to get to a few of them.
 
 Ralph
 
 
 On May 8, 2013, at 8:45 PM, Nick Williams wrote:
 
 I get the following exception written to my Tomcat log. Looks like Spring 
 Framework tried to log an error (through the log4j-jcl bridge) but something 
 happened in Log4j2 that masked the error. Do I need to just file a bug? If 
 this is a bug and not me doing something wrong, I'm going to -1 
 (non-binding) beta6.
 
 Why on Earth does peek() throw EmptyStackException!? Who's bright idea was 
 that!?
 
 SEVERE: Exception sending context initialized event to listener instance of 
 class org.springframework.web.context.ContextLoaderListener
 java.util.EmptyStackException
  at java.util.Stack.peek(Stack.java:102)
  at 
 org.apache.logging.log4j.core.impl.ThrowableProxy.resolvePackageData(ThrowableProxy.java:339)
  at 
 org.apache.logging.log4j.core.impl.ThrowableProxy.init(ThrowableProxy.java:71)
  at 
 org.apache.logging.log4j.core.impl.Log4jLogEvent.init(Log4jLogEvent.java:110)
  at 
 org.apache.logging.log4j.core.impl.Log4jLogEvent.init(Log4jLogEvent.java:81)
  at 
 org.apache.logging.log4j.core.config.LoggerConfig.createEvent(LoggerConfig.java:423)
  at 
 org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:344)
  at org.apache.logging.log4j.core.Logger.log(Logger.java:110)
  at 
 org.apache.logging.log4j.spi.AbstractLoggerWrapper.log(AbstractLoggerWrapper.java:55)
  at 
 org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:539)
  at 
 org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:319)
  at 
 org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
  at 
 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
  at 
 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5210)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at 
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
  at 
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698)
  at 
 org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1491)
  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:491)
  at 
 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
  at 
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
  at 
 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
  at 
 org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:468)
  at 
 org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415)
  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:491)
  at 
 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
  at 
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
  at 
 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
  at 
 javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1465)
  at 
 javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:75)
  at 
 javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1306)
  at 
 

Re: EmptyStackException in Log4j2 beta5 and beta6

2013-05-15 Thread Ralph Goers
Nick,

Have you verified the fix I made to avoid the exception below?  I have looked 
at the Java 8 source but I can't find the source for the sun classes - I'm not 
even sure where (or if) you found the javadoc.  But so far I haven't found a 
replacement for getCallerClass in Java 8.  Since Java 8 isn't even final yet 
though I'm reluctant to spend a lot of energy investigating how to deal with 
that - especially since I recall that you opened an issue (although my 
experience is those kinds of issues just get ignored).

In any case, we said we would do a new release once this issue was fixed so I 
am thinking that I will probably do that sometime on Sunday (PDT).   We have 
plenty of other issues that should be addressed and I am hoping I can use the 
time between now and then to get to a few of them.

Ralph


On May 8, 2013, at 8:45 PM, Nick Williams wrote:

 I get the following exception written to my Tomcat log. Looks like Spring 
 Framework tried to log an error (through the log4j-jcl bridge) but something 
 happened in Log4j2 that masked the error. Do I need to just file a bug? If 
 this is a bug and not me doing something wrong, I'm going to -1 (non-binding) 
 beta6.
 
 Why on Earth does peek() throw EmptyStackException!? Who's bright idea was 
 that!?
 
 SEVERE: Exception sending context initialized event to listener instance of 
 class org.springframework.web.context.ContextLoaderListener
 java.util.EmptyStackException
   at java.util.Stack.peek(Stack.java:102)
   at 
 org.apache.logging.log4j.core.impl.ThrowableProxy.resolvePackageData(ThrowableProxy.java:339)
   at 
 org.apache.logging.log4j.core.impl.ThrowableProxy.init(ThrowableProxy.java:71)
   at 
 org.apache.logging.log4j.core.impl.Log4jLogEvent.init(Log4jLogEvent.java:110)
   at 
 org.apache.logging.log4j.core.impl.Log4jLogEvent.init(Log4jLogEvent.java:81)
   at 
 org.apache.logging.log4j.core.config.LoggerConfig.createEvent(LoggerConfig.java:423)
   at 
 org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:344)
   at org.apache.logging.log4j.core.Logger.log(Logger.java:110)
   at 
 org.apache.logging.log4j.spi.AbstractLoggerWrapper.log(AbstractLoggerWrapper.java:55)
   at 
 org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:539)
   at 
 org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:319)
   at 
 org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
   at 
 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
   at 
 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5210)
   at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
   at 
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
   at 
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698)
   at 
 org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1491)
   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:491)
   at 
 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
   at 
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
   at 
 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
   at 
 org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:468)
   at 
 org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415)
   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:491)
   at 
 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
   at 
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
   at 
 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
   at 
 javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1465)
   at 
 javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:75)
   at 
 javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1306)
   at 
 javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1398)
   at 
 

Re: EmptyStackException in Log4j2 beta5 and beta6

2013-05-15 Thread Nick Williams
I will try to verify this fix in the next couple of days. $Work today, Stark 
Trek premier tonight...

FYI, here are some Java links:

- Latest binaries and link to archives: https://jdk8.java.net/download.html
- API Documentation: http://download.java.net/jdk8/docs/api/
- Milestones: http://openjdk.java.net/projects/jdk8/milestones
- Source code: http://hg.openjdk.java.net/jdk8/jdk8/jdk/, 
http://hg.openjdk.java.net/jdk8/jdk8/hotspot/, 
http://hg.openjdk.java.net/jdk8/jdk8/langtools/
- Source for sun.reflect.Reflection (look at the revision history and you'll 
see why the change was made): 
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/b8e7d145abc2/src/share/classes/sun/reflect/Reflection.java,
 
http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/b8e7d145abc2/src/share/native/sun/reflect/Reflection.c

Rampdown starts in July. API Freeze is in October. If there's going to be a 
replacement for this, it will definitely happened before API Freeze, but my bet 
is before Rampdown. My suggestion on the mailing list is a better replacement 
for our needs, though:

http://mail.openjdk.java.net/pipermail/java-se-8-spec-comments/2013-May/14.html

Nick

On May 15, 2013, at 11:29 AM, Ralph Goers wrote:

 Nick,
 
 Have you verified the fix I made to avoid the exception below?  I have looked 
 at the Java 8 source but I can't find the source for the sun classes - I'm 
 not even sure where (or if) you found the javadoc.  But so far I haven't 
 found a replacement for getCallerClass in Java 8.  Since Java 8 isn't even 
 final yet though I'm reluctant to spend a lot of energy investigating how to 
 deal with that - especially since I recall that you opened an issue (although 
 my experience is those kinds of issues just get ignored).
 
 In any case, we said we would do a new release once this issue was fixed so I 
 am thinking that I will probably do that sometime on Sunday (PDT).   We have 
 plenty of other issues that should be addressed and I am hoping I can use the 
 time between now and then to get to a few of them.
 
 Ralph
 
 
 On May 8, 2013, at 8:45 PM, Nick Williams wrote:
 
 I get the following exception written to my Tomcat log. Looks like Spring 
 Framework tried to log an error (through the log4j-jcl bridge) but something 
 happened in Log4j2 that masked the error. Do I need to just file a bug? If 
 this is a bug and not me doing something wrong, I'm going to -1 
 (non-binding) beta6.
 
 Why on Earth does peek() throw EmptyStackException!? Who's bright idea was 
 that!?
 
 SEVERE: Exception sending context initialized event to listener instance of 
 class org.springframework.web.context.ContextLoaderListener
 java.util.EmptyStackException
  at java.util.Stack.peek(Stack.java:102)
  at 
 org.apache.logging.log4j.core.impl.ThrowableProxy.resolvePackageData(ThrowableProxy.java:339)
  at 
 org.apache.logging.log4j.core.impl.ThrowableProxy.init(ThrowableProxy.java:71)
  at 
 org.apache.logging.log4j.core.impl.Log4jLogEvent.init(Log4jLogEvent.java:110)
  at 
 org.apache.logging.log4j.core.impl.Log4jLogEvent.init(Log4jLogEvent.java:81)
  at 
 org.apache.logging.log4j.core.config.LoggerConfig.createEvent(LoggerConfig.java:423)
  at 
 org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:344)
  at org.apache.logging.log4j.core.Logger.log(Logger.java:110)
  at 
 org.apache.logging.log4j.spi.AbstractLoggerWrapper.log(AbstractLoggerWrapper.java:55)
  at 
 org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:539)
  at 
 org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:319)
  at 
 org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
  at 
 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
  at 
 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5210)
  at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
  at 
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
  at 
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
  at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698)
  at 
 org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1491)
  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:491)
  at 
 org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
  at 
 com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
  at 
 com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
  at 
 

EmptyStackException in Log4j2 beta5 and beta6

2013-05-08 Thread Nick Williams
I get the following exception written to my Tomcat log. Looks like Spring 
Framework tried to log an error (through the log4j-jcl bridge) but something 
happened in Log4j2 that masked the error. Do I need to just file a bug? If this 
is a bug and not me doing something wrong, I'm going to -1 (non-binding) beta6.

Why on Earth does peek() throw EmptyStackException!? Who's bright idea was 
that!?

SEVERE: Exception sending context initialized event to listener instance of 
class org.springframework.web.context.ContextLoaderListener
java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:102)
at 
org.apache.logging.log4j.core.impl.ThrowableProxy.resolvePackageData(ThrowableProxy.java:339)
at 
org.apache.logging.log4j.core.impl.ThrowableProxy.init(ThrowableProxy.java:71)
at 
org.apache.logging.log4j.core.impl.Log4jLogEvent.init(Log4jLogEvent.java:110)
at 
org.apache.logging.log4j.core.impl.Log4jLogEvent.init(Log4jLogEvent.java:81)
at 
org.apache.logging.log4j.core.config.LoggerConfig.createEvent(LoggerConfig.java:423)
at 
org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:344)
at org.apache.logging.log4j.core.Logger.log(Logger.java:110)
at 
org.apache.logging.log4j.spi.AbstractLoggerWrapper.log(AbstractLoggerWrapper.java:55)
at 
org.apache.logging.log4j.spi.AbstractLogger.error(AbstractLogger.java:539)
at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:319)
at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at 
org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5210)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:726)
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:702)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:698)
at 
org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1491)
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:491)
at 
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at 
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at 
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
at 
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:468)
at 
org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:415)
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:491)
at 
org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:300)
at 
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at 
com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:792)
at 
javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1465)
at 
javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:75)
at 
javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1306)
at 
javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1398)
at 
javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:827)
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:491)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:322)
at sun.rmi.transport.Transport$1.run(Transport.java:177)
at sun.rmi.transport.Transport$1.run(Transport.java:174)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:173)
at 
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:556)
at