[rules-users] NoClassDefFoundError for BaseObjectClassFieldExtractor when running in Tomcat

Jesse Stockall jstockall at embotics.com
Tue Jul 17 08:55:23 EDT 2007


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070717/80976e67/attachment.html 


More information about the rules-users mailing list