Drools-Guvnor 的空指针异常

发布于 2024-11-03 06:40:18 字数 1045 浏览 0 评论 0 原文

我正在使用红帽杂志中的示例代码 - http://magazine.redhat.com/2008/08/12/jboss-drools-how-to-tuning-guvnor-part-1/ - 尝试获取示例代码可以工作,但我不断收到以下错误:

Exception in thread "main" java.lang.NullPointerException

        at java.util.Properties$LineReader.readLine(Unknown Source)

        at java.util.Properties.load0(Unknown Source)

        at java.util.Properties.load(Unknown Source)

        at org.drools.agent.RuleAgent.loadFromProperties(RuleAgent.java:299)

        at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:256)

        at test.GuvnorTest.main(GuvnorTest.java:15)

我不知道 guvnor.properties 文件在哪里。如何创建如何获取此文件。

我之前学习 drools-guvnor 的尝试如下
1)了解 Drools guvnor 的工作
2)了解 drools-guvnor

I’m using the example code from the Red Hat Magazine - http://magazine.redhat.com/2008/08/12/jboss-drools-how-to-tuning-guvnor-part-1/ - to try to get the sample code to work, but I keep getting the following error:

Exception in thread "main" java.lang.NullPointerException

        at java.util.Properties$LineReader.readLine(Unknown Source)

        at java.util.Properties.load0(Unknown Source)

        at java.util.Properties.load(Unknown Source)

        at org.drools.agent.RuleAgent.loadFromProperties(RuleAgent.java:299)

        at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:256)

        at test.GuvnorTest.main(GuvnorTest.java:15)

I don't know where is guvnor.properties file .How to create how to get this file .

My previous attempt to learn drools-guvnor are following
1)understanding working of Drools guvnor
2)Understanding drools-guvnor

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小瓶盖 2024-11-10 06:40:18

空指针是 Java 程序中最容易捕获的异常。从堆栈跟踪中可以清楚地看出,它无法从属性文件之一读取该行。如果您进行调试,您可能会注意到它正在尝试访问哪个路径,也许这也是您应该放置 guvnor 属性文件的位置。

Nullpointers are the easiest of easiest exceptions to catch in a Java program. From your stack trace, it is clear that it is not able to read the line from one of the property files. If you debug, you could notice which path it is trying to access to and perhaps that would be the place you should be placing your guvnor property file as well.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文