Hi,
I am using Eclipse writing Java code.

I am trying to create a Kafka receiver by:
JavaPairReceiverInputDStream<String, kafka.message.Message> a  =
KafkaUtils.createStream(jssc, String.class, Message.class,
                        StringDecoder.class, DefaultDecoder.class,
kafkaParams,
                        topics, StorageLevel.MEMORY_AND_DISK());

where jssc, kafkaParams, and topics are all properly defined.

I am getting flagged by Eclipse with the following messages:
"The type scala.reflect.ClassTag cannot be resolved. It is indirectly
referenced from required .class files"

I don't know Scala and it seems that scala.reflect.ClassTag is an unusual
class which can not be imported simply by using an "import" statement.

I have
import scala.reflect.*;
but it doesn't help.

In my pom.xml I have:   
<dependency>
      <groupId>org.scala-lang</groupId>
      <artifactId>scala-reflect</artifactId>
      <version>2.11.4</version>
</dependency>
That doesn't help either.

Is Eclipse flagging a real problem?

A solution suggested by Eclipse is to edit the Java Build Path using the UI
below. However, I have no idea what to do.

<http://apache-spark-user-list.1001560.n3.nabble.com/file/n21032/Javabuildpath.png>
 

I would rather use the API below that doesn't require passing in of
StringDecoder and DefaultDecoder below. However, the contents of my Kafka
messages are not Strings. Is there any way to use this API
with non-String Kafka messages?

public static JavaPairReceiverInputDStream<String,String>
createStream(JavaStreamingContext jssc,
                                                       String zkQuorum,
                                                       String groupId,
                                                      
java.util.Map<String,Integer> topics,
                                                       StorageLevel
storageLevel)


Thanks!!
KC





--
View this message in context: 
http://apache-spark-user-list.1001560.n3.nabble.com/Eclipse-flags-error-on-KafkaUtils-createStream-tp21032.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@spark.apache.org
For additional commands, e-mail: user-h...@spark.apache.org

Reply via email to