version 0.7.1.1 - errors in tomcat startup with log4j

Hi

I’m upgrading to version 0.7.1.1 from 0.6.174. The baseAMI on our AWS instances has log4j version 1.2 in the tomcat libraries. This seems to be interfering with the log4j version 2.2 that is being installed by druid.

When I removed the 1.2 libraries I had an error with blitz4j, but when I removed the 2.2 libraries the error went away.

Will running on the older version of log4j affect druid? Is there a configuration setting that I can apply that will help solve this?

Here is the error I’m getting

java.lang.VerifyError: class com.netflix.blitz4j.NFLockFreeLogger overrides final method getEffectiveLevel.()Lorg/apache/log4j/Level;

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)

at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)

at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

at com.netflix.logging.CorePlatformLogger.(CorePlatformLogger.java:53)

at com.netflix.logging.LogManager.(LogManager.java:44)

at com.netflix.server.base.lifecycle.BaseServerListener.(BaseServerListener.java:38)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

at java.lang.Class.newInstance(Class.java:374)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4154)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:802)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)

at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)

at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1068)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)

at org.apache.catalina.startup.Catalina.start(Catalina.java:595)

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:606)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Here are the libraries and other files I’m seeing within tomcat and druid.

./apps/druid/config/_common/log4j2.xml

./apps/druid/config/log4j.properties

./apps/druid/lib/log4j-api-2.2.jar

./apps/druid/lib/log4j-core-2.2.jar

./apps/druid/lib/log4j-1.2-api-2.2.jar

./apps/druid/lib/log4j-slf4j-impl-2.2.jar

./apps/druid/lib/log4j-jul-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-api-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-core-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/slf4j-log4j12-1.7.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-1.2-api-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-slf4j-impl-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-jul-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-1.2.17.jar

This is an issue with blitz4j:

Druid uses slf4j, so any compliant impl should be pluggable, though I’ve never tried how far that would go.

The down side is the stock log4j2.xml will not work, asynchronous loggers are not available, and there is less unified logging overall (no setting -Djava.util.logging.manager=org.apache.logging.log4j.jul.LogManager unless you have some other logging manager bridge jar)

This is an issue with blitz4j:

https://github.com/Netflix/blitz4j/issues/12

Hi

I’m upgrading to version 0.7.1.1 from 0.6.174. The baseAMI on our AWS instances has log4j version 1.2 in the tomcat libraries. This seems to be interfering with the log4j version 2.2 that is being installed by druid.

When I removed the 1.2 libraries I had an error with blitz4j, but when I removed the 2.2 libraries the error went away.

Will running on the older version of log4j affect druid? Is there a configuration setting that I can apply that will help solve this?

Here is the error I’m getting

java.lang.VerifyError: class com.netflix.blitz4j.NFLockFreeLogger overrides final method getEffectiveLevel.()Lorg/apache/log4j/Level;

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)

at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(ClassLoader.java:800)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)

at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2854)

at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1159)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1647)

at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

at com.netflix.logging.CorePlatformLogger.(CorePlatformLogger.java:53)

at com.netflix.logging.LogManager.(LogManager.java:44)

at com.netflix.server.base.lifecycle.BaseServerListener.(BaseServerListener.java:38)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

at java.lang.Class.newInstance(Class.java:374)

at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4154)

at org.apache.catalina.core.StandardContext.start(StandardContext.java:4709)

at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:802)

at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779)

at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:583)

at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943)

at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778)

at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504)

at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317)

at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324)

at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1068)

at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)

at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1060)

at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)

at org.apache.catalina.core.StandardService.start(StandardService.java:525)

at org.apache.catalina.core.StandardServer.start(StandardServer.java:759)

at org.apache.catalina.startup.Catalina.start(Catalina.java:595)

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:606)

at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)

at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

Here are the libraries and other files I’m seeing within tomcat and druid.

./apps/druid/config/_common/log4j2.xml

./apps/druid/config/log4j.properties

./apps/druid/lib/log4j-api-2.2.jar

./apps/druid/lib/log4j-core-2.2.jar

./apps/druid/lib/log4j-1.2-api-2.2.jar

./apps/druid/lib/log4j-slf4j-impl-2.2.jar

./apps/druid/lib/log4j-jul-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-api-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-core-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/slf4j-log4j12-1.7.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-1.2-api-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-slf4j-impl-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-jul-2.2.jar

./apps/tomcat/webapps/ROOT/WEB-INF/lib/log4j-1.2.17.jar

Basically this comes from incompatabilities between log4j-1.2.17.jar and log4j-1.2-api-2.2.jar