I need to read a file inside the WEB-INF/exam folder from my test class. I am getting the following exception when ever I run the test
org.drools.compiler.PackageBuilder$MissingPackageNameException:
'PATH = "C:\Project\TestApp\WebContent\WEB-INF\Rule\"
private static RuleBase ruleBase;
File rFile = new File(PATH, "file name");
try {
FileReader reader = new FileReader(rFile);
ruleBase = RuleBaseLoader.getInstance().loadFromReader(rFile );
}'
Can some one help figure out what I am doing wrong? I am unable to figure out wht the issue is, till now…
I’m guessing that you didn’t put a package name in your rule file. Just put “package mypackage” (or whatever) at the top.
Alternatively, if you’re only trying to load a rule file, then you don’t need to build a package.