Runtime Java Exception - Firing rules (Drools Expert 5.2.1).
by groovenarula
Hello all,
We're getting the following exception executing our rules in Drools 5.2.1 :
WARN: Execution of JMS message listener failed
java.lang.NoClassDefFoundError: org/drools/factmodel/traits/Thing
at
org.drools.compiler.PackageBuilder.initBuiltinTypeDeclarations(PackageBuilder.java:332)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:310)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:205)
at
org.drools.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilder(KnowledgeBuilderFactoryServiceImpl.java:34)
at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:46)
at
com.anteil.lazboy.lzbws.pricing.AddDRTDRLRFToKBuilder.<init>(AddDRTDRLRFToKBuilder.java:31)
at
com.anteil.lazboy.lzbws.pricing.PricingUploadJMSConsumer.<init>(PricingUploadJMSConsumer.java:30)
at
com.anteil.lazboy.lzbws.pricing.DealerPricingUploadConsumer.<init>(DealerPricingUploadConsumer.java:11)
at
com.anteil.lazboy.lzbws.pricing.PricingUploadJMSConsumer.getConsumer(PricingUploadJMSConsumer.java:64)
at
com.anteil.lazboy.lzbws.pricing.PricingUploadJMSConsumer.executeUpload(PricingUploadJMSConsumer.java:82)
at
com.lazboy.lzbws.jms.message.PricingUploadValidationRequest.onMessage(PricingUploadValidationRequest.java:60)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:518)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:479)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.lang.ClassNotFoundException:
org.drools.factmodel.traits.Thing
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 20 more
The issue is that I can't seem to find the class
org.drools.factmodel.traits.Thing in any Drools 5.2.1 modules.
Can someone tell me the possible causes?
Thanks in advance
--
cheers
Gurvinder
--
View this message in context: http://drools.46999.n3.nabble.com/Runtime-Java-Exception-Firing-rules-Dro...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Runtime jitting exception while inserting facts
by sumatheja
Hi All,
I'm getting some wierd exception while trying to insert a fact. I'm
trying to compare a string field in a rule, like metricclass == "PROCESSOR"
java.lang.RuntimeException: Exception jitting: metricclass == "PROCESSOR"
at
org.drools.rule.constraint.MvelConstraint.jitEvaluator(MvelConstraint.java:168)
at
org.drools.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:137)
at
org.drools.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:99)
at org.drools.reteoo.AlphaNode.assertObject(AlphaNode.java:141)
at
org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:458)
at
org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:386)
at
org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:211)
at
org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:239)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:336)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:297)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:887)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:846)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:259)
at
mattelli.re.ComplianceEngine.loadProductMetricDB(ComplianceEngine.java:1644)
at
mattelli.re.ComplianceEngine.ComplianceRunService(ComplianceEngine.java:196)
at mattelli.re.ComplianceEngine.main(ComplianceEngine.java:80)
Caused by: java.lang.IllegalAccessError: tried to access field
org.drools.rule.builder.dialect.asm.ClassGenerator$MethodBody.mv from class
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator.jitMethodInvocation(ASMConditionEvaluatorJitter.java:463)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator.jitInvocation(ASMConditionEvaluatorJitter.java:447)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator.jitEvaluatedExpression(ASMConditionEvaluatorJitter.java:335)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator.jitExpression(ASMConditionEvaluatorJitter.java:324)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator.jitObjectBinary(ASMConditionEvaluatorJitter.java:132)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator.jitBinary(ASMConditionEvaluatorJitter.java:107)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator.jitSingleCondition(ASMConditionEvaluatorJitter.java:66)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator.jitCondition(ASMConditionEvaluatorJitter.java:54)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter$EvaluateMethodGenerator.body(ASMConditionEvaluatorJitter.java:48)
at
org.drools.rule.builder.dialect.asm.ClassGenerator$MethodDescr.write(ClassGenerator.java:478)
at
org.drools.rule.builder.dialect.asm.ClassGenerator.generateBytecode(ClassGenerator.java:50)
at
org.drools.rule.builder.dialect.asm.ClassGenerator.generateClass(ClassGenerator.java:58)
at
org.drools.rule.builder.dialect.asm.ClassGenerator.newInstance(ClassGenerator.java:64)
at
org.drools.rule.constraint.ASMConditionEvaluatorJitter.jit(ASMConditionEvaluatorJitter.java:30)
at
org.drools.rule.constraint.MvelConstraint.jitEvaluator(MvelConstraint.java:166)
... 15 more
Can someone tell me the possible causes. This happens with very few facts
making it even more confusing. Thanks in advance
--
cheers
Sumatheja Dasararaju
14 years, 3 months
Drools parser error accessing ArrayList.
by groovenarula
Hi,
I have a situation where I need to iterate over an ArrayList in the RHS of a
rule. The ArrayList is created in the LHS of the rule as follows :
rule "Hello World"
dialect "mvel"
when
$cur : Message()
$others : ArrayList ( size > 0 ) from collect(Message(status ==
$cur.status, this != $cur ))
then
for ( int ctr = 0; ctr < $others.size(); ctr++)
{
System.out.println((Message) $others.get(ctr));
}
end
This works in Drools 5.1.1.
However it gives the following parser error in Drools 5.2.X :
Unable to Analyse Expression for ( int ctr = 0; ctr < $others.size();
ctr++);
{
System.out.println((Message) $others.get(ctr));
} ;:
[Error: was expecting type: java.lang.Object; but found type:
<Unknown>]
[Near : {... for ( int ctr = 0; ctr < $othe ....}]
^
[Line: 6, Column: 0] : [Rule name='Hello World']
java.lang.IllegalArgumentException: Could not parse knowledge.
at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:50)
at com.sample.DroolsTest.main(DroolsTest.java:23)
What am I missing here ? Any insight on a possible solution is appreciated.
This has become a big stumbling block for us to move from 5.1.1 to 5.2.1.
Thanks in advance,
Gurvinder
--
View this message in context: http://drools.46999.n3.nabble.com/Drools-parser-error-accessing-ArrayList...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
WS Custom Form not working in Guvnor
by sams
I can provide all the info - select a Fact type, select a field, provide and
URL, and provide height and width. Click OK then File | Save changes.
However, it doesn't look like my form is actually getting saved. When I go
back to the tab its not there, and it doesn't appear in the guided editor
when working with the field that its mapped to.
Am using version 5.3.0 in Tomcat on Windows.
Any help is appreciated.
Thanks,
Sam
--
View this message in context: http://drools.46999.n3.nabble.com/WS-Custom-Form-not-working-in-Guvnor-tp...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Writing really short rules
by Adam Warski
Hello,
I have some near-tabular data which I would like to write down as rules.
There about 100 rows. Using a custom DSL, the shortest form I now have for
each entry is:
rule "..."
when some condition with data from row
then always the same action
end
so 4 lines.
Is it possible to somehow write it in one line? If I simply try to do that,
the parser complains (as I have a .dslr file).
Alternatively, is it possible to write down a decision table not in excel,
but using plain text? As this would work for me as well.
Thanks,
Adam
--
View this message in context: http://drools.46999.n3.nabble.com/Writing-really-short-rules-tp3903485p39...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Getting Exception while using Array in rules template
by Manikandan Subramanian
I am getting exception when using Array in combination with "in (...)".
Below is the exception
[Error: unable to resolve method: java.util.HashMap.countyName()
[arglength=0]]
and below is the template I have created
template header
stateName
countyName[]
totalPremium
package org.drools.bpmn2
template "Premium"
stateName
totalPremium
rule "Premium_(a){row.rowNumber}"
ruleflow-group "insurance premium"
when
Input(stateName == @{stateName}, countyName in (@{countyName}))
then
System.out.println("total premium " + @{totalPremium});
end
end template
the excel sheet is having the data, the column corresponds to countyName as
CSV value with variable number of variables either empty or 1 or 2 and so
on.
If I give the when like below it works (with countyName0 instead of
countyName).
when
Input(stateName == @{stateName}, countyName in (@{countyName0}))
Do I need to use foreach to generate the countyName sequence like
countyName0, countyName1 .. etc to put it in the "in (...)" condition?
I didnt find much documention about templates that covers foreach with in.
Please help. Any examples or samples would be helpful.
--
Thanks,
Mani
14 years, 3 months
is there any 'followed by' in Drools as we have in esper
by skatta1986
Hi,
Please any one let me know if there is any followed by operator in Drools. I
want to correlate an event with another event which follows the first event.
Esper supports this by using followed by (->) operator.
Example in esper:
"select r1.name as name,r1.userIPAddress as ipaddress,count(*) as
usr_success_count, (r2.getTimeStamp()-r1.getTimeStamp()) as delta_time from
pattern" +
"[ (every r1=EventRecord(eventNumber=105, eventType='EVENT_REQUEST'))-> " +
"(r2=EventRecord(eventNumber=110, eventType='EVENT_SUCCES',
id.getCallId()=r1.getId(), name=r1.name)) where
timer:within(usr_timeout_interval sec)]";
Can you please providesimilar kind of rule in Drools.
--
View this message in context: http://drools.46999.n3.nabble.com/is-there-any-followed-by-in-Drools-as-w...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months
Objects from Working Memory not available in drl
by Magublafix
Hey guys,
I'm playing with the drools planner a few days now and got stuck.
I have a Solution with an PlanningEntity Ambulance and a normal Class
SendAmbulance.
I add a List SendAmbulance to the Working Memory with the getProblemFacts()
method. The Ambulance objects are loaded automatically.
The problem now is that i can access the Ambulance Objects within the drl
correctly but nut the SendAmbulance objects.
Has somebody an advice for me to solve this?
thanks,
Magublafix
--
View this message in context: http://drools.46999.n3.nabble.com/Objects-from-Working-Memory-not-availab...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 3 months