KafkaUtils class not found in Spark streaming

后端 未结 9 1557
囚心锁ツ
囚心锁ツ 2021-01-11 20:14

I have just began with Spark Streaming and I am trying to build a sample application that counts words from a Kafka stream. Although it compiles with sbt package

9条回答
  •  星月不相逢
    2021-01-11 20:23

    meet the same problem, I solved it by build the jar with dependencies.

    add the code below to pom.xml

    
        src/main/java
        src/test/java
        
          
          
            maven-assembly-plugin
            
              
                jar-with-dependencies
              
              
                
                  
                
              
            
            
              
                make-assembly
                package
                
                  single
                
              
            
          
        
        
    

    mvn package submit the "example-jar-with-dependencies.jar"

提交回复
热议问题