Spark Kafka Streaming Issue

后端 未结 2 1608
小鲜肉
小鲜肉 2021-01-01 04:21

I am using maven

i have added the following dependencies

    
      org.apache.spark&         


        
2条回答
  •  滥情空心
    2021-01-01 05:09

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

    1. remove "sc.addJar()" in your code.

    2. add the code below to pom.xml

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

    4. submit the "example-jar-with-dependencies.jar"

提交回复
热议问题