title: Apache Spark: Getting a InstanceAlreadyExistsException when running the Kafka producer
body: <p>I have an small app in scala that creates kafka producer and that run with Apache Spark.
  when I run the command</p>
  
  <pre><code>spark-submit --master local[2] --deploy-mode client &lt;into the jar file&gt; &lt;app Name&gt; &lt;kafka broker&gt; &lt;kafka in queue&gt; &lt;kafka out queue&gt; &lt;interval&gt;
  </code></pre>
  
  <p>I am getting this WARN:
  WARN AppInfoParser: Error registering AppInfo mbean
  javax.management.InstanceAlreadyExistsException: kafka.producer:type=app-info,id=</p>
  
  <p>The code is not relevant because I am getting this exception when scala creates the KafkaProducer: val producer = new KafkaProducerObject,Object </p>
  
  <p>Does anybody have a solution for this?
  Thank you!</p>