[rules-users] Unable to resolve class x for identifier y
Bojan Janisch
bojan.janisch at scai.fraunhofer.de
Fri Jul 5 08:43:05 EDT 2013
Hey Wolfgang,
I'm generating rules automatically with a genetic algorithm, so I don't know how the rule looks like.
But the rule creation has constraints which will make each rule to something like this:
when
$[number]:Class(
(Some declarations),
[Optional check for something])
[Optional eval with random conditions to check]
...
then
...
So I'm not using "this" in a rule, never. Also not in the conclusion of the rule.
Here's a automatically generated rule:
rule "434"
no-loop
when
$0:NormalizedNamedEntity(
ct_0:CoveredText,
cp_0:Concept,
label_0:getConcept().getPrefLabel().value,
areOverlapping($0))
$1:NormalizedNamedEntity(
ct_1:CoveredText,
cp_1:Concept,
label_1:getConcept().getPrefLabel().value,
isLower($1,$0))
$2:NormalizedNamedEntity(
ct_2:CoveredText,
cp_2:Concept,
label_2:getConcept().getPrefLabel().value,
getConcept().identifierSource.toLowerCase.contains("anatomicpart"))
then
int start = getStart($0,$0,$1,$1,$0,$2);
int ende = getStop($0,$0,$1,$1,$0,$2);
String attribute = label_0+" "+label_0+" "+label_1+" "+label_1+" "+label_0+" "+label_2;
insert(annotate(aJCas, "de.cloud4health.odm.eprd.itemGroup.operation", 435, attribute, start, ende, "", attribute));
end
I'll try to reproduce the error and then write out the rule which throws the exception.
Greetings
Bojan
----- Ursprüngliche Mail -----
Von: "Wolfgang Laun" <wolfgang.laun at gmail.com>
An: "Rules Users List" <rules-users at lists.jboss.org>
Gesendet: Freitag, 5. Juli 2013 12:24:28
Betreff: Re: [rules-users] Unable to resolve class x for identifier y
Could be a bug.
Do you have a rule containing a pattern
NormalizedNamedEntity( this ... )
or similar? Or a trace showing which rule fires, and what it inserts?
If not, add logging - without this info it's hopeless.
-W
On 05/07/2013, Bojan Janisch <bojan.janisch at scai.fraunhofer.de> wrote:
> Hey everyone,
>
> I'm using Drools in a multithreaded environment where multiple
> KnowledgeBuilder and StatefulKnowledgeSessions are created parallel. Until
> now everything runs smooth, but suddenly I got this error:
>
> Exception in thread "ECJ Evaluation Thread 5"
> org.drools.RuntimeDroolsException: Unable to resolve class
> 'de.fraunhofer.scai.bio.extraction.types.text.NormalizedNamedEntity' for
> identifier 'this
> at
> org.drools.base.mvel.MVELCompilationUnit.getCompiledExpression(MVELCompilationUnit.java:231)
> at
> org.drools.rule.constraint.MvelConstraint.createMvelConditionEvaluator(MvelConstraint.java:206)
> at
> org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:190)
> at
> org.drools.rule.constraint.MvelConstraint.isAllowedCachedLeft(MvelConstraint.java:169)
> at
> org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaConstraints.java:125)
> at org.drools.reteoo.JoinNode.propagateFromLeft(JoinNode.java:105)
> at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:95)
> at
> org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
> at
> org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:71)
> at org.drools.reteoo.JoinNode.propagateFromRight(JoinNode.java:159)
> at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:148)
> at
> org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
> at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:497)
> at
> org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:382)
> at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
> at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
> at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
> at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
> at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
> at
> org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
> at
> org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
> at rulevolution.RulEvolution.runDrools(RulEvolution.java:310)
> at rulevolution.RulEvolution.evaluate(RulEvolution.java:161)
> at ec.simple.SimpleEvaluator.evalPopChunk(SimpleEvaluator.java:259)
> at
> ec.simple.SimpleEvaluator$SimpleEvaluatorThreadCG.run(SimpleEvaluator.java:341)
> at ec.util.ThreadPool$PoolThread.run(ThreadPool.java:57)
>
> I don't know why it happened, my program already ran for about 15 minutes.
> Could someone explain me what could cause such an error? I didn't find much
> information about it in the internet.
>
> Thanks and greetings
>
> Bojan
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
More information about the rules-users
mailing list