0

Scenario -

  1. Jena API
  2. Play framework 2
  3. Database server - fuseki
  4. Database - TDB

Problem - I have insert query in module, when I fill information in HTML form I am getting error like [NullPointerException: null] error points at where I am closing my datasource which is at the bottom of method ds.close(); interesting thing is that when I commented //ds.close(); error shifts to the UpdateAction.parseExecute(query1, graph); and because of this I am not able to see filled form information.

Most interesting thing is that when I am writing select * where {?a ?b ?n} on fuseki database server I can see inserted data. Means data is getting stored.

Am I supposed to do any changes in conf/application.conf file in play framework?, guys your help will be appreciated.

Thanks.

4

1 回答 1

1

一般来说,如果要调试 a ,则NullPointerException需要查看堆栈跟踪以了解错误发生的位置。根据您到目前为止告诉我们的内容,如果注释掉ds.close()会将 NPE 移动到代码中的其他位置,那么变量的值ds必须是null.

如果您不能仅通过查看代码来判断为什么ds有错误的值,请在调试器中运行并单步执行该方法。或者,更好的是,编写一些 JUnit 测试来检查系统中每个对象的约定是否正确。

但在回答您的直接问题时,不:改变conf/applicaton.conf不太可能解决您的 NPE。

于 2012-07-24T12:06:43.690 回答