【问题标题】:Apache Zeppelin postgres Null Pointer ExceptionApache Zeppelin postgres 空指针异常
【发布时间】:2016-04-26 13:57:21
【问题描述】:

我尝试将查询连接到远程 postgres 数据库 -

%psql.sql

select * from my_schema.my_table limit 5

我已经更新了解释器的值,但我仍然收到以下错误 -

java.lang.NullPointerException 在 org.apache.zeppelin.postgresql.PostgreSqlInterpreter.executeSql(PostgreSqlInterpreter.java:201) 在 org.apache.zeppelin.postgresql.PostgreSqlInterpreter.interpret(PostgreSqlInterpreter.java:288) 在 org.apache.zeppelin.interpreter.ClassloaderInterpreter.interpret(ClassloaderInterpreter.java:57) 在 org.apache.zeppelin.interpreter.LazyOpenInterpreter.interpret(LazyOpenInterpreter.java:93) 在 org.apache.zeppelin.interpreter.remote.RemoteInterpreterServer$InterpretJob.jobRun(RemoteInterpreterServer.java:302) 在 org.apache.zeppelin.scheduler.Job.run(Job.java:171) 在 org.apache.zeppelin.scheduler.FIFOScheduler$1.run(FIFOScheduler.java:139) 在 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 在 java.util.concurrent.FutureTask.run(FutureTask.java:266) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) 在 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) 在 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 在 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 在 java.lang.Thread.run(Thread.java:745)

我尝试从 shell 访问但出现错误 -

进程因错误退出:2(退出值:2)

我怀疑这与它试图获取密码的事实有关。但是,相同的命令 + 密码在我的终端上有效。

另一个相关问题是解释器中的属性不包含数据库名称。我将其添加为postgresql.database,但我不确定是否使用了此属性。

如果您知道如何解决,请告诉我,谢谢!

【问题讨论】:

  • 以下答案有帮助吗?如果不是,请将详细信息添加为 cmets
  • 这很有帮助,因此我投了赞成票
  • 你找到解决这个问题的方法了吗?

标签: postgresql apache-spark sh apache-zeppelin


【解决方案1】:

zeppelin 不会选择您的财产postgresql.database

在 postgres jdbc URL 属性中指定数据库名称。喜欢 jdbc:postgresql://host:port/database

有关 postgres jdbc URL 的更多详细信息,请参阅 https://jdbc.postgresql.org/documentation/80/connect.html

【讨论】:

  • 谢谢,这也解决了 Flyway 4.2.0 清理和迁移 java.lang.NullPointerException
【解决方案2】:

您的某些凭据可能有误。我输入了错误的用户名并得到了类似的东西:

java.lang.NullPointerException at org.apache.zeppelin.postgresql.PostgreSqlInterpreter.executeSql(PostgreSqlInterpreter.java:202)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-19
    • 1970-01-01
    • 2021-10-04
    • 2015-07-12
    相关资源
    最近更新 更多