title: Kafka Stream using SpecificAvroSerde in Java Could not find class error
body: <p>I am preparing an Kafka Stream application with Java. The task is consuming some messages from a topic which contains message generated by JDBC connector with</p>
  
  <p><code>io.confluent.connect.avro.AvroConverter</code> as Key and Value Converter. </p>
  
  <p>The messages can be consumed by using <code>bin/kafka-avro-console-consumer</code> in command mode without any issue. </p>
  
  <p>I have generated the class (named myobject) in my IDE by using Maven Plug-in and the generated class are sitting under </p>
  
  <p><code>{project}/target/generated-sourcess/avro/com.myproject.myclasses/myobject</code></p>
  
  <p>In my Main Class, i can create the object by using myobject class without any issue. </p>
  
  <p>I have imported that generated class in my main class</p>
  
  <pre><code>import com.myproject.myclasses.myobject;
  </code></pre>
  
  <p>I have following configurations in my stream application</p>
  
  <pre><code>    Properties config = new Properties();
      config.put(StreamsConfig.APPLICATION_ID_CONFIG,this.applicaionId);
      config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG,svrConfig.getBootstrapServers());
      config.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");       
      config.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, svrConfig.getCacheMaxBytesBufferingConfig());       
      config.put(StreamsConfig.PROCESSING_GUARANTEE_CONFIG, StreamsConfig.EXACTLY_ONCE);
      config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.StringSerde.class);
      config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, SpecificAvroSerde.class);
      config.put(KafkaAvroSerializerConfig.SCHEMA_REGISTRY_URL_CONFIG, "http://localhost:8081");
  </code></pre>
  
  <p>In my stream builder script, I have </p>
  
  <pre><code>    final Map&lt;String, String&gt; serdeConfig = Collections.singletonMap("schema.registry.url","http://localhost:8081");
      Serdes.StringSerde keySpecificAvroSerde = new Serdes.StringSerde();
      final Serde&lt;myObject&gt; valueSpecificAvroSerde = new SpecificAvroSerde&lt;&gt;();
      valueSpecificAvroSerde.configure(serdeConfig, false); // `false` for record values
  
      StreamsBuilder builder = new StreamsBuilder();
      KStream&lt;String, myObject&gt; purchaseInvoices = builder.stream(this.sourceTopic
              , Consumed.with(Serdes.String(), valueSpecificAvroSerde));
  </code></pre>
  
  <p>I received the following error below:</p>
  
  <pre><code>Caused by: org.apache.kafka.common.errors.SerializationException: Could not find class mybject specified in writer's schema whilst finding reader's schema for a SpecificRecord.
  </code></pre>
  
  <p>According to my testing, I believe the application can extract the record from my topic. Moreover, when I use GenericAvroSerde approach, everything works fine and i can consume the message successfully. However, GenericAvroSerde approach need to have extra lines to map the message from Kafka topic in myObject and I assume SpecificAvroSerde approach can save that part of mapping so that I really want to have SpecificAvroSerde approach works. </p>
  
  <p>Any advice? Is that I put myObject in a wrong place so that my application (I just run in my local IDE with the Confluent under the same machine) cannot locate myObject? </p>
  
  <p>Thanks in advance. </p>