当我在一个项目上使用log4j库时,我搞砸了我的类路径,(我对编码很新),我现在已经修复了它或者差不多,但我的问题是我没有数据在sonarqube serveur @localhost:9000
当我运行声纳 - 跑步者时,我成功了:
信息:执行成功 信息:------------------------------------------------ ------------------------ 信息:总时间:7.892s 信息:最终记忆:51M / 367M
但是当我到达localhost时,我没有数据:90000
在我触摸类路径之前,它运行良好,我的sonar-project.properties是sonarqube网站上默认的复制/粘贴
我检查了errorLog,但我无法弄清楚如何修复错误,这里是日志:
// step 1 of 6: create the table and load two rows
vc.sql(s"""CREATE TEMPORARY TABLE TEST1 (
c1 varchar(4)
,username varchar(5)
,numeric integer) USING com.databricks.spark.csv OPTIONS (path "/tmp/test.txt")""")
// step 2 of 6: confirm that the data is queryable
vc.sql("SELECT * FROM TEST1").show()
+----+--------+-------+
| c1|username|numeric|
+----+--------+-------+
|col1| USER1| 0|
|col1| USER2| 1|
+----+--------+-------+
// Step 3 of 6: create a dataframe for the table
var df=vc.sql("""SELECT * FROM TEST1""")
// step 4 of 6: create a second dataframe that we will use as a loop iterator
var df_usernames=vc.sql(s"""SELECT DISTINCT username FROM TEST1 """)
// step 5 of 6: first foreach loop works ok:
df_usernames.foreach(t =>
{
println("(The First foreach works ok: loop iterator t is " + t(0).toString() )
}
)
(The First foreach works ok: loop iterator t is USER1
(The First foreach works ok: loop iterator t is USER2
// step 6 of 6: second foreach with any embedded SQL returns an error
df_usernames.foreach(t =>
{
println("(The second foreach dies: loop iterator t is " + t(0).toString() )
vc.sql("""SELECT c1 FROM TEST1""").show()
}
)
The second foreach dies: loop iterator t is USER1
org.apache.spark.SparkException: Job aborted due to stage failure: Task 158 in stage 94.0 failed 1 times, most recent failure: Lost task 158.0 in stage 94.0 (TID 3525, localhost): java.lang.NullPointerException
at org.apache.spark.sql.SQLContext.parseSql(SQLContext.scala:195)
如果有人有想法! :)
答案 0 :(得分:0)
项目的类路径与SonarQube本身的项目之间没有任何关系。后者必须绝对保持为 - 并且不得更改。我建议您为记录器遇到的初始问题打开一个新问题。