I have problem in using drools in simple jBPM application. Every thing works
fine while it is runs under JUNIT but when I export it to jBPM i got
exception
org.jboss.resteasy.spi.UnhandledException:
org.drools.RuntimeDroolsException: Unable to resolve class
'myclass.jbpm.vrk.Claim'
org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319)
org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230)
org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360)
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93)
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59)
root cause
org.drools.RuntimeDroolsException: Unable to resolve class
'myclass.jbpm.vrk.Claim'
org.drools.base.ClassFieldAccessorCache.getClass(ClassFieldAccessorCache.java:269)
org.drools.base.ClassFieldAccessorCache.getReadAcessor(ClassFieldAccessorCache.java:241)
org.drools.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:379)
org.drools.base.ClassFieldAccessorStore.merge(ClassFieldAccessorStore.java:270)
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:466)
org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:379)
org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:121)
myclass.jbpm.drools.DroolsRulesManager.runDrlRule(Unknown Source)
My drl is very simple:
import myclass.jbpm.vrk.Claim;
rule "Rule 01"
when
$claim : Claim( $date : date, $elements : elements, $simpleClaim :
simpleClaim )
eval( $elements <= 10 )
then
$claim.setSimpleClaim( true );
System.out.println("It's a simple claim!: " + $date + ",
elements: "
+ $elements + ", simple: " + $simpleClaim);
end
The only way to solve it is to write new ClassLoader and pass it to
KnowledgeBuilderFactory.newKnowledgeBuilderConfiguration(null,
myNewClassLoader);
, or this error is caused by something else?
--
View this message in context:
http://n3.nabble.com/Drools-in-jBPM-tp103781p103781.html
Sent from the Drools - User mailing list archive at
Nabble.com.