object hbase is not a member of package org.apache.hadoop
来源:互联网 发布:暗影格斗2mac破解 编辑:程序博客网 时间:2024/06/10 12:31
今天在学习Spark的过程中,看到了官网上的例子HBaseTest.scala
。我改装了一下,希望做出属于自己的Scala程序。我的程序需要引用一个hbase的package:
import org.apache.hadoop.hbase.client.HBaseAdmin
而我的build.sbt文件是这样的:
name := "HBaseTest2"version := "1.0"scalaVersion := "2.11.7"libraryDependencies += "org.apache.spark" %% "spark-core" % "1.4.1"libraryDependencies ++= Seq( "org.apache.hbase" % "hbase" % "1.0.1.1", "org.apache.hbase" % "hbase-client" % "1.0.1.1")
在用sbt package
打包的时候,sbt报错。错误如下:
MacBook-Pro-de-Mincong:HBaseTest2 minconghuang$ sbt package[info] Set current project to HBaseTest2 (in build file:/usr/local/Cellar/spark/programs/HBaseTest2/)[info] Compiling 1 Scala source to /usr/local/Cellar/spark/programs/HBaseTest2/target/scala-2.11/classes...[error] /usr/local/Cellar/spark/programs/HBaseTest2/src/main/scala/com/orange/spark/examples/HBaseTest2.scala:3: object hbase is not a member of package org.apache.hadoop[error] import org.apache.hadoop.hbase.client.HBaseAdmin[error] ^...
在网上查了以下,错误的原因是HBaseAdmin依赖的Hadoop-core并没有被添加到build.sbt文件中:
name := "HBaseTest2"version := "1.0"scalaVersion := "2.11.7"libraryDependencies += "org.apache.spark" %% "spark-core" % "1.4.1"libraryDependencies ++= Seq( "org.apache.hadoop" % "hadoop-core" % "1.2.1", "org.apache.hbase" % "hbase" % "1.0.1.1", "org.apache.hbase" % "hbase-client" % "1.0.1.1")
添加以后就好啦。
0 0
- object hbase is not a member of package org.apache.hadoop
- spark编译问题解决 object apache is not a member of package org
- error: object kafka is not a member of package org.apache.spark.streaming
- object MailBox is not a member of package concurrent
- Scala错误:object xml is not a member of package scala
- value toDF is not a member of org.apache.spark.rdd.RDD[People]
- 拼写错误:value countBykey is not a member of org.apache.spark.rdd.RDD[(String, Int)]
- value toDF is not a member of org.apache.spark.rdd.RDD[People]
- scala学习-DescriptionResourcePathLocationType value toDF is not a member of org.apache.spark.rdd.R
- 解决value toDF is not a member of org.apache.spark.rdd.RDD[People]
- org.apache.hadoop.hive.serde2.SerDeException: Row is not a valid JSON Object
- org.apache.hadoop.hbase.NotServingRegionException: Region is not online 错误
- org.apache.hadoop.hbase.NotServingRegionException: Region is not online 错误
- org.apache.struts2.json.JSONWriter can not access a member of class org.apache.commons.dbcp...
- 'daemonize' is not a member of 'ACE'
- 'GetCurSel' : is not a member of 'CTime'
- is not a member of global namespace
- 'WriteHuge' : is not a member of 'CFile'
- 使用git-flow来帮助管理git代码
- hdu1874 畅通工程续 最短路 floyd或dijkstra或spfa
- C. Arthur and Table(Codeforces Round #311 (Div. 2) 贪心)
- ViewPager禁用左右滑动
- leetcode 132: Palindrome Partitioning II
- object hbase is not a member of package org.apache.hadoop
- Java中enum的学习总结
- Amazon Kinesis简介
- Facade——结构模式
- JAVA学习(十)__MessageFormat用法
- 每日五道题(struts2)
- Leetcode 211 Add and Search Word - Data structure design
- CXF+spring构建restful风格的webservice
- tnsnames.ora配置问题