[JBoss JIRA] Created: (JBCLUSTER-140) Examine need for a distributed service registry outside the AS
by Brian Stansberry (JIRA)
Examine need for a distributed service registry outside the AS
--------------------------------------------------------------
Key: JBCLUSTER-140
URL: http://jira.jboss.com/jira/browse/JBCLUSTER-140
Project: JBoss Clustering
Issue Type: Sub-task
Security Level: Public (Everyone can see)
Reporter: Brian Stansberry
Assigned To: Brian Stansberry
Fix For: Q3Y6
Is something like DRM needed outside the AS? If it is, do we want to use the JBoss Cache based version (creates JBC dependency.)
DRM is used in two ways:
1) To maintain a distributed registry of remote invocation targets.
2) To maintain a distributed registry of services, which is done by having the service register a meaningless token under its key rather than a target. This is used by HASingleton.
Need to examine whether this kind of thing is needed by Messaging, or whether simple listening for view changes is sufficient. Listening for view changes could be sufficient if each group member knew how to create a Remoting InvokerLocator for the other members based on the JGroups Address. But, this presupposes use of consistent ports across the cluster, and that the IP address used by JGroups is the one that Messaging traffic should use.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 11 months
[JBoss JIRA] Created: (JGRP-1007) Flush: change signature of JChannel#startFlush to include checked exception
by Vladimir Blagojevic (JIRA)
Flush: change signature of JChannel#startFlush to include checked exception
---------------------------------------------------------------------------
Key: JGRP-1007
URL: https://jira.jboss.org/jira/browse/JGRP-1007
Project: JGroups
Issue Type: Task
Affects Versions: 2.6, 2.8
Reporter: Vladimir Blagojevic
Assignee: Vladimir Blagojevic
Fix For: 3.0
We have to change signature of startFlush method to include checked exceptions in its signature. We have previously relied on boolean return value of startFlush to get information about success of startFlush method invocation. This approach has been proven to be insufficient, particularly in the light of dealing with [JGRP-985]. We need to discriminate various reasons why startFlush failed, i.e due flush collision, missing response from flush member and so on. Therefore, starting with release 3.0 startFlush method will be void and will throw checked exceptions.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 11 months
[JBoss JIRA] Created: (SECURITY-438) LdapAttributeMappingProvider should check for empty attribute list
by Anil Saldhana (JIRA)
LdapAttributeMappingProvider should check for empty attribute list
------------------------------------------------------------------
Key: SECURITY-438
URL: https://jira.jboss.org/jira/browse/SECURITY-438
Project: JBoss Security and Identity Management
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: JBossSX
Affects Versions: JBossSecurity_2.0.4.SP1
Reporter: Anil Saldhana
Assignee: Anil Saldhana
=============
java.lang.NullPointerException
at java.util.StringTokenizer.<init>(StringTokenizer.java:182)
at java.util.StringTokenizer.<init>(StringTokenizer.java:204)
at org.jboss.security.mapping.providers.attribute.LdapAttributeMappingProvider.getNeededAttributes(LdapAttributeMappingProvider.java:336)
at org.jboss.security.mapping.providers.attribute.LdapAttributeMappingProvider.performMapping(LdapAttributeMappingProvider.java:204)
at org.jboss.security.mapping.providers.attribute.LdapAttributeMappingProvider.performMapping(LdapAttributeMappingProvider.java:93)
at org.jboss.security.mapping.MappingContext.performMapping(MappingContext.java:54)
==================
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 11 months
[JBoss JIRA] Created: (JBRULES-1908) updated Drools docs content from SOA 4.2.CP03 Rules Guide
by Darrin Mison (JIRA)
updated Drools docs content from SOA 4.2.CP03 Rules Guide
---------------------------------------------------------
Key: JBRULES-1908
URL: https://jira.jboss.org/jira/browse/JBRULES-1908
Project: JBoss Drools
Issue Type: Task
Security Level: Public (Everyone can see)
Components: drools-docs-expert
Reporter: Darrin Mison
Assignee: Mark Proctor
I revised the language of the "Insertion" section while fixing a couple of reported grammatical errors for the 4.2.CP03 SOA Rules Guide.
The original language is the same in: http://anonsvn.jboss.org/repos/labs/labs/jbossrules/soa_tags/4.3.0.FP01_B... , so these changes would also apply to the most recent docs.
Updated content below, the section ids are different but you get the idea ;-)
<section id="sect-JBoss_Rules_Reference_Manual-WorkingMemory_and_StatefulStateless_Sessions-Insertion">
<title>Insertion</title>
<para>
<firstterm>Insertion</firstterm> is the act of telling the WorkingMemory about the facts.
</para>
<important>
<para>
In many Expert Systems the term used for this concept is
<firstterm>assert</firstterm> or <firstterm>assertion</firstterm>.
However as the keyword <methodname>assert</methodname> is already used
in many languages, Drools uses the keyword & term <methodname>insert</methodname>.
You will often encounter these terms used interchangably in discussion of
Rules Engines.
</para>
</important>
<para>
When inserted, the rule is examined for matches against the rules. The work
of determining what rules to fire is done during insertion, but no rules are
executed at this time. The rules are executed when
<methodname>fireAllRules()</methodname> is called, and it should only be called
after you have inserted all your facts.
</para>
<para>
It is a common misconception that rule matching occurs when
<methodname>fireAllRules()</methodname> is called.
</para>
<para>
When an Object is inserted it returns a FactHandle. This FactHandle is the
token used to represent your inserted Object inside the WorkingMemory, it is
also how you will interact with the Working Memory when you wish to retract
or modify an object.
</para>
<programlisting language="java">Cheese stilton = new Cheese("stilton");
FactHandle stiltonHandle = session.insert( stilton );</programlisting>
<para>
As mentioned in
<xref linkend="sect-JBoss_Rules_Reference_Manual-The_Drools_Rule_Engine-RuleBase" />
a Working Memory can operate in two assertions modes: <firstterm>equality</firstterm>
and <firstterm>identity</firstterm>. Identity is the default mode. The assertion
mode determines how the Working Memory stores the facts and how it compares the
newly inserted fact to previously inserted ones. If the Working Memory
determines the fact to "be the same" as an already inserted one it will ignore
the new fact and return the FactHandle for the previously inserted one.
</para>
<variablelist>
<varlistentry>
<term>Identity</term>
<listitem>
<para>
Identity Mode uses an <classname>IdentityHashMap</classname>to store all
asserted Objects. New facts being inserted are compared to existing facts
"by reference". A new FactHandle will be returned if the object being
inserted is not a reference to an object that has been inserted previously.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>Equality</term>
<listitem>
<para>
Equality Mode uses a <classname>HashMap</classname> to store all asserted
Objects. New facts being inserted are compared to existing facts "by value".
A new FactHandle will be returned if the content of the object is not
identical to that of a previously inserted object.
</para>
</listitem>
</varlistentry>
</variablelist>
</section>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBAS-7427) AS won't boot with sun jmx enabled
by Jonathan Halliday (JIRA)
AS won't boot with sun jmx enabled
----------------------------------
Key: JBAS-7427
URL: https://jira.jboss.org/jira/browse/JBAS-7427
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Logging
Environment: sun jdk6, fedora, AS trunk r96005
Reporter: Jonathan Halliday
Assignee: David Lloyd
Fix For: JBossAS-6.0.0.Alpha1
[jhalli jboss-6.0.0-SNAPSHOT]$ export JAVA_OPTS="-Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
[jhalli jboss-6.0.0-SNAPSHOT]$ bin/run.sh
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /home/jhalli/IdeaProjects/jboss/jbossas_trunk/build/output/jboss-6.0.0-SNAPSHOT
JAVA: /usr/local/jdk1.6.0_16/bin/java
JAVA_OPTS: -Dprogram.name=run.sh -server -Dcom.sun.management.jmxremote.port=12345 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Djava.net.preferIPv4Stack=true
CLASSPATH: /home/jhalli/IdeaProjects/jboss/jbossas_trunk/build/output/jboss-6.0.0-SNAPSHOT/bin/run.jar:/usr/local/jdk1.6.0_16/lib/tools.jar
=========================================================================
Failed to initalize plugin: org.jboss.logging.logmanager.LoggerPluginImpl@214a55f2, cause: java.lang.IllegalStateException: The LogManager was not properly installed (you must set the "java.util.logging.manager" system property to "org.jboss.logmanager.LogManager")
...
Failed to initalize plugin: org.jboss.aop.util.logging.SystemOutLoggerPlugin@5c1ae90c, cause: java.lang.AbstractMethodError
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2292) event feed class hangs when using fireUntilHalt
by Jeff DeLong (JIRA)
event feed class hangs when using fireUntilHalt
-----------------------------------------------
Key: JBRULES-2292
URL: https://jira.jboss.org/jira/browse/JBRULES-2292
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (fusion)
Environment: Eclipse 3.5 with JBoss Tools JBoss Drools Core 5.1.0.truck-N200908260601-H218 using Drools Runtime drools-5.1.0.SNAPSHOT-bin from Sept 10, 2009
Reporter: Jeff DeLong
Assignee: Mark Proctor
I added a new test to my project: KioskRulesTwoThreadsTest that calls another class InsertEvents in a separate thread, then calls fireUntilHalt. InsertEvents inserts three facts and then three events three times, then mysteriously stops. All I see in the AuditLog is the 12 Object inserted (well and a single Object removed).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2203) NullPointerException When Using Conditional Element "or" in LHS Together with a Return Value Restriction
by Christian Spurk (JIRA)
NullPointerException When Using Conditional Element "or" in LHS Together with a Return Value Restriction
--------------------------------------------------------------------------------------------------------
Key: JBRULES-2203
URL: https://jira.jboss.org/jira/browse/JBRULES-2203
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.0.1.FINAL
Environment: Drools 5.0.1 used in an Eclipse Drools project under Windows XP with Java 1.6
Reporter: Christian Spurk
Assignee: Mark Proctor
When using the conditional element "or" on the left hand side of a rule together with a return value restriction somewhere in the same rule, I get the following exception:
Exception in thread "main" java.lang.NullPointerException
at org.drools.rule.ReturnValueRestriction.equals(ReturnValueRestriction.java:304)
at org.drools.rule.ReturnValueConstraint.equals(ReturnValueConstraint.java:121)
at org.drools.reteoo.AlphaNode.equals(AlphaNode.java:218)
at org.drools.reteoo.SingleObjectSinkAdapter.getMatchingNode(SingleObjectSinkAdapter.java:48)
at org.drools.reteoo.builder.BuildUtils.attachNode(BuildUtils.java:130)
at org.drools.reteoo.builder.PatternBuilder.attachAlphaNodes(PatternBuilder.java:295)
at org.drools.reteoo.builder.PatternBuilder.attachPattern(PatternBuilder.java:117)
at org.drools.reteoo.builder.PatternBuilder.build(PatternBuilder.java:70)
at org.drools.reteoo.builder.GroupElementBuilder$AndBuilder.build(GroupElementBuilder.java:126)
at org.drools.reteoo.builder.GroupElementBuilder.build(GroupElementBuilder.java:73)
at org.drools.reteoo.builder.ReteooRuleBuilder.addSubRule(ReteooRuleBuilder.java:153)
at org.drools.reteoo.builder.ReteooRuleBuilder.addRule(ReteooRuleBuilder.java:126)
at org.drools.reteoo.ReteooBuilder.addRule(ReteooBuilder.java:117)
at org.drools.reteoo.ReteooRuleBase.addRule(ReteooRuleBase.java:362)
at org.drools.common.AbstractRuleBase.addRule(AbstractRuleBase.java:618)
at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:500)
at org.drools.reteoo.ReteooRuleBase.addPackages(ReteooRuleBase.java:379)
at org.drools.impl.KnowledgeBaseImpl.addKnowledgePackages(KnowledgeBaseImpl.java:121)
at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:48)
at com.sample.DroolsTest.main(DroolsTest.java:26)
Here is a simple test case which can be used to reproduce the issue:
/* JAVA FILE TO LOAD THE RULE */
package com.sample;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderError;
import org.drools.builder.KnowledgeBuilderErrors;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
public class DroolsTest {
private int arg;
public int getArg() {
return this.arg;
}
public void setArg(int arg) {
this.arg = arg;
}
public static final void main(String[] args) throws Exception {
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
DroolsTest test = new DroolsTest();
test.setArg(2);
ksession.insert(test);
ksession.fireAllRules();
}
/* taken verbatim from the Hello World sample */
private static KnowledgeBase readKnowledgeBase() throws Exception {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory
.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("Sample.drl"),
ResourceType.DRL);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
for (KnowledgeBuilderError error : errors) {
System.err.println(error);
}
throw new IllegalArgumentException("Could not parse knowledge.");
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
return kbase;
}
}
/* PROBLEMATIC RULE FILE */
package com.sample
import com.sample.DroolsTest;
rule "test"
when
DroolsTest( arg == (1 + 1) );
// REMOVE THE COMMENTED PARTS BELOW TO GET THE EXCEPTION:
//(or eval(true);
eval(true);
//)
then
System.out.println( "it works!" );
end
When the above Java file is compiled and run in combination with the given rule file, everything works fine. However, if the marked parts of the rule are uncommented, then you get the exception.
PS: It seems that the issue has been existing in previous Drools versions already, see https://jira.jboss.org/jira/browse/JBSEAM-3064 for example ("Drools 4.0.7 don't like 'action == (DocumentType.USER.extendedName())' and multiple OR's - weird!").
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2211) StatefulKnowledgeSession leaves threads running
by Edson Tirelli (JIRA)
StatefulKnowledgeSession leaves threads running
-----------------------------------------------
Key: JBRULES-2211
URL: https://jira.jboss.org/jira/browse/JBRULES-2211
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.0.1.FINAL, 5.0.0.FINAL
Reporter: Edson Tirelli
Assignee: Edson Tirelli
Fix For: 5.1.0.M1
Hi all,
I've downloaded Drools fusion sample and started to make some changes to
the code (first of all wipe out the UI so I can test it easier).
I tried to get to a minimal set so I can run a console main class and see
what happens but I am facing a strange behaviour.
As soon as I start pushing events into the WorkingMemoryEntryPoint
("StockTick stream") a Thread - not daemonized since it blocks shutdown from
ending - is spawned and this prevents my JVM from shutting down (obviously
if I call System.exit(0) it will but I am avoiding this).
I've tried both to halt and dispose the session that this entry point
belongs but with no success. Does anyone know how could I get rid of this
thread?
==================
Hi Edson!
as I've already mentioned I've modified the sample so, if you get the StockTick sample and replace the Main class this will run fine.
The sample shuts down fine but as I saw it sets the JFrame uses frame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE ); which in turn makes the trick.
Below the code of my modified main class:
package org.drools.examples.broker;
import org.drools.KnowledgeBase;
import org.drools.KnowledgeBaseConfiguration;
import org.drools.KnowledgeBaseFactory;
import org.drools.builder.KnowledgeBuilder;
import org.drools.builder.KnowledgeBuilderFactory;
import org.drools.builder.ResourceType;
import org.drools.conf.EventProcessingOption;
import org.drools.examples.broker.model.Company;
import org.drools.examples.broker.model.CompanyRegistry;
import org.drools.examples.broker.model.StockTick;
import org.drools.io.ResourceFactory;
import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.rule.WorkingMemoryEntryPoint;
public class Main {
private static final String RULES_FILE = "/broker.drl";
static StatefulKnowledgeSession session;
static WorkingMemoryEntryPoint tickStream;
/**
* @param args
*/
public static void main(String[] args) throws Exception {
// set up and show main window
CompanyRegistry companies = new CompanyRegistry();
KnowledgeBuilder builder = KnowledgeBuilderFactory.newKnowledgeBuilder();
try {
builder.add( ResourceFactory.newInputStreamResource( Main.class.getResourceAsStream( RULES_FILE ) ),
ResourceType.DRL);
} catch ( Exception e ) {
e.printStackTrace();
}
if( builder.hasErrors() ) {
System.err.println(builder.getErrors());
System.exit( 0 );
}
KnowledgeBaseConfiguration conf = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
conf.setOption( EventProcessingOption.STREAM );
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase( conf );
kbase.addKnowledgePackages( builder.getKnowledgePackages() );
session = kbase.newStatefulKnowledgeSession();
session.setGlobal( "services", new BrokerServices() {
public void log(String message) {
System.out.println(message);
}
});
for( Company company : companies.getCompanies() ) {
session.insert( company );
}
session.fireAllRules();
tickStream = session.getWorkingMemoryEntryPoint( "StockTick stream" );
for (int i=10;i>0;i--) {
tickStream.insert(new StockTick("RHT", i*10, System.currentTimeMillis()));
session.getAgenda().getAgendaGroup( "evaluation" ).setFocus();
session.fireAllRules();
}
session.dispose();
session.halt();
System.out.println("Still running...");
}
}
regards,
Rafael Ribeiro
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2380) KnowledgeBuilderImpl.add(...) throws org.mvel2.CompileException when executed concurrently for the same resource
by Grigoriy Grigoriev (JIRA)
KnowledgeBuilderImpl.add(...) throws org.mvel2.CompileException when executed concurrently for the same resource
----------------------------------------------------------------------------------------------------------------
Key: JBRULES-2380
URL: https://jira.jboss.org/jira/browse/JBRULES-2380
Project: Drools
Issue Type: Quality Risk
Security Level: Public (Everyone can see)
Environment: Drools 5.0.1
core 2 duo @ 2.6 ghz, win xp prof sp3, sun jdk 1.6.0_17
Pentium Dual CPU E2160 @ 1.8GHz, XP prof SP3, sun jdk 1.6.0_16.
Reporter: Grigoriy Grigoriev
Assignee: Mark Proctor
Let us assume a multithreaded application, that tries to initialise & start several processes using a StatefulKnowledgeSession in order to use in these processes rule flow. The flow in all the processes is the same but every process instance must have an own StatefulKnowledgeSession instance because of stateful session.
Actually the problem:
At the initializing phase occurs an org.mvel2.CompileException exception from time to time at KnowledgeBuilder.add(...):
Exception in thread "Thread-60" [Error: incomplete statement: (possible use of reserved keyword as identifier: )]
[Near : {... globals != empt ....}]
^
[Line: 0, Column: 0]
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:153)
at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:44)
at org.mvel2.MVEL.eval(MVEL.java:514)
at org.mvel2.templates.res.IfNode.eval(IfNode.java:61)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.TerminalNode.eval(TerminalNode.java:39)
at org.mvel2.templates.res.ForEachNode.eval(ForEachNode.java:116)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.TerminalNode.eval(TerminalNode.java:39)
at org.mvel2.templates.res.IfNode.eval(IfNode.java:64)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:195)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:190)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:180)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:169)
at org.drools.rule.builder.dialect.java.AbstractJavaRuleBuilder.generatTemplates(AbstractJavaRuleBuilder.java:126)
at org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:128)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:86)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at com.myfirm.RuleFlowProcess.init(RuleFlowProcess.java:25)
at com.myfirm.RuleFlowProcess.clone(RuleFlowProcess.java:53)
at com.myfirm.ThreadTest$CloneThread.run(ThreadTest.java:35)
Caused by: java.lang.NullPointerException
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:113)
... 27 more
Exception in thread "Thread-72" [Error: incomplete statement: (possible use of reserved keyword as identifier: )]
[Near : {... declarations != empt ....}]
^
[Line: 0, Column: 0]
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:153)
at org.mvel2.MVELInterpretedRuntime.parse(MVELInterpretedRuntime.java:44)
at org.mvel2.MVEL.eval(MVEL.java:514)
at org.mvel2.templates.res.IfNode.eval(IfNode.java:61)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.TerminalNode.eval(TerminalNode.java:39)
at org.mvel2.templates.res.ForEachNode.eval(ForEachNode.java:116)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.TerminalNode.eval(TerminalNode.java:39)
at org.mvel2.templates.res.ForEachNode.eval(ForEachNode.java:116)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.res.ExpressionNode.eval(ExpressionNode.java:53)
at org.mvel2.templates.res.TextNode.eval(TextNode.java:46)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:195)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:190)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:180)
at org.mvel2.templates.TemplateRuntime.execute(TemplateRuntime.java:169)
at org.drools.rule.builder.dialect.java.AbstractJavaRuleBuilder.generatTemplates(AbstractJavaRuleBuilder.java:135)
at org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaConsequenceBuilder.java:128)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:86)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at com.myfirm.RuleFlowProcess.init(RuleFlowProcess.java:25)
at com.myfirm.RuleFlowProcess.clone(RuleFlowProcess.java:53)
at com.myfirm.ThreadTest$CloneThread.run(ThreadTest.java:35)
Caused by: java.lang.NullPointerException
at org.mvel2.MVELInterpretedRuntime.parseAndExecuteInterpreted(MVELInterpretedRuntime.java:113)
... 33 more
To demonstrate this problem I have created a simple test maven project that reproduces this error (s. attach):
I have a class that creates & inits stateful knowledge session in a init method (RuleFlowProcess):
/**
* inits the rule flow
*/
public class RuleFlowProcess {
private StatefulKnowledgeSession ksession;
public void init() {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("threadSafeTest.rf"), ResourceType.DRF);
kbuilder.add(ResourceFactory.newClassPathResource("testRules1.drl"), ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("testRules2.drl"), ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("testRules3.drl"), ResourceType.DRL);
kbuilder.add(ResourceFactory.newClassPathResource("testRules4.drl"), ResourceType.DRL);
KnowledgeBuilderErrors errors = kbuilder.getErrors();
if (errors.size() > 0) {
StringBuilder errorString = new StringBuilder();
for (KnowledgeBuilderError error : errors) {
errorString.append(error);
}
throw new RuntimeException(errorString.toString());
}
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(kbuilder.getKnowledgePackages());
ksession = kbase.newStatefulKnowledgeSession();
}
...
}
I create & init concurrently in several (200) threads this RuleFlowProcess and some threads crash with this exceptions while adding the resources.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2335) StackOverflowError on serialization of KnowledgeBase
by Justin Waugh (JIRA)
StackOverflowError on serialization of KnowledgeBase
----------------------------------------------------
Key: JBRULES-2335
URL: https://jira.jboss.org/jira/browse/JBRULES-2335
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.0.1.FINAL
Environment: Windows, JDK 1.6
Reporter: Justin Waugh
Assignee: Mark Proctor
This is a bit of a duplicate of another issue, which I will link, however I only tested against 5.0.1 and I have a proposed solution which I believe is only applicable to 5.0.1 +
The problem is of course, that when serializing a KnowledgeBase with a very large amount of rules, it can potentially cause a StackOverflowError on serialization. As far as I can tell this is due to the linked lists held by ObjectSinkNodeList and LeftTupleSinkNodeList. The problem is that they recursively serialize the list, by serializing the first node, which serializes its next node, which serializes its next node.... and so on. This was a bit harder to solve in the 4.0+ case I think as it relied purely on the built in java serialization. However in 5.0+ those classes all use write/readExternal to do their own serialization. That makes it a bit easier to solve, as we can now implement an iterative serialization for the lists.
The problem code looks like this:
ObjectSinkNodeList (also applies to LeftTupleSinkNodeList):
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
firstNode = (ObjectSinkNode) in.readObject();
lastNode = (ObjectSinkNode) in.readObject();
size = in.readInt();
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject( firstNode );
out.writeObject( lastNode );
out.writeInt( size );
}
AlphaNode (and all others implementing ObjectSinkNode, and similarly LeftTupleSinkNode):
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
super.readExternal( in );
constraint = (AlphaNodeFieldConstraint) in.readObject();
previousRightTupleSinkNode = (ObjectSinkNode) in.readObject();
nextRightTupleSinkNode = (ObjectSinkNode) in.readObject();
}
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal( out );
out.writeObject( constraint );
out.writeObject( previousRightTupleSinkNode );
out.writeObject( nextRightTupleSinkNode );
}
As you can see it recursively serializes the list, so the stack depth increases linearly with the list length.
The solution is this:
ObjectSinkNodeList (also applies to LeftTupleSinkNodeList):
public void readExternal(ObjectInput in) throws IOException,
ClassNotFoundException {
firstNode = (ObjectSinkNode) in.readObject();
lastNode = (ObjectSinkNode) in.readObject();
size = in.readInt();
ObjectSinkNode current = firstNode;
while(current != null)
{
ObjectSinkNode previous = (ObjectSinkNode) in.readObject();
ObjectSinkNode next = (ObjectSinkNode) in.readObject();
current.setPreviousObjectSinkNode(previous);
current.setNextObjectSinkNode(next);
current = next;
}
}
public void writeExternal(ObjectOutput out) throws IOException {
out.writeObject( firstNode );
out.writeObject( lastNode );
out.writeInt( size );
for (ObjectSinkNode node = firstNode; node != null; node = node.getNextObjectSinkNode())
{
out.writeObject(node.getPreviousObjectSinkNode());
out.writeObject(node.getNextObjectSinkNode());
}
}
AlphaNode (and all others implementing ObjectSinkNode, and similarly LeftTupleSinkNode):
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal( out );
out.writeObject( constraint );
}
public AlphaNodeFieldConstraint getConstraint() {
return this.constraint;
}
As you can see the responsibility for serializing the list node links is now placed into the list objects themselves, and is performed iteratively. I suppose technically the lastNode reference of the list doesn't need to be stored separately, but it was just easier code.
The obvious concern here is if for some reason you had linked nodes which were not held by one of the list objects, then the links would be lost. However I checked references to the get/set of the prev/next, and they were only referenced by the list objects themselves, so I believe there is no chance for that to happen.
I'll attach a test case (but it's just the one from the linked ticket)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2278) NPE after knowledgebase updated when using entrypoints
by Michael Neale (JIRA)
NPE after knowledgebase updated when using entrypoints
------------------------------------------------------
Key: JBRULES-2278
URL: https://jira.jboss.org/jira/browse/JBRULES-2278
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core, drools-core (expert), drools-core (fusion)
Affects Versions: 5.0.1.FINAL
Reporter: Michael Neale
Assignee: Edson Tirelli
Fix For: 5.1.0.M1
Raised by Nestor Burriel on the dev list:
I've tried to configure my rule engine obtaining unexpected behaviour.
I configure my statefulSession as follows:
wm = (ReteooStatefulSession) ((KnowledgeBaseImpl) kagent
.getKnowledgeBase()).ruleBase.newStatefulSession(
(SessionConfiguration) sessionConf, env);
ksession = new StatefulKnowledgeSessionImpl(wm, kagent.getKnowledgeBase());
And after updating the KnowledgeBase in the agent I update my ksession:
wm.setRuleBase((InternalRuleBase) ((KnowledgeBaseImpl) kagent
.getKnowledgeBase()).ruleBase);
ksession = new StatefulKnowledgeSessionImpl(wm, kagent.getKnowledgeBase());
Without using entry-points this approach works as expected, but using them
it fails after the first update throwing the error:
Exception while processing message: java.lang.NullPointerException
java.lang.NullPointerException
at
org.drools.reteoo.ReteooFactHandleFactory.newFactHandle(ReteooFactHandleFactory.java:54)
at
org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:79)
at
org.drools.common.AbstractFactHandleFactory.newFactHandle(AbstractFactHandleFactory.java:66)
at
org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:109)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:80)
at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:28)
Browsing the drools core code I found the line that was throwing the
exception and tried to get the same result by implementing:
if (!((InternalRuleBase) ((KnowledgeBaseImpl)
ksession.getKnowledgeBase()).ruleBase)
.getTypeDeclaration(fact.getClass()) ==
null)
log.info (((InternalRuleBase) ((KnowledgeBaseImpl)
ksession.getKnowledgeBase()).ruleBase)
.getTypeDeclaration(fact.getClass()).getTimestampExtractor().toString());
after updating my ksession. The result was the same, again the same
exception thrown but my logger wrote:
18:01:50,232 INFO [ClassFieldExtractor class=MyPackage.MyFact
field=myTimestampField]
So I dont know why the core is throwing that exception, is that
implementation correct?, any ideas?
Thanks,
Nestor
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2274) Rule does not fire as expected using deep object model and nested 'or' clause
by Brian DeCamp (JIRA)
Rule does not fire as expected using deep object model and nested 'or' clause
-----------------------------------------------------------------------------
Key: JBRULES-2274
URL: https://jira.jboss.org/jira/browse/JBRULES-2274
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.0.1.FINAL
Environment: Windows NT with JBoss 4.2.2GA using the 5.0.1 jars for core, compiler and api.
Reporter: Brian DeCamp
Assignee: Mark Proctor
When combining deep facts and nested 'or' statements, rules do not fire. I've reduced the problem as much as possible with the following example:
------- begin test.drl --------
rule "find one and two with 'or' clause - WORKS"
when
com.xyz.SimpleFact(name == "one");
(eval(true) or eval(true));
com.xyz.SimpleFact(name == "two");
then
System.out.println("found one and two with 'or' clause");
end
rule "Deep one and two without 'or' - WORKS"
when
d1: com.xyz.DeepFact();
com.xyz.SimpleFact(name=="one") from d1.simple;
d2: com.xyz.DeepFact();
com.xyz.SimpleFact(name=="two") from d2.simple;
then
System.out.println("Found deep facts with simple facts one and two without 'or' clause");
end
rule "Deep one and two with nested 'or' - FAILURE!!!"
when
d1: com.xyz.DeepFact();
com.xyz.SimpleFact(name=="one") from d1.simple;
(eval(true) or eval(true));
d2: com.xyz.DeepFact();
com.xyz.SimpleFact(name=="two") from d2.simple;
then
System.out.println("THIS DOES NOT FIRE");
end
-------end test.drl --------
------- begin DeepFact.java --------
package com.xyz;
public class DeepFact {
private SimpleFact simple;
public SimpleFact getSimple() {
return simple;
}
public void setSimple(SimpleFact simple) {
this.simple = simple;
}
}
------- end DeepFact.java --------
------- begin SimpleFact.java --------
package com.xyz;
public class SimpleFact {
private String name;
public SimpleFact() {}
public SimpleFact(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
------- end SimpleFact.java --------
------- begin test code-------
public void testRules() {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
org.drools.io.Resource ruleResource;
try {
ruleResource = ResourceFactory.newInputStreamResource(new FileInputStream("test.drl"));
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
kbuilder.add(ruleResource, ResourceType.DRL);
if ( kbuilder.hasErrors() ) {
System.err.println( kbuilder.getErrors().toString() );
}
Collection<KnowledgePackage> compiledPackages = kbuilder.getKnowledgePackages();
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase();
kbase.addKnowledgePackages(compiledPackages);
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
// Insert facts
ksession.insert(new SimpleFact("one"));
ksession.insert(new SimpleFact("two"));
DeepFact d1 = new DeepFact();
d1.setSimple(new SimpleFact("one"));
ksession.insert(d1);
DeepFact d2 = new DeepFact();
d2.setSimple(new SimpleFact("two"));
ksession.insert(d2);
ksession.fireAllRules();
ksession.dispose();
}
------- end test code --------
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-1457) please support containment test for map keys
by Godmar Back (JIRA)
please support containment test for map keys
--------------------------------------------
Key: JBRULES-1457
URL: http://jira.jboss.com/jira/browse/JBRULES-1457
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 4.0.4
Environment: any
Reporter: Godmar Back
Using MVEL as the language for clauses, there is no way to test whether a map's key contain a value.
For instance:
rule "number 1"
when
e : S(map.keySet() contains "x")
then
System.out.println("rule number 1");
end
leads to a syntax error because Drool's parser does not allow function calls ("keySet())" in clauses.
On the other hand, MVEL (according to Mike Brocks, please read http://jira.codehaus.org/browse/MVEL-53 ) does not provide an operator to test containment in a map's set (or values). He said he's considering adding a shortcut such as .keys and .values in 2.0 and recommended I open a Drools JIRA issue.
Please provide a way to test for membership in a map's key and value set.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2404) "not contains" operator doesn't work on inner fields
by Taras Svirskyi (JIRA)
"not contains" operator doesn't work on inner fields
-----------------------------------------------------
Key: JBRULES-2404
URL: https://jira.jboss.org/jira/browse/JBRULES-2404
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Reporter: Taras Svirskyi
Assignee: Mark Proctor
Consider following example.
There are nodes that are connected into directed graph. Each node has
special collection of attributes. Under some conditions attributes
should be propagated along the edges in the graph.
Lets model this with following code.
/******* propagation rules **********************/
package com.test.collection;
rule "move child"
when
c : Child()
s : CNode( children contains c)
l : Link( src == s,
t : target && target.children not contains c )
then
System.out.println("adding "+c+" from "+s+" to "+t);
t.addChild(c);
update(t);
end
/** Child.java (represent special attributes of a node) *******/
package com.test.collection;
public class Child {
private String name;
public Child(String name){
this.name = name;
}
public String getName() {
return name;
}
@Override
public String toString() {
return "child("+name+")";
}
}
/********* CNode.java - nodes of a graph *************/
package com.test.collection;
import java.util.HashSet;
import java.util.Set;
public class CNode {
private Set<Child> children;
public CNode() {
this.children = new HashSet<Child>();
}
public Set<Child> getChildren() {
return children;
}
public void addChild(Child ch){
children.add(ch);
}
@Override
public String toString() {
return "Node{children="+children+"}";
}
}
/**** Link.java - edges of a graph *******/
package com.test.collection;
public class Link {
private CNode src;
private CNode target;
public Link(CNode src, CNode target) {
this.src = src;
this.target = target;
}
public CNode getSrc() {
return src;
}
public CNode getTarget() {
return target;
}
}
/********************* populate session with facts **********/
Child c0 = new Child("x");
Child c1 = new Child("y");
Child c2 = new Child("z");
CNode src = new CNode();
src.addChild(c0);
src.addChild(c1);
CNode target = new CNode();
target.addChild(c0);
Link link = new Link(src,target);
// populate with facts
ksession.insert(c0);
ksession.insert(c1);
ksession.insert(c2);
ksession.insert(link);
ksession.insert(src);
ksession.insert(target);
/****************************************************************/
So with all that code listed above I've got following output from rules:
--
adding child(x) from Node{children=[child(x), child(y)]} to
Node{children=[child(x)]}
--
That means that 'not contains' operator actually works as 'contains'
one. Still when I changed it to older operator 'excludes' everything
goes right printing out.
---
adding child(y) from Node{children=[child(y), child(x)]} to
Node{children=[child(x)]}
---
I've noticed that rewriting rule in form of simple statements also fix
issue.
rule "move child"
when
c : Child()
s : CNode( children contains c)
t : CNode( children not contains c )
l : Link( src == s, target == t)
then
System.out.println("adding "+c+" from "+s+" to "+t);
t.addChild(c);
update(t);
end
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (EJBTHREE-1870) stopDelivery on active MDB results in exception (Session not found)
by Philip Dodds (JIRA)
stopDelivery on active MDB results in exception (Session not found)
-------------------------------------------------------------------
Key: EJBTHREE-1870
URL: https://jira.jboss.org/jira/browse/EJBTHREE-1870
Project: EJB 3.0
Issue Type: Bug
Components: ejb3
Affects Versions: 1.1.3
Environment: Mac OS/X Leopard, JDK 6, JBoss 5.1.0GA
Reporter: Philip Dodds
Attachments: stopdelivery-mdb.zip
If you start an MDB and introduce a messages to it then use the stopDelivery method of the MDB's MBean to stop it consuming messages you get an exception. Note this problem only occurs if the MDB has a transaction in flight when the stopDelivery is called.
2009-05-20 12:30:52,499 ERROR [org.jboss.messaging.util.ExceptionUtil] (WorkManager(2)-44) Connectio
nEndpoint[fe-oz919yuf-1-mj809yuf-bruz48-x21o4c5] sendTransaction [ur4-b6b39yuf-1-mj809yuf-bruz48-x21
o4c5]
javax.jms.IllegalStateException: Cannot find session with id ie-qz919yuf-1-mj809yuf-bruz48-x21o4c5
at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.processTransaction(ServerConnectionEndpoi
nt.java:835)
at org.jboss.jms.server.endpoint.ServerConnectionEndpoint.sendTransaction(ServerConnectionEndpoint.
java:497)
at org.jboss.jms.server.endpoint.advised.ConnectionAdvised.org$jboss$jms$server$endpoint$advised$Co
nnectionAdvised$sendTransaction$aop(ConnectionAdvised.java:101)
at org.jboss.jms.server.endpoint.advised.ConnectionAdvised$sendTransaction_N3268650789275322226.inv
okeTarget(ConnectionAdvised$sendTransaction_N3268650789275322226.java)
I have attached a slightly doctors version of the EJB3 MDB example code, it has been changed to introduce a sleep of 5 seconds in the MDB (to keep the transaction active longer) and also introduces a higher volume of messages to give you a chance to get to the JMX console and call stopDelivery. If you don't get an exception on the first attempt it is worth trying again as the transaction must be in flight for the problem to occur.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2248) Drools Expert User Guide errors
by Karsten Thoms (JIRA)
Drools Expert User Guide errors
-------------------------------
Key: JBRULES-2248
URL: https://jira.jboss.org/jira/browse/JBRULES-2248
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-docs
Affects Versions: 5.0.1.FINAL
Reporter: Karsten Thoms
Assignee: Mark Proctor
Priority: Trivial
Some minor issues I found when following the User Guide:
Improvement: Variable 'kbase' is not introduced in the first example. Add declaration and instantiation to example in 2.1.1.
Rule "Status output when things are ok"
error:
not Sprinkler( on === true )
correct:
not Sprinkler( on == true )
ERROR
if ( kbuilder.hasErrors() ) {
System.err.println( builder.getErrors().toString() );
}
CORRECT
if ( kbuilder.hasErrors() ) {
System.err.println( kbuilder.getErrors().toString() );
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2398) Rule not fired when using 'in (0)' condition and another rule with condition ' == null' exists
by Jaroslaw Wosik (JIRA)
Rule not fired when using 'in (0)' condition and another rule with condition ' == null' exists
----------------------------------------------------------------------------------------------
Key: JBRULES-2398
URL: https://jira.jboss.org/jira/browse/JBRULES-2398
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.0.1.FINAL
Environment: Windows Xp Pro, Java 1.5.07
Reporter: Jaroslaw Wosik
Assignee: Mark Proctor
When following package is used:
package BROKEN_TEST;
import pl.wosik.conversion.BrokenTest.Holder;
rule "_12"
salience 3
activation-group "BROKEN"
when
$a : Holder(value in (0))
then
System.out.println("setting 0");
$a.setOutcome("setting 0");
end
rule "_13"
salience 2
activation-group "BROKEN"
when
$a : Holder(value in (1))
then
System.out.println("setting 1");
$a.setOutcome("setting 1");
end
rule "_22"
salience 1
activation-group "BROKEN"
when
$a : Holder(value == null)
then
System.out.println("setting null");
$a.setOutcome("setting null");
end
Rule "_12" will not be fired even when Holder.value is 0 because some strange interference between it's and rule _22's condition (note that _22 won't be fired as expected).
When "Holder(value in (0))" is changed into "Holder(value == 0)" or "Holder(value in (0,9))" or the whole rule_22 is removed rule _12 will be fired.
This issue is important as such seemingly strange "in (0)" condition can be generated from a decision table (as was in my case).
I will attach a self-contained Test Case.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2462) Unable to read a properties file from DRL file
by Danny Shaw (JIRA)
Unable to read a properties file from DRL file
----------------------------------------------
Key: JBRULES-2462
URL: https://jira.jboss.org/jira/browse/JBRULES-2462
Project: Drools
Issue Type: Task
Security Level: Public (Everyone can see)
Reporter: Danny Shaw
Assignee: Mark Proctor
I am getting this error when my DRL file is attempting to read from a properties file
org.drools.runtime.rule.ConsequenceException: java.lang.NullPointerException
at org.drools.runtime.rule.impl.DefaultConsequenceExceptionHandler.handleException(DefaultConsequenceExceptionHandler.java:23)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:943)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:885)
at org.drools.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:1086)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:660)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:627)
at org.drools.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:183)
Any suggestions then please let me know.
Thanks
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2321) Implicit binding and "or" CE in pattern cause ClassCastException
by Tihomir Surdilovic (JIRA)
Implicit binding and "or" CE in pattern cause ClassCastException
----------------------------------------------------------------
Key: JBRULES-2321
URL: https://jira.jboss.org/jira/browse/JBRULES-2321
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.7
Reporter: Tihomir Surdilovic
Assignee: Mark Proctor
This is a problem with Drools 4.0.7, it does not happen in Drools 5:
$factB.f1 is triggering a scenario where the engine creates an implicit biding to the "f1" field.
That in conjunction with the use of "or" is triggering the problem
rule "implicit bindings test"
when
FactA()
$factB : FactB( $fB : f1 )
(not FactC( f1 == $factB.f1 ) or FactC() )
then
end
The exception thrown is:
java.lang.ClassCastException: com.sample.FactAShadowProxy cannot be cast to com.sample.FactB
at org.drools.base.com.sample.FactB1865721816$getF1.getIntValue(Unknown Source)
at org.drools.base.extractors.BaseIntClassFieldExtractor.getHashCode(BaseIntClassFieldExtractor.java:85)
at org.drools.base.ClassFieldExtractor.getHashCode(ClassFieldExtractor.java:225)
at org.drools.rule.Declaration.getHashCode(Declaration.java:273)
at org.drools.util.AbstractHashTable$SingleIndex.hashCodeOf(AbstractHashTable.java:533)
at org.drools.util.TupleIndexHashTable.getOrCreate(TupleIndexHashTable.java:315)
at org.drools.util.TupleIndexHashTable.add(TupleIndexHashTable.java:227)
at org.drools.reteoo.NotNode.assertTuple(NotNode.java:93)
at org.drools.reteoo.CompositeTupleSinkAdapter.propagateAssertTuple(CompositeTupleSinkAdapter.java:30)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:156)
at org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:162)
at org.drools.reteoo.Rete.assertObject(Rete.java:175)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:684)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years