prabeesh/MQTTScalaClient

How to run this example

rafaelquintanilha opened this issue · 3 comments

Hello, thanks for sharing your work!

I'm trying to run this example but without success. After building through sbt package I run the following command:

~/my/path/to/spark/bin/spark-submit --class "Subscriber" --master local[4] target/scala-2.10/mqttscalaclinet_2.10-0.2.0.jar

... and get this output:

java.lang.ClassNotFoundException: Subscriber
    at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:274)
    at org.apache.spark.deploy.SparkSubmit$.org$apache$spark$deploy$SparkSubmit$$runMain(SparkSubmit.scala:538)
    at org.apache.spark.deploy.SparkSubmit$.doRunMain$1(SparkSubmit.scala:166)
    at org.apache.spark.deploy.SparkSubmit$.submit(SparkSubmit.scala:189)
    at org.apache.spark.deploy.SparkSubmit$.main(SparkSubmit.scala:110)
    at org.apache.spark.deploy.SparkSubmit.main(SparkSubmit.scala)

What could I be missing?

Actually you want run in your code in Spark ?
Please take have a look this example

Actually I've already tested this example, works fine. The problem is when I try to run it locally (not through spark-example, as it does). I didn't realize this was pure Scala though. My goal is to make it works with Spark processing power.

This receiver already implemented in spark check this