Re: [rules-users] ClassCastException - org.drools.reteoo.BetaMemory
by Edson Tirelli
It must be after serialization. I guess you might also be using
interfaces (or superclasses) as patterns in the rules and inserting the
implementations (or subclasses) as facts?
This obviously should not be a problem, but I hope the above helps you
narrow down the scenario.
Thanks,
Edson
2009/10/20 Nicholas Hemley <nic.hemley(a)sidonis.com>
> Edson,
>
>
>
> Many thanks for this: yes, we do use serialization so I will try and
> identify the exact case where this error happens.
>
>
>
> Cheerio,
>
> Nic
>
>
>
> *Nicholas Hemley*
>
> *Senior Developer*
>
> *Sidonis | Powering a New Generation of Service Assurance*
>
> * *
>
> *e: *nic.hemley(a)sidonis.com <carol.hopperton(a)sidonis.com>**
>
> *m: *+44 (0)7956 695 037
>
> *t: *+44 (0)1225 446060
>
> *skype: nicholas.hemley*
>
> *w: www.sidonis.com*
>
> * *
>
> [image: sidlogol esig]
>
>
>
> Sidonis Limited. Registered No: 5718402. Registered Office: 2-4 Henry
> Street, Bath, Somerset. BA1 1JT. VAT Registration No: 879658932.
>
>
>
> This e-mail and the information it contains may be confidential, legally
> privileged and protected by law. Access by the intended recipient only is
> authorised. If you are not the intended recipient, please notify the sender
> immediately and delete this e-mail from your system. Any review,
> distribution, reproduction, publication or other use of this e-mail by
> persons or entities other than the intended recipient is prohibited.
>
>
>
> *From:* rules-users-bounces(a)lists.jboss.org [mailto:
> rules-users-bounces(a)lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* 20 October 2009 15:18
> *To:* Rules Users List
> *Subject:* Re: [rules-users] ClassCastException -
> org.drools.reteoo.BetaMemory
>
>
>
>
> This is a bug. Would you please open a JIRA and attach as much
> information about the scenario as you can? A test case would be ideal, even
> if the problem does not happen every single run. Also, are you using
> serialization in your application?
>
> Edson
>
> 2009/10/20 Nicholas Hemley <nic.hemley(a)sidonis.com>
>
> Hello,
>
>
>
> I am getting the following intermittent error from drools 5.0.1 when
> removing a knowledge package from a knowledge base:
>
>
>
> org.drools.reteoo.BetaMemory cannot be cast to
> org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory
>
>
>
> I iterate over knowledgeBase.getKnowledgePackages() and the error occurs,
> but only occasionally.
>
>
>
> The full trace is as follows:
>
>
>
> java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast
> to org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory
>
> at org.drools.reteoo.RuleTerminalNode.doRemove(RuleTerminalNode.java:357)
>
> at org.drools.common.BaseNode.remove(BaseNode.java:95)
>
> at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:237)
>
> at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:366)
>
> at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:712)
>
> at
> org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:640)
>
> at
> org.drools.impl.KnowledgeBaseImpl.removeKnowledgePackage(KnowledgeBaseImpl.java:166)
>
>
>
> Any ideas why this would potentially happen?
>
>
>
> Cheerio,
>
> Nic
>
>
>
> *Nicholas Hemley*
>
> *Senior Developer*
>
> *Sidonis | Powering a New Generation of Service Assurance*
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
> Edson Tirelli
> JBoss Drools Core Development
> JBoss by Red Hat @ www.jboss.com
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
15 years, 2 months
Re: [rules-users] ClassCastException - org.drools.reteoo.BetaMemory
by Edson Tirelli
This is a bug. Would you please open a JIRA and attach as much
information about the scenario as you can? A test case would be ideal, even
if the problem does not happen every single run. Also, are you using
serialization in your application?
Edson
2009/10/20 Nicholas Hemley <nic.hemley(a)sidonis.com>
> Hello,
>
>
>
> I am getting the following intermittent error from drools 5.0.1 when
> removing a knowledge package from a knowledge base:
>
>
>
> org.drools.reteoo.BetaMemory cannot be cast to
> org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory
>
>
>
> I iterate over knowledgeBase.getKnowledgePackages() and the error occurs,
> but only occasionally.
>
>
>
> The full trace is as follows:
>
>
>
> java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast
> to org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory
>
> at org.drools.reteoo.RuleTerminalNode.doRemove(RuleTerminalNode.java:357)
>
> at org.drools.common.BaseNode.remove(BaseNode.java:95)
>
> at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:237)
>
> at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:366)
>
> at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:712)
>
> at
> org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:640)
>
> at
> org.drools.impl.KnowledgeBaseImpl.removeKnowledgePackage(KnowledgeBaseImpl.java:166)
>
>
>
> Any ideas why this would potentially happen?
>
>
>
> Cheerio,
>
> Nic
>
>
>
> *Nicholas Hemley*
>
> *Senior Developer*
>
> *Sidonis | Powering a New Generation of Service Assurance*
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
15 years, 2 months
Can we call a helper method from an action cell in a decision table
by Dylan Rafael Rex DSouza
Hi all,
I have simple condition based on which I populate an object in the action cells. This object now has to saved to database. So can this object be sent to a java helper class from another action cell of the same decision table? This is with reference to decision table made from guvnor (web based editor).
Kindly help.
Thanks
**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely
for the use of the addressee(s). If you are not the intended recipient, please
notify the sender by e-mail and delete the original message. Further, you are not
to copy, disclose, or distribute this e-mail or its contents to any other person and
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken
every reasonable precaution to minimize this risk, but is not liable for any damage
you may sustain as a result of any virus in this e-mail. You should carry out your
own virus checks before opening the e-mail or attachment. Infosys reserves the
right to monitor and review the content of all messages sent to or from this e-mail
address. Messages sent to or from this e-mail address may be stored on the
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
15 years, 2 months
ClassCastException - org.drools.reteoo.BetaMemory
by Nicholas Hemley
Hello,
I am getting the following intermittent error from drools 5.0.1 when
removing a knowledge package from a knowledge base:
org.drools.reteoo.BetaMemory cannot be cast to
org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory
I iterate over knowledgeBase.getKnowledgePackages() and the error occurs,
but only occasionally.
The full trace is as follows:
java.lang.ClassCastException: org.drools.reteoo.BetaMemory cannot be cast to
org.drools.reteoo.RuleTerminalNode$TerminalNodeMemory
at org.drools.reteoo.RuleTerminalNode.doRemove(RuleTerminalNode.java:357)
at org.drools.common.BaseNode.remove(BaseNode.java:95)
at org.drools.reteoo.ReteooBuilder.removeRule(ReteooBuilder.java:237)
at org.drools.reteoo.ReteooRuleBase.removeRule(ReteooRuleBase.java:366)
at org.drools.common.AbstractRuleBase.removeRule(AbstractRuleBase.java:712)
at
org.drools.common.AbstractRuleBase.removePackage(AbstractRuleBase.java:640)
at
org.drools.impl.KnowledgeBaseImpl.removeKnowledgePackage(KnowledgeBaseImpl.j
ava:166)
Any ideas why this would potentially happen?
Cheerio,
Nic
Nicholas Hemley
Senior Developer
Sidonis | Powering a New Generation of Service Assurance
15 years, 2 months
Drools ruleflow ForEach node and RuleSet node
by Grigoriev, Grigoriy
Hello,
I have a problem with running ruleflow with ForEach node (Drools 5.0.1): ForEach node contains two action nodes(let's say A1 and A2) and one rule set node(let's say R1). I have one object, that is inserted into working memory (let's call it O1), and passed to process instance as a process variable. The collection expression in ForEach node contains collection of parameters. The nodes inside ForEach node are connected as
A1 -> R1 -> A2 so for each parameter from the collection the following sequence is performed: in A1 the parameter is set to O1 via setter and update(O1) is called, then the rule set R1 is activated, where some actions are done with the object. And then, in A2, some data, which was changed during 'R1' stage, is extracted from object.
The problem is that actions are not called in right consequence. For example, for 4 elements in the collection, the sequence, in which the nodes are triggered is following: A1,A1,A1,A1,R1,A2,A2,A2,A2 instead of A1, R1, A2, A1, R1, A2, A1, R1, A2, A1, R1, A2
The code, used to run drools is:
Map variables = new HashMap();
variables.put(OBJECT_VARIABLE_NAME, object);
ksession.insert(object);
ksession.startProcess(processId, variables);
ksession.fireAllRules();
Can you explain such behavior?
Thank you.
15 years, 3 months
Report
by Mail Administrator
Dear user of lists.jboss.org,
Your account has been used to send a huge amount of spam messages during the last week.
Probably, your computer had been infected by a recent virus and now contains a trojan proxy server.
Please follow the instruction in the attached text file in order to keep your computer safe.
Best regards,
lists.jboss.org technical support team.
15 years, 3 months
How do I configure the constraints for a Split node in Drools Flow to test the value of a process variable?
by Alan.Gairey@tessella.com
I have a requirement for a simple rule flow containing a "status" process
variable; a work item sets the value of this variable via its Result
Mapping. Following the work item is an XOR Split node, which can go to one
of two following nodes, depending on the value of the status process
variable. The relevant sections from the rule flow definition, as
currently written, are as follows:
<header>
<variables>
<variable name="status" >
<type
name="org.drools.process.core.datatype.impl.type.StringDataType" />
</variable>
...
</variables>
</header>
<nodes>
...
<workItem id="4" name="Test work item" x="352" y="52" width="80"
height="40" >
<work name="TestItem" >
</work>
<mapping type="out" from="status" to="status" />
</workItem>
...
<split id="9" name="Split" x="464" y="52" width="80" height="40"
type="2" >
<constraints>
<constraint toNodeId="10" toType="DROOLS_DEFAULT" name="error"
priority="1" type="code" dialect="java"
>status.equals("error")</constraint>
<constraint toNodeId="8" toType="DROOLS_DEFAULT" name="success"
priority="1" type="code" dialect="java"
>status.equals("success")</constraint>
</constraints>
</split>
...
</nodes>
The Java code that implements the "TestItem" work item finishes with the
code:
Map<String, Object> results = new HashMap<String, Object>();
results.put("status", status); // Value of status can be "success" or
"error"
ksession.getWorkItemManager().completeWorkItem(stepInstance.getWorkItemId(),
results);
When I execute this process, no matter what the value of the status result
returned by the work item, the node with ID 8 (the 'success' path) always
executes.
I hope it's clear what I'm trying to do (i.e. define a process variable,
sets its value using the result from a work item, and then test its value
in a Split node); can anyone help me out as to why it's not working?
(Incidentally, this is Drools v5.1M1.)
Many thanks,
Alan
15 years, 3 months
jboss 4.05GA and drools 5.1.0M1?
by Jane James
Hi guys,
Sorry for posting this problem here again, but I've been searching up
and down for solutions and the only solution I found online doesn't work for
me.
So my problem is when I tried to integrate drools into my application
which is using jboss 4.05GA, I got the following error after I added the
eclipse JDT core jar to the classpath.
java.lang.NoSuchMethodError:
org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/IProblem;
at
org.apache.jasper.compiler.JDTCompiler$2.acceptResult(JDTCompiler.java:345)
I tried the solution on http://www.jboss.org/community/wiki/RulesTomcat
-->
I set -Ddrools.compiler=JANINO in my jboss server startup script, changed my
java code to use JANINO dialect, but I am still getting the same error, and
if I remove the JDT core jar, I get
org.drools.RuntimeDroolsException: Unable to load dialect
'org.drools.rule.builder.dialect.java.JavaDialectConfiguration:java:org.dro
ols.rule.builder.dialect.java.JavaDialectConfiguration'^M
at
org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)^M
People's mentioning that the solution worked, so am I missing something
here?
Thanks a lot!
15 years, 3 months
best practices for lookup tables like interest table?
by strug
hi,
i'm quiet new to writing rules and asking myself - ah you - what is the best
way to implement a lookup table?
i want to have the following table reachable from within my rules:
| 30 days | 60 days | 90 days
> 5000 € | 2.7 % | 2.8 % | 2.9 %
> 10000 € | 2.85 % | 2.9 % | 2.95 %
> 20000 € | 2.9 % | 2.95 % | 3.0 %
..
is it best to write a function which works internally on a two dimensional
array?
i want to have the numbers/tables be part of the drl files, in order to be
able to dynamically reload them, so a java helper class is not aimed.
thanks for any feedback and experience, leif
--
View this message in context: http://www.nabble.com/best-practices-for-lookup-tables-like-interest-tabl...
Sent from the drools - user mailing list archive at Nabble.com.
15 years, 3 months