tried again, seemed like the .out extension got filtered out by mail server...
On Thu, Aug 18, 2016 at 4:41 PM, Bill Okara <billok...@gmail.com> wrote: > attach the catalina.out again, didn't seem to go through last time... > > > On Thu, Aug 18, 2016 at 4:33 PM, Bill Okara <billok...@gmail.com> wrote: >> Hi, >> >> When trying out the log4j2 Kafka appender, it works ok if all the >> log4j2/kafka-client related jars are packaged in the webapp's >> WEB-INF/lib, like: >> >>>ls WEB-INF/lib/ >> jackson-core-2.8.1.jar >> log4j-core-2.6.2.jar >> lz4-1.3.0.jar >> kafka-clients-0.10.0.1.jar >> log4j-slf4j-impl-2.6.2.jar >> slf4j-api-1.7.21.jar >> log4j-api-2.6.2.jar >> log4j-web-2.6.2.jar >> snappy-java-1.1.2.6.jar >> >> >> But if the jars are provided in tomcat/lib (for all webapps), and each >> webapp will have its own log4j2.xml (as in attached war), then when >> launching the webapp, will encounter: >> >> ----- >> Caused by: java.lang.NullPointerException >> at >> org.apache.kafka.clients.producer.KafkaProducer.close(KafkaProducer.java:658) >> at >> org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:333) >> at >> org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:188) >> at >> org.apache.logging.log4j.core.appender.mom.kafka.DefaultKafkaProducerFactory.newKafkaProducer(DefaultKafkaProducerFactory.java:29) >> at >> org.apache.logging.log4j.core.appender.mom.kafka.KafkaManager.startup(KafkaManager.java:86) >> at >> org.apache.logging.log4j.core.appender.mom.kafka.KafkaAppender.start(KafkaAppender.java:96) >> at >> org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:247) >> at >> org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:496) >> at >> org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:566) >> --------- >> >> (full stack trace as in attached catalina.out) >> >> >> To reproduce the error, simply: >> 1) build the attached webapp, and deploy the output to tomcat/webapps >> 2) move the WEB-INF/lib/*.jar to tomcat/lib (make sure WEB-INF/lib is >> empty after move) >> 3) start tomcat >> >> Tested with tomcat 7.0.70 >> >> Anyone encounter similar problem? or is this a bug? (log4j2 or >> kafka-client bug?) >> >> >> Thanks, >> Bill
INFO: Initializing ProtocolHandler ["http-bio-8080"] Aug 18, 2016 3:35:41 PM org.apache.coyote.AbstractProtocol init INFO: Initializing ProtocolHandler ["ajp-bio-8009"] Aug 18, 2016 3:35:41 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 405 ms Aug 18, 2016 3:35:41 PM org.apache.catalina.core.StandardService startInternal INFO: Starting service Catalina Aug 18, 2016 3:35:41 PM org.apache.catalina.core.StandardEngine startInternal INFO: Starting Servlet Engine: Apache Tomcat/7.0.70 Aug 18, 2016 3:35:41 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deploying web application directory /opt/java/apache/apache-tomcat-7.0.70/webapps/log4j-appender Aug 18, 2016 3:35:42 PM org.apache.catalina.startup.TldConfig execute INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time. Aug 18, 2016 3:35:42 PM org.apache.catalina.core.ContainerBase addChildInternal SEVERE: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/log4j-appender]] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:153) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ExceptionInInitializerError at org.apache.logging.log4j.core.appender.mom.kafka.DefaultKafkaProducerFactory.newKafkaProducer(DefaultKafkaProducerFactory.java:29) at org.apache.logging.log4j.core.appender.mom.kafka.KafkaManager.startup(KafkaManager.java:86) at org.apache.logging.log4j.core.appender.mom.kafka.KafkaAppender.start(KafkaAppender.java:96) at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:247) at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:496) at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:249) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:239) at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:157) at org.apache.logging.log4j.web.Log4jWebInitializerImpl.initializeNonJndi(Log4jWebInitializerImpl.java:167) at org.apache.logging.log4j.web.Log4jWebInitializerImpl.start(Log4jWebInitializerImpl.java:109) at org.apache.logging.log4j.web.Log4jServletContainerInitializer.onStartup(Log4jServletContainerInitializer.java:57) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5604) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:147) ... 10 more Caused by: java.lang.NullPointerException at org.apache.kafka.clients.producer.KafkaProducer.close(KafkaProducer.java:658) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:333) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:188) at org.apache.logging.log4j.core.appender.mom.kafka.DefaultKafkaProducerFactory.newKafkaProducer(DefaultKafkaProducerFactory.java:29) at org.apache.logging.log4j.core.appender.mom.kafka.KafkaManager.startup(KafkaManager.java:86) at org.apache.logging.log4j.core.appender.mom.kafka.KafkaAppender.start(KafkaAppender.java:96) at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:247) at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:496) at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:566) at org.apache.logging.log4j.core.LoggerContext.reconfigure(LoggerContext.java:582) at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:217) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:152) at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:45) at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194) at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:103) at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43) at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:42) at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:358) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383) at org.apache.kafka.clients.producer.KafkaProducer.<clinit>(KafkaProducer.java:131) ... 23 more Aug 18, 2016 3:35:42 PM org.apache.catalina.startup.HostConfig deployDirectory SEVERE: Error deploying web application directory /opt/java/apache/apache-tomcat-7.0.70/webapps/log4j-appender java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/log4j-appender]] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:903) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1260) at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:2002) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Aug 18, 2016 3:35:42 PM org.apache.catalina.startup.HostConfig deployDirectory INFO: Deployment of web application directory /opt/java/apache/apache-tomcat-7.0.70/webapps/log4j-appender has finished in 719 ms Aug 18, 2016 3:35:42 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["http-bio-8080"] Aug 18, 2016 3:35:42 PM org.apache.coyote.AbstractProtocol start INFO: Starting ProtocolHandler ["ajp-bio-8009"] Aug 18, 2016 3:35:42 PM org.apache.catalina.startup.Catalina start INFO: Server startup in 748 ms
--------------------------------------------------------------------- To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org For additional commands, e-mail: log4j-user-h...@logging.apache.org