tomcat6 and drool rules reloading
I have run into an issue where when I modify my drools rules(.drl) on the fileSystem it开发者_JAVA技巧 appears to work as a JUnit testcase but fails when try to test the same in the web application running under Tomcat6.
When I modify the drl file under Tomcat, I do see logs saying KnowledgeAgent is rebuilding the knowledgeBase and so on and I do see new a instance of KBase under KAgent in the debugger but still when I execute the rule it shows the original values.
Was wondering if there is any cache tomcat uses internally for rules and if yes whats the workaround? Any help is appreciated.
As I understand your question, I think you have to reload your drl file when it gets changed.
Are you using ResourceFactory.newClassPathResource() method for loading your rule files? If yes, then use ResourceFactory.newInputStreamResource(stream) method. It always gets latest modified drl file.
精彩评论