可恶Drools,写给我自己看的

java.lang.NullPointerException
java.util.Properties$LineReader.readLine(Unknown Source)
java.util.Properties.load0(Unknown Source)
java.util.Properties.load(Unknown Source)
org.drools.agent.RuleAgent.loadFromProperties(RuleAgent.java:244)
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:216)
main.java.AnimalsSessionHelp.loadRuleBaseFromRuleAgent(AnimalsSessionHelp.java:15)
main.java.AnimalsSessionHelp.getSession(AnimalsSessionHelp.java:22)
main.java.Logic.execute(Logic.java:12)
main.servlet.Animals.doGet(Animals.java:23)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

 

2009年6月5日22:17:47

 

2009年6月6日13:50:31修改博客:

 

RuleAgent(default) INFO (Sat Jun 06 13:13:59 CST 2009): Configuring with newInstance=true, secondsToRefresh=-1

RuleAgent(default) INFO (Sat Jun 06 13:13:59 CST 2009): Configuring package provider : DirectoryScanner scanning dir: src\main\rules found 2 file(s).

RuleAgent(default) INFO (Sat Jun 06 13:14:02 CST 2009): Applying changes to the rulebase.

RuleAgent(default) INFO (Sat Jun 06 13:14:02 CST 2009): Creating a new rulebase as per settings.

RuleAgent(default) INFO (Sat Jun 06 13:14:02 CST 2009): Adding package called test

您好!20096613:10:31 恭喜

20096612:08:43

ERROR: JDWP Unable to get JNI 1.2 environment, jvm->GetEnv() return code = -2

JDWP exit error AGENT_ERROR_NO_JNI_ENV(183):  [../../../src/share/back/util.c:820]

Logic类中进行测试可以通过的了

  

但是在Web下的测试就还有问题

java.lang.IllegalArgumentException: The directory src/main/rulesis not valid.

    at org.drools.agent.DirectoryScanner.configure(DirectoryScanner.java:27)

    at org.drools.agent.RuleAgent.getProvider(RuleAgent.java:265)

    at org.drools.agent.RuleAgent.init(RuleAgent.java:199)

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

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

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

    at main.java.AnimalsSessionHelp.loadRuleBaseFromRuleAgent(AnimalsSessionHelp.java:15)

    at main.java.AnimalsSessionHelp.getSession(AnimalsSessionHelp.java:23)

    at main.java.Logic.execute(Logic.java:12)

    at main.servlet.Animals.doGet(Animals.java:23)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)

    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)

    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)

    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)

    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

    at java.lang.Thread.run(Unknown Source)

 

 

20096613:40:36  好像成功了

您好!20096613:07:59

RuleAgent(default) INFO (Sat Jun 06 13:40:10 CST 2009): Configuring with newInstance=true, secondsToRefresh=-1

RuleAgent(default) INFO (Sat Jun 06 13:40:10 CST 2009): Configuring package provider : URLScanner monitoring URLs:  http://localhost:8080/Animals2WEB-INF/classes/main/rules

RuleAgent(default) WARNING (Sat Jun 06 13:40:10 CST 2009): Was an error contacting http://localhost:8080/Animals2WEB-INF/classes/main/rules. Reponse header: {null=[HTTP/1.1 404 Not Found], Date=[Sat, 06 Jun 2009 05:40:10 GMT], Content-Length=[1057], Content-Type=[text/html;charset=utf-8], Server=[Apache-Coyote/1.1]}

RuleAgent(default) EXCEPTION (Sat Jun 06 13:40:10 CST 2009): Was unable to reach server.. Stack trace should follow.

java.io.IOException: Was unable to reach server.

    at org.drools.agent.URLScanner.hasChanged(URLScanner.java:145)

    at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:109)

    at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:88)

    at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:330)

    at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:298)

    at org.drools.agent.RuleAgent.configure(RuleAgent.java:284)

    at org.drools.agent.RuleAgent.init(RuleAgent.java:208)

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

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

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

    at main.java.AnimalsSessionHelp.loadRuleBaseFromRuleAgent(AnimalsSessionHelp.java:15)

    at main.java.AnimalsSessionHelp.getSession(AnimalsSessionHelp.java:23)

    at main.java.Logic.main(Logic.java:21)

 

注意:

Web下的部署:属性文件

newInstance=true

url=http://localhost:8080/Animals2WEB-INF/classes/main/rules

 

 

直接测试可以使用:

newInstance=true

dir=src/main/rules

 

 

你可能感兴趣的:(java,apache,tomcat,servlet,jni)