Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Plain View
Kafka, mail # user - Could not initialize class kafka.utils.Log4jController$ ?


Copy link to this message
-
Could not initialize class kafka.utils.Log4jController$ ?
Jason Huang 2012-12-21, 15:59
Hello,

I am writing a simple java client that uses SimpleConsumer to fetch
messages from a Kafka Server:

..................
  KafkaConnectionParams connection = new KafkaConnectionParams();
  SimpleConsumer consumer = new SimpleConsumer(connection.getKafkaServerURL(),

connection.getKafkaServerPort(),

connection.getConnectionTimeOut(),

connection.getKafkaProducerBufferSize());
   
   FetchRequest req = new FetchRequest(topic, partition, offset, maxSize);
...................

I deployed the code to a JBoss Application Server running in my local
laptop.  However, a runtime exception is thrown for the code above:

SimpleConsumer.<init>(String, int, int, int) line: 31
Logging$class.$init$(Logging) line: 23 -- kafka.utils.Logging
Class<T>.getName() line: 551 [local variables unavailable]
SimpleConsumer.kafka$utils$Logging$_setter_$loggerName_$eq(String) line: 31
Logging$class.$init$(Logging) line: 26
SimpleConsumer.logIdent_$eq(String) line: 31
Logging$class.$init$(Logging) line: 29         --- this appears to be
the code below
(// Force initialization to register Log4jControllerMBean
  private val log4jController = Log4jController)

InvocationTargetException.<init>(Throwable) line: 54
(detail message = "Could not initialize class kafka.utils.Log4jController$")

I am not exactly sure where the issue is. It looks like I am able to
initialize other classes in the kafka.utils package. Both
kafka-0.7.2.jar and log4j-1.2.13.jar are in my Maven repository.

Any help will be greatly appreciated!

thanks!

Jason

 
+
Jason Huang 2012-12-21, 16:26