Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Reviewed
Description
org.xml.sax.SAXParseException; systemId: file:/home/qwerty/hbase/hbase/hbase-spark/target/test-classes/; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
{{ java.lang.RuntimeException: org.xml.sax.SAXParseException; systemId: file:/home/qwerty/hbase/hbase/hbase-spark/target/test-classes/; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.}}
{{ at org.apache.hadoop.conf.Configuration.loadResource(Configuration.java:2728)}}
{{ at org.apache.hadoop.conf.Configuration.loadResources(Configuration.java:2574)}}
{{ at org.apache.hadoop.conf.Configuration.getProps(Configuration.java:2477)}}
{{ at org.apache.hadoop.conf.Configuration.get(Configuration.java:1047)}}
{{ at org.apache.hadoop.mapred.JobConf.checkAndWarnDeprecation(JobConf.java:2007)}}
{{ at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:449)}}
{{ at org.apache.hadoop.mapreduce.Job.getInstance(Job.java:184)}}
{{ at org.apache.hadoop.hbase.spark.HBaseContext.<init>(HBaseContext.scala:71)}}
{{ at org.apache.hadoop.hbase.spark.HBaseRelation.<init>(DefaultSource.scala:136)}}
{{ at org.apache.hadoop.hbase.spark.DefaultSource.createRelation(DefaultSource.scala:79)}}
This is because when hbase.spark.use.hbasecontext=false, org.apache.hadoop.hbase.spark.HBaseRelation will try to create a HbaseContext with org.apache.hadoop.hbase.spark.HBaseRelation#configResources. But if org.apache.hadoop.hbase.spark.datasources.HBaseSparkConf#HBASE_CONFIG_LOCATION is not set, tdefault is "" (empty string). org.apache.hadoop.conf.Configuration#getResource(String) will return current folder as URL due to classLoader.getResource(""), which will fail to be parsed as a file