[rules-users] dialect java is not loading the facts

sanintel3 sanintel3 at gmail.com
Fri Aug 19 00:43:13 EDT 2011


Hi,
There is a strange behaviour in terms of loading the facts using dialect
java and mvel.
Our requirement is that we should support dynamic changes to fact objects in
the application without a restart. So, to achieve that I am using jar
classloader to load the fact objects into memory. So before constructing
RuleBase I am switching the current class loader context to jar classloader.
By doing this, all the imported facts getting resolved if I use mvel dialect
where as if I use java dialect it's not able to resolve the fact. Can
someone help on how to resolve this issue.
I can't use mvel dialect as it's behaving strangely in case of accumulate.
So I need to use java dialect only.
Please let me know why java dialect is considering the facts only from
classpath. It's not loading from current classloader's context

Below is the code to switch classloader context
Thread.currentThread().setContextClassLoader(jarClassLoader);

InputStream is = //reads from jar content
RuleBase ruleBase = RuleBaseLoader.getInstance().loadFromReader(
                                new InputStreamReader(is));
StatelessSession statelessSession = ruleBase.newStatelessSession();
statelessSession.executeWithResults(facts);


--
View this message in context: http://drools.46999.n3.nabble.com/dialect-java-is-not-loading-the-facts-tp3267126p3267126.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list