I'm getting this error message too. I'm running Drools 5.0.1 as a
bundle within an OSGi container. Like the parent post indicates it
worked with Drools 4.0.7 and it only happens when I put constraints on
fact fields.
Here's my stack:
Root exception:
java.lang.NoClassDefFoundError: org/drools/base/extractors/
BaseObjectClassFieldReader
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
at org.drools.base.ClassFieldAccessorCache
$ByteArrayClassLoader.defineClass(ClassFieldAccessorCache.java:367)
at
org
.drools
.base
.ClassFieldAccessorFactory
.getClassFieldReader(ClassFieldAccessorFactory.java:135)
at org.drools.base.ClassFieldAccessorCache
$CacheEntry.getReadAccessor(ClassFieldAccessorCache.java:315)
at
org
.drools
.base
.ClassFieldAccessorCache.getReadAcessor(ClassFieldAccessorCache.java:
245)
at
org
.drools.base.ClassFieldAccessorStore.wire(ClassFieldAccessorStore.java:
379)
at
org
.drools
.base.ClassFieldAccessorStore.merge(ClassFieldAccessorStore.java:270)
at
org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:
466)
at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:388)
at com.cjs.core.rules.RulesEngine.startEngine(RulesEngine.java:102)
at com.cjs.core.rules.RulesEngine.<init>(RulesEngine.java:44)
at com.cjs.core.rules.RulesEngine.getInstance(RulesEngine.java:58)
at
com
.cjs
.core
.rules
.RulesEngineServiceFactory.getEngine(RulesEngineServiceFactory.java:22)
at com.cjs.hazel.rules.test.Activator.start(Activator.java:21)
at org.eclipse.osgi.framework.internal.core.BundleContextImpl
$1.run(BundleContextImpl.java:782)
at java.security.AccessController.doPrivileged(Native Method)
at
org
.eclipse
.osgi
.framework
.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:
773)
at
org
.eclipse
.osgi
.framework
.internal.core.BundleContextImpl.start(BundleContextImpl.java:754)
at
org
.eclipse
.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:
352)
at
org
.eclipse
.osgi
.framework.internal.core.AbstractBundle.resume(AbstractBundle.java:370)
at
org
.eclipse
.osgi.framework.internal.core.Framework.resumeBundle(Framework.java:
1068)
at
org
.eclipse
.osgi
.framework
.internal.core.StartLevelManager.resumeBundles(StartLevelManager.java:
557)
at
org
.eclipse
.osgi
.framework
.internal.core.StartLevelManager.incFWSL(StartLevelManager.java:464)
at
org
.eclipse
.osgi
.framework
.internal
.core.StartLevelManager.doSetStartLevel(StartLevelManager.java:248)
at
org
.eclipse
.osgi
.framework
.internal.core.StartLevelManager.dispatchEvent(StartLevelManager.java:
445)
at
org
.eclipse
.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:
220)
at org.eclipse.osgi.framework.eventmgr.EventManager
$EventThread.run(EventManager.java:330)
Thanks for your answer !
My configuration seems correct to me, I have all new jars in the
classpath (the ones indicated in the file README-DEPENDENCIES.txt at
the
SVN trunk). I checked them all looking after another
BaseObjectClassFieldReader class, but only drools-core contains it.
By the way, rules are well compiled and executed, this issue only
happens when I put constraints on fields. So I think if drools-core
was
not in the classpath, nothing would work at all...
Le mercredi 01 juillet 2009 à 08:46 -0400, Edson Tirelli a écrit :
>
> It seems to me that the problem is not with the classloader of
your
> classes, but the classpath of the drools jars. Are you sure you
> updated and have all the required new jars in your classpath?
Drools 5
> has a few new jars, like drools-api, that need to be available.
Also,
> check if there are any older jar still in the classpath that might
be
> clashing with the new jars.
>
> []s
> Edson
>
> 2009/7/1 Julien Nicoulaud <julien.nicoulaud at bull.net>
> Hi, I'm migrating my system from Drools 4.0.7 to Drools
5.1.0.
> Now when I try to compile rules that check fact fields, I
get
> the
> following exception:
>
> ERROR: EventDispatcher: Error during dispatch.
> (java.lang.NoClassDefFoundError:
> org/drools/base/extractors/
BaseObjectClassFieldReader)
> java.lang.NoClassDefFoundError:
> org/drools/base/extractors/BaseObjectClassFieldReader
>
> (
http://paste2.org/p/296380 )
>
>
> It seems the classloaders I pass to the configurations are
not
> taken in
> account... I get exactly the same error if I do not specify
> the
> classloaders. Here is the code:
> KnowledgeBuilderConfiguration kBuilderCfg =
>
>
KnowledgeBuilderFactory
.newKnowledgeBuilderConfiguration(null,classLoader);
> KnowledgeBuilder knowledgeBuilder =
>
> KnowledgeBuilderFactory.newKnowledgeBuilder(kBuilderCfg);
>
> KnowledgeBaseConfiguration kbaseConfig =
>
>
KnowledgeBaseFactory
.newKnowledgeBaseConfiguration(null,multiBundleClassLoader);
> kbaseConfig.setOption(EventProcessingOption.STREAM);
> knowledgeBase =
> KnowledgeBaseFactory.newKnowledgeBase(kbaseConfig);
>
> On Drools 4, we did exactly the same with PackageBuilder
> instead of
> KnowledgeBuilder and RuleBase for KnowledgeBase. So the
> classloaders I
> pass are the good ones... Is there some trick ?
>
> Thanks for any help !
>
> _______________________________________________
> rules-users mailing list
> rules-users at
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 at
lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/rules-users