RE: [rules-users] "Unable to load dialect"
by Manukyan, Sergey
Ok, got it fixed by including the "core-3.2.3.v_686_R32x.jar" file, also
included all other jar files in the same lib folder.
Now getting other exception:
[7/16/07 15:03:19:026 EDT] 0000002c SystemErr R
java.lang.NullPointerException
at
org.drools.rule.builder.dialect.java.JavaConsequenceBuilder.build(JavaCo
nsequenceBuilder.java:54)
at
org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:67)
at
org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:390)
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:264)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java
:147)
Help....! ;-)
-Sergey
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Manukyan,
Sergey
Sent: Monday, July 16, 2007 2:03 PM
To: Rules Users List
Subject: [rules-users] "Unable to load dialect"
Folks,
Just upgraded to MR3 from MR2 and started getting this exception:
[7/16/07 13:30:23:772 EDT] 00000025 SystemErr R
org.drools.RuntimeDroolsException: Unable to load dialect
'org.drools.rule.builder.dialect.java.JavaDialect:java'
at
org.drools.compiler.PackageBuilderConfiguration.buildDialectRegistry(Pac
kageBuilderConfiguration.java:156)
at
org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:131)
at
org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:84)
Any idea why?... I included all 4 jar new files and removed old ones...
Thanks,
-Sergey
**********************
** LEGAL DISCLAIMER **
**********************
This E-mail message and any attachments may contain
legally privileged, confidential or proprietary
information. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of
this message to the intended recipient(s), you are
hereby notified that any dissemination, distribution
or copying of this E-mail message is strictly
prohibited. If you have received this message in
error, please immediately notify the sender and
delete this E-mail message from your computer.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
18 years, 5 months
4.0 JBoss Rules IDE - JDK 1.4 compiler setting
by Ronald R. DiFrango
All,
I had to change the compiler setting from JDK 5.0 to JDK 1.4 and no all of a
sudden my DRL files give me the following error:
Severity and Description Path Resource Location Creation Time
Id
Syntax error, static imports are only available if source level is 5.0
RtvDecisionEngine/src/rules/com/circuitcity/rtvcrms/rules
modelDiscrepancyRules.drl line 20 1184006663382 77860
On all rules.
Thoughts?
Ron
18 years, 5 months
Having an else part
by Natraj Gudla
When writing a rule, how do i deal with a scenario to do an action when a
condition is not true. If i have a business need like
IF COND1 is true
DO Action1
ELSE
DO Action 2
I feel with drools we only check for the condition in when part and incase
it fails, we dont have a way to call another action. Any idea??
Thanks
Natraj
18 years, 5 months
Re: [rules-users] simple rule with global var causing errors.
by Edson Tirelli
Can you wrap that in a zip so I can investigate here?
We have tests for the use of globals, so they work fine... not sure why
you are having problems.
[]s
Edson
2007/7/16, Mike Vargo <mike.vargo(a)chromeriver.com>:
>
> It is in the same package…
>
>
>
> *From:* rules-users-bounces(a)lists.jboss.org [mailto:
> rules-users-bounces(a)lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Monday, July 16, 2007 4:35 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] simple rule with global var causing errors.
>
>
>
>
> Is the RulesOutput class in the com.sample package? otherwise you need
> to either fully qualify the class name or import it...
>
> []s
> Edson
>
> 2007/7/16, Mike Vargo < mike.vargo(a)chromeriver.com>:
>
> *I have a very simple drl file.*
>
>
>
> ==============================================
>
> package com.sample;
>
> #generated from Decision Table
>
> global RulesOutput rulesOutput;
>
> #From row number: 12
>
> rule "Routing Decision_12"
>
>
>
> salience 65524
>
> when
>
> Matter(type == "MyMatter")
>
> then
>
> rulesOutput.setRoleId(1);
>
> drools.clearAgenda();
>
> end
>
> ==============================================
>
>
>
> *When I load it, I get the following:*
>
>
>
> org.drools.rule.InvalidRulePackage: Rule Compilation error rulesOutput
> cannot be resolved
>
>
>
> at org.drools.rule.Package.checkValidity(Unknown Source)
>
> at org.drools.common.AbstractRuleBase.addPackage(Unknown
> Source)
>
> at com.sample.PHRulesTest.main(PHRulesTest.java:42)
>
>
>
> Any help is appreciated…
>
>
>
> - Mike
>
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
> Edson Tirelli
> Software Engineer - JBoss Rules Core Developer
> Office: +55 11 3529-6000
> Mobile: +55 11 9287-5646
> JBoss, a division of 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
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
18 years, 5 months
Re: [rules-users] simple rule with global var causing errors.
by Edson Tirelli
Is the RulesOutput class in the com.sample package? otherwise you need to
either fully qualify the class name or import it...
[]s
Edson
2007/7/16, Mike Vargo <mike.vargo(a)chromeriver.com>:
>
> *I have a very simple drl file.*
>
>
>
> ==============================================
>
> package com.sample;
>
> #generated from Decision Table
>
> global RulesOutput rulesOutput;
>
> #From row number: 12
>
> rule "Routing Decision_12"
>
>
>
> salience 65524
>
> when
>
> Matter(type == "MyMatter")
>
> then
>
> rulesOutput.setRoleId(1);
>
> drools.clearAgenda();
>
> end
>
> ==============================================
>
>
>
> *When I load it, I get the following:*
>
>
>
> org.drools.rule.InvalidRulePackage: Rule Compilation error rulesOutput
> cannot be resolved
>
>
>
> at org.drools.rule.Package.checkValidity(Unknown Source)
>
> at org.drools.common.AbstractRuleBase.addPackage(Unknown
> Source)
>
> at com.sample.PHRulesTest.main(PHRulesTest.java:42)
>
>
>
> Any help is appreciated…
>
>
>
> - Mike
>
>
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
18 years, 5 months
simple rule with global var causing errors.
by Mike Vargo
I have a very simple drl file.
==============================================
package com.sample;
#generated from Decision Table
global RulesOutput rulesOutput;
#From row number: 12
rule "Routing Decision_12"
salience 65524
when
Matter(type == "MyMatter")
then
rulesOutput.setRoleId(1);
drools.clearAgenda();
end
==============================================
When I load it, I get the following:
org.drools.rule.InvalidRulePackage: Rule Compilation error rulesOutput
cannot be resolved
at org.drools.rule.Package.checkValidity(Unknown Source)
at org.drools.common.AbstractRuleBase.addPackage(Unknown
Source)
at com.sample.PHRulesTest.main(PHRulesTest.java:42)
Any help is appreciated.
- Mike
18 years, 5 months
4.0.M1 JBoss Rules IDE - Unknown error
by Ronald R. DiFrango
I am getting the following error and I have no way of trackign down where it
is occurring and how to correct it:
Severity and Description Path Resource Location Creation Time
Id
Trying to create a restriction for an empty restriction list
RtvDecisionEngine/src/rules/com/circuitcity/rtvcrms/rules rtv.drl
Unknown 1184614547431 82053
18 years, 5 months
Another multi thread error
by Pierre Paysant-Le Roux
Hi,
I solved my first multi thread problem by having a shared RuleBase for
all threads. My problem is now with Objects insertion. Here is the trace
that occur :
java.lang.ArrayIndexOutOfBoundsException: 17
at
org.drools.util.AbstractHashTable$HashTableIterator.next(AbstractHashTable.java:250)
at org.drools.reteoo.Rete$ObjectTypeConf.buildCache(Rete.java:434)
at org.drools.reteoo.Rete$ObjectTypeConf.getObjectTypeNodes(Rete.java:425)
at org.drools.reteoo.Rete.assertObject(Rete.java:172)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:190)
at
org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:70)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:772)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:584)
at test.TestThreads$DroolsThread.run(TestThreads.java:65)
at java.lang.Thread.run(Thread.java:534)
The program that I made to reproduce this error create threads that each
create a working memory from a static rule base (that works great) and
then insert some objects in this working memory. I have this error in a
real j2ee program.
Here is a listing of the code :
package test;
import java.io.IOException;
import java.io.InputStreamReader;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.StatefulSession;
import org.drools.compiler.DroolsParserException;
import org.drools.compiler.PackageBuilder;
import org.drools.compiler.PackageBuilderConfiguration;
public class TestThreads {
public static RuleBase rulebase;
public static void main(String[] args) {
PackageBuilderConfiguration pkgBuilderCfg =
new PackageBuilderConfiguration();
PackageBuilder builder = new PackageBuilder(pkgBuilderCfg);
try {
builder.addPackageFromDrl(new InputStreamReader(
TestThreads.class.getResourceAsStream( "Sample.drl" )));
} catch (DroolsParserException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
rulebase = RuleBaseFactory.newRuleBase();
try {
rulebase.addPackage(builder.getPackage());
} catch (Exception e) {
e.printStackTrace();
}
for(int i = 0; i<100 ; i++) {
DroolsThread tt = new DroolsThread("Thread " + i);
new Thread(tt).start();
}
}
public static class Fact {
public String s;
public Fact(String s){
this.s = s;
}
public String getS() {
return s;
}
}
public static class DroolsThread implements Runnable {
private String id;
public DroolsThread(String id) {
this.id = id;
}
public void run() {
StatefulSession session = rulebase.newStatefulSession();
for(int i = 0; i < 100; i++) {
session.insert(new Fact(id));
}
}
}
}
I am using Drools MR3.
Thanks for your help.
Pierre Paysant-Le Roux
18 years, 5 months
Re: [rules-users] Rule compilation errors under heavy load
by Andrew Thompson
>It's a good point about using yield(). I did use this originally, but
>for some reason it generated fewer errors than using some arbitrary
>sleep values.
>From discussions or reading I did years back I vaguely recall, yield() isn't required to do anything.
If the VM/OS observes that the same thread that called yield() is still eligible to run, it is quite likely to simply reschedule it as the best candidate.
Depending on the level in the code where this happens in a particular VM or OS implementation, yield() can therefore be a no-op, or a very short break.
sleep() on the other hand makes the thread ineligible to run for a period, forcing a context switch to always happen.
--
Andrew Thompson
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091
18 years, 5 months
RE: [rules-users] Rule compilation errors under heavy load
by Hehl, Thomas
Yeah, me either. Welcome to Java!:)
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Dean Jones
Sent: Monday, July 16, 2007 9:09 AM
To: Rules Users List
Subject: Re: [rules-users] Rule compilation errors under heavy load
Hi Thomas,
On 7/16/07, Hehl, Thomas <Thomas.Hehl(a)acs-inc.com> wrote:
> Couldn't you use yield() to generate a context-switch? It would only
happen
> in that spot, but should produce some good testing.
>
It's a good point about using yield(). I did use this originally, but
for some reason it generated fewer errors than using some arbitrary
sleep values. At the time, I explained this to myself as follows:
yield() means that context switching happens at well-defined points,
whereas when there are lots of sleeping threads waking up at arbitrary
moments wanting to be run, context switching happens more randomly.
I'm not sure if this explanation makes complete sense, though.
Dean.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
18 years, 5 months