I've updated my WSO2 EI from 6.2.0 to 6.3.0 and now i can't launch my WSO2 with a log4j appender for Kafka.
Before, i've put this in my log4j.properties
log4j.rootLogger=ERROR, CARBON_CONSOLE, CARBON_LOGFILE, CARBON_MEMORY,CARBON_SYS_LOG, ERROR_LOGFILE, KAFKA
log4j.logger.AUDIT_LOG=INFO, AUDIT_LOGFILE
log4j.logger.KAFKA=INFO
log4j.logger.org.apache.KAFKA=INFO
log4j.logger.KAFKA=DEBUG
log4j.logger.org.apache.KAFKA=DEBUG
log4j.logger.KAFKA=FATAL
log4j.logger.org.apache.KAFKA=FATAL
log4j.logger.KAFKA=WARN
log4j.logger.org.apache.KAFKA=WARN
log4j.logger.KAFKA=ERROR
log4j.logger.org.apache.KAFKA=ERROR
# Appender config to send KAFKA
log4j.appender.KAFKA=org.apache.kafka.log4jappender.KafkaLog4jAppender
log4j.appender.KAFKA.brokerList=myKafkaQueue:9092
log4j.appender.KAFKA.topic=log_raw
log4j.appender.KAFKA.layout=org.apache.log4j.PatternLayout
log4j.appender.KAFKA.layout.ConversionPattern=DATE:%d{yyyy-MM-dd HH:mm:ss.SSS};; HOST:HOSTNAME;; SEVERITY:%p;; MSG:%c{1}:%L - %m;;
and then i've got this error when i launch ./integrator.sh
Unexpected problem occured during version sanity check
Reported exception:
java.lang.NullPointerException
at org.slf4j.LoggerFactory.versionSanityCheck(LoggerFactory.java:267)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:126)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
at org.apache.kafka.clients.CommonClientConfigs.<clinit>(CommonClientConfigs.java:32)
at org.apache.kafka.clients.producer.ProducerConfig.<clinit>(ProducerConfig.java:225)
at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:303)
at org.apache.kafka.log4jappender.KafkaLog4jAppender.getKafkaProducer(KafkaLog4jAppender.java:243)
at org.apache.kafka.log4jappender.KafkaLog4jAppender.activateOptions(KafkaLog4jAppender.java:237)
at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:580)
at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:526)
at org.apache.log4j.LogManager.<clinit>(LogManager.java:127)
at org.slf4j.impl.Log4jLoggerFactory.<init>(Log4jLoggerFactory.java:66)
at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at com.atomikos.logging.LoggerFactory.<clinit>(LoggerFactory.java:23)
at com.atomikos.transactions.internal.AtomikosActivator.<clinit>(AtomikosActivator.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:167)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:679)
at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:390)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:1176)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:559)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:544)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:457)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:243)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:438)
at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:1)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)
No org.slf4j.impl.StaticLoggerBinder found in ClassPath, trying with log4j...
For Kafka, i'm using this 3 libraries inside my "lib" folder : - kafka-clients-1.1.0.jar - kafka-clients-1.1.1.jar - kafka-log4j-appender-1.1.1.jar
This is what i already did : - I updated my kafka-clients and kafka-log4j-appender - I've tried with WSO2 6.5.0 and 6.6.0 but it didn't works - I've tried to recompile WSO2 EI 6.3 - 6.6 with the older version of log4j and slf4j (i changed version inside pom.xml)
I've compared 6.2.0 with newer version and i found that WSO2 doesn't not use slf4j but slf4j.wso2 since 6.3.0.
Do you have any idea ? Thank you.