NoClassDefFoundError for BaseObjectClassFieldExtractor when running in Tomcat
by Jesse Stockall
Tomcat 5.5
Java 1.5
jbossrules-4.0.0.12865MR3
I have an instance of Drools running inside a webapp deployed on Tomcat.
The rules have been compiled ahead of time and are loaded in with:
InputStream is = PolicyRuntime.class.getResourceAsStream(name);
DroolsObjectInputStream in = new DroolsObjectInputStream(is);
Package p = (Package) in.readObject();
When run outside Tomcat it loads fine, when run inside Tomcat I get:
java.lang.NoClassDefFoundError:
org/drools/base/extractors/BaseObjectClassFieldExtractor
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at org.drools.base.ClassFieldExtractorFactory
$ByteArrayClassLoader.defineClass(ClassFieldExtractorFactory.java:455)
at
org.drools.base.ClassFieldExtractorFactory.getClassFieldExtractor(ClassFieldExtractorFactory.java:114)
at
org.drools.base.ClassFieldExtractor.init(ClassFieldExtractor.java:77)
at
org.drools.base.ClassFieldExtractor.<init>(ClassFieldExtractor.java:57)
at
org.drools.base.ClassFieldExtractorCache.getExtractor(ClassFieldExtractorCache.java:35)
at
org.drools.base.ClassFieldExtractor.readResolve(ClassFieldExtractor.java:72)
I've tried adding DroolsObjectInputStream.class.getClassLoader() ,
PolicyRuntime.class.getClassLoader() and
Thread.currentThread().getContextClassLoader() to the constructor of the
DroolsObjectInputStream but none had any effect.
Thanks
Jesse
17 years, 5 months
Some serious problems while authoring rules
by Natraj Gudla
I am facing some serious blocking issues while writing few rules. In the
rule below, a1, a2 are Double objects. When i have the first statement in
the rule " EMIAgainstProperty( obj : a1 )", the rule does not fire....when i
comment and re phrase the second line as emi : EMIAgainstProperty( a2 >= ( *
new* Double(10* 1.5 )) ), the rule is fired.
Why is the first line making the rule not to fire. I have reported a similar
problem yesterday, but could not find a resolution. On the other hand, i am
unable to refer a1 directly to say a1.doubleValue() in the second line, it
throws up and error. Any help??? What is the way out?
*
rule* "Test"
*when*
EMIAgainstProperty( obj : a1 )
emi : EMIAgainstProperty( a2 >= ( *new* Double(obj.doubleValue() * 1.5 )) )
*then
*
System.out.println(" Passed ");
*
end
*
17 years, 5 months
Re: Entreprise using Drools with success
by Matt Geis
Not quite able to say who I work for, but we run a brokerage app for which we licensed the source code. We've been running/modding the app for the last 3 years, so it's pretty much our app now, in terms of how familiar we are with it, and how much we've changed/tuned it.
That being said, our app had a custom rules engine, with a bloated XML language, etc. In evaluating Drools, I tested out commission calculation. We have about 40 scenarios, so I created 1000 trades of each type, put them in a collection, and shuffled it. Commission calculation in our old rules engine took about 38000ms, and Drools did it in about 250ms.
So, the speed, and the fact that to download it, read the docs, write all the rules using a DSL, and write and run the test took me only about 4 hours (never having seen Drools before) led me to think that it merited a closer look.
Matt
____________________________________________________________________________________
Yahoo! oneSearch: Finally, mobile search
that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
17 years, 5 months
Proposal: Collect Case Studies
by Dr. Gernot Starke
Hi Drools-users,
to further promote JBoss-Drools I suggest to compile a few practical
application scenarios or case-studies.
A few of you gave hints on your application domains as answer to "Re:
[rules-users] Entreprise using Drools with success".
I am most willing to document examples, as long as you provide enough
details (plus sample rules...).
What about a section in the JBoss-Drools-Wiki?
I'll start writing a sample one of these days - so far see my first
ideas on content-based routing:
http://rbs.gernotstarke.de/samples/samples/routing.html
feedback welcome
Gernot
17 years, 5 months
custom rule creation/parsing
by Eugeny N Dzhurinsky
Hello!
We are about to develop an application where customers are responsible to
create various rules and define actions. There are a dictionary of available
conditions applied to objects as well as set of predefined actions.
For now we know there is a DRL, which is parsed and certain actions are
executed, but we think the way
our custom objects -> generate DRL -> parse DRL by Drools -> inject rules objects
is a bit redundant, in such way we need to create additional layer to generate
something which is to be parsed then by Drools.
We would like to avoid such complexity, if possible.
Is it possible to create our own objects which will act as rules for Drools
framework, so we can implement some interfaces/inherit some abstract classes
and inject our custom logic/objects there?
Thank you in advance!
--
Eugene N Dzhurinsky
17 years, 5 months
org.drools.common.RuleFlowGroupNode
by hypnosat7
When I fire my rules with a giving rule flow I have this exception :
java.lang.ClassCastException: org.drools.common.RuleFlowGroupNode cannot be
cast to org.drools.spi.Activation
at
org.drools.ruleflow.instance.impl.RuleFlowSplitInstanceImpl.trigger(RuleFlowSplitInstanceImpl.java:90)
at
org.drools.ruleflow.instance.impl.RuleFlowSequenceNodeInstanceImpl.triggerCompleted(RuleFlowSequenceNodeInstanceImpl.java:38)
at
org.drools.common.RuleFlowGroupImpl$DeactivateCallback.execute(RuleFlowGroupImpl.java:212)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1135)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:394)
at
org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:384)
Any help pls ?
--
View this message in context: http://www.nabble.com/org.drools.common.RuleFlowGroupNode-tf4108894.html#...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 5 months
Unable to perform simple primitive operations
by Natraj Gudla
Hi All,
I am using Drools 3.0.6 and unable to perform some simple form of
multiplication. I want to compare an object field with another field
multiplied by a factor.
*
rule* "*Calculate* Business profit,1"
*when
**EMIAgainstProperty* ( bp1 : businessProfit1 )
emi : *EMIAgainstProperty* ( businessProfit2 > *(bp1*1.5)* )
*then
*emi.setBusinessProfit((emi.getBusinessProfit1
()+emi.getBusinessProfit2())/2);*
**end*
I get an error on creation of the package that * is undefined for Double and
double. I understand this is because Drools does an auto box on primitive
type variables. But is there a work around to do simpler comparisons like
this, especially on the right hand side of the condition. some thing like [
variable * constantValue ].
Also, i am forced to do a declaration for businessProfit1, and use in the
comparison below. I am not able to compare two fields of the same object
directly.
some thing like businessProfit2 > businessProfit1 does not work, why is this
so? Any one has faced these problems earlier?
Thanks
Natraj
17 years, 5 months
Using JDK dynamic proxies as facts
by Chris West
Hello,
I'm trying to use objects that are generated as dynamic proxies (through the
java.lang.reflect.Proxy class) as facts in JBoss Rules 4.0 MR3. My project
was using CGLib to generate proxies, and they were working just fine in
3.0.6. However, when I tried 4.0, the CGLib based proxies seemed to have a
final method that kept the proxies from being proxied as shadow facts. So I
rewrote my code to try to use JDK based proxies, and version 4.0 MR3 accepts
them and apparently creates shadow facts, but now my rules don't fire
correctly.
So, in an attempt to create a simple program to illustrate the problem, I
ran into a different problem. The attached eclipse project illustrates this
problem.
The error is:
java.lang.NullPointerException
at org.drools.reteoo.Rete$ObjectTypeConf.<init>(Rete.java:333)
at org.drools.reteoo.Rete.assertObject(Rete.java:152)
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 com.sample.DroolsTest.main(DroolsTest.java:42)
Has anyone successfully used JDK based dynamic proxies as facts?
Thanks,
-Chris West
17 years, 5 months
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
17 years, 5 months