On 23/02/2011 05:37, Saurabh wrote:
hi ,
When i am doing like
kbc =
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null,dyanmicclass.getClassLoader());
kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder(kbc);
kbuilder.add(source, ResourceType.DRL);
if (kbuilder.hasErrors()) {
System.err.println(kbuilder.getErrors());
return false;
}
KnowledgeBaseConfiguration kbaseConfig
=KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null,dyanmicclass.getClassLoader());
kbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig);
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
That
should work, if it's not it must be a bug. Create a self contained
test, similar to those in DynamicRulesTest.java and submit it as a jira
for us to look over.
Mark
then i am facing following problem .
StackTrace: org.drools.RuntimeDroolsException:
java.lang.ClassNotFoundException:
Rule_my001_check_0AccumulateExpression0Invoker
at
org.drools.rule.JavaDialectRuntimeData.reload(JavaDialectRuntimeData.java:383)
at
org.drools.rule.JavaDialectRuntimeData.onBeforeExecute(JavaDialectRuntimeData.java:139)
at
org.drools.rule.DialectRuntimeRegistry.onBeforeExecute(DialectRuntimeRegistry.java:132)
at org.drools.compiler.PackageBuilder.reloadAll(PackageBuilder.java:683)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:641)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:266)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:458)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
Thanks& Regards
Saurabh