Hi, Esteban, Hi srinivasasanda.
My opinion regarding the issue posted by srinivasasanda is the following:
Having the changeset filled with DRL's taken from local jBoss application
and using it in a java local running knowledge agent which has not added
into the classpath the fact models will fail, of course with that
/"java.lang.RuntimeException: KnowledgeAgent exception while trying to
deserialize KnowledgeDefinitionsPackage"./
On the other hand, when having changeset.xml set as:
/<add>
<resource source='file:D:\rulemaster.drl' type='DRL' />
</add>/
is working because it seems that the fact models used in defining those
packages are in the classpath.
REST protocol is used correctly in the changeset.xml.
The problem with remotely loading pkg\drl files using REST is that you
should somehow specify a custom classloader, like this:
/KnowledgeBaseConfiguration kbaseConfig =
KnowledgeBaseFactory.newKnowledgeBaseConfiguration(null,
*customClassLoader*);
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig);
//kbase with custom classloader
KnowledgeAgentConfiguration aconf =
KnowledgeAgentFactory.newKnowledgeAgentConfiguration();
aconf.setProperty("drools.agent.useKBaseClassLoaderForCompiling", "true");
KnowledgeAgent kagent = KnowledgeAgentFactory.newKnowledgeAgent("test
agent", kbase, aconf);
kagent.applyChangeSet(ResourceFactory.newFileResource(changeSetFile));/
My question is: is there any possibility to create the classloader identical
to the remote classloader used by guvnor? if yes, could you please show us
exactly how to load remotelly from guvnor?
Here, at
http://ilesteban.wordpress.com/2010/06/22/knowledge-agent-custom-class-loaders/
http://ilesteban.wordpress.com/2010/06/22/knowledge-agent-custom-class-loaders/
there is described how to create a custom classloader, but it is not
specified how to create it based on the Guvnor's jar files already existing
there.
--
View this message in context: http://drools.46999.n3.nabble.com/unable-to-update-the-changes-guvnor-rules-to-application-using-changeset-tp3652824p3687543.html