[rules-users] Unable to get LastModified for ClasspathResource

tia rabarijaonadomoina at gmail.com
Mon Jan 27 08:59:25 EST 2014


Hi,

I exactly get the same error:

java.lang.RuntimeException: Unable to get LastModified for ClasspathResource
...
...Caused by: java.io.FileNotFoundException: 'src/main/rules/changeset.xml'
cannot be opened because it does not exist

But none of the solutions above worked for me.

Here is my code:
private static String ruleXmlFile="src/main/rules/changeset.xml";
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource(ruleXmlFile),
ResourceType.CHANGE_SET);

But when I test with this:
	Scanner scanner=new Scanner(new FileReader(ruleXmlFile));
	System.out.println(scanner.next());

It's OK, my file is well read !

If someone has an idea ;)

I'm using Drools 6.0.0 and Eclipse.




--
View this message in context: http://drools.46999.n3.nabble.com/Unable-to-get-LastModified-for-ClasspathResource-tp4025031p4027862.html
Sent from the Drools: User forum mailing list archive at Nabble.com.


More information about the rules-users mailing list