[ https://issues.apache.org/jira/browse/KAFKA-1304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13931992#comment-13931992 ]
Jun Rao commented on KAFKA-1304: -------------------------------- I think this can happen when multiple instances of producers are created in the same jvm. Right now, their jmx bean names collide. We should guard this case. Also, we should include the client id in the jmx bean name to distinguish the stats from different producer instances. > unregistered mbean exception in new producer > -------------------------------------------- > > Key: KAFKA-1304 > URL: https://issues.apache.org/jira/browse/KAFKA-1304 > Project: Kafka > Issue Type: Bug > Components: core > Affects Versions: 0.8.2 > Reporter: Jun Rao > > Saw the following when running the new producer in ProducerPerformance. > [2014-03-03 12:44:07,619] ERROR Error when closing producer > (kafka.perf.ProducerPerformance$) > org.apache.kafka.common.KafkaException: Error unregistering mbean > at > org.apache.kafka.common.metrics.JmxReporter.unregister(JmxReporter.java:100) > at > org.apache.kafka.common.metrics.JmxReporter.close(JmxReporter.java:90) > at org.apache.kafka.common.metrics.Metrics.close(Metrics.java:204) > at > org.apache.kafka.clients.producer.KafkaProducer.close(KafkaProducer.java:279) > at > kafka.perf.ProducerPerformance$NewShinyProducer.close(ProducerPerformance.scala:222) > at > kafka.perf.ProducerPerformance$ProducerThread.run(ProducerPerformance.scala:299) > at > java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at > java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:662) > Caused by: javax.management.InstanceNotFoundException: kafka:type=producer > at > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1094) > at > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:415) > at > com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:403) > at > com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:506) > at > org.apache.kafka.common.metrics.JmxReporter.unregister(JmxReporter.java:98) > ... 8 more -- This message was sent by Atlassian JIRA (v6.2#6252)