admin管理员组

文章数量:1130349

ClassNotFoundException,某种类的缺失

 写spark代码,将hive中的数据采集到hbase中,将代码提交到上述异常,是运行jar包的服务器缺少相应的类,两种解决方案:

  • 使用插件,将maven中的所有的包都打入到jar包中,然后在集群中运行
            <dependency><groupId>org.apache.maven.plugins</groupId><artifactId>maven-assembly-plugin</artifactId><version>3.0.0</version></dependency><plugin><artifactId>maven-assembly-plugin</artifactId><configuration><descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs></configuration><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin>

很费时间,如果多次修改代码,不方便,

  •  新开一个模块将缺少的类,打包单独放入到一个jar包中,然后放进spark中专门放依赖的目录中 

ClassNotFoundException,某种类的缺失

 写spark代码,将hive中的数据采集到hbase中,将代码提交到上述异常,是运行jar包的服务器缺少相应的类,两种解决方案:

  • 使用插件,将maven中的所有的包都打入到jar包中,然后在集群中运行
            <dependency><groupId>org.apache.maven.plugins</groupId><artifactId>maven-assembly-plugin</artifactId><version>3.0.0</version></dependency><plugin><artifactId>maven-assembly-plugin</artifactId><configuration><descriptorRefs><descriptorRef>jar-with-dependencies</descriptorRef></descriptorRefs></configuration><executions><execution><id>make-assembly</id><phase>package</phase><goals><goal>single</goal></goals></execution></executions></plugin>

很费时间,如果多次修改代码,不方便,

  •  新开一个模块将缺少的类,打包单独放入到一个jar包中,然后放进spark中专门放依赖的目录中 

本文标签: ClassNotFoundException某种类的缺失