[rules-users] NoClassDefFoundError for

MarkA mail at cluttered.co.uk
Sat Aug 18 03:49:42 EDT 2007


I'm getting this too. 

I use eclipse (3.2.2) and Drools 4. I created a very simple program from one
of the examples. Basically a .java file and a .drl file. It works fine in
the IDE but if I try it from the command line (DOS or MAC OSX) from either
the java, the class or a jar, then they all fail with the
noclassdeffounderror.

I tried commenting all the drools bits out - works. Putting them back bit by
bit and it fails as soon as it executes any drools code:

In main() it executes the line: 
        'RuleBase ruleBase = readRule();' 
and the function snippet it calls is below. 

Running it in the IDE works, from the CLI it prints up to RULE000 and then
gives the error.


...
	private static  RuleBase readRule() throws Exception {
		//read in the source
		System.out.println("Loading rules");
		Reader source = new InputStreamReader(
DroolsTest.class.getResourceAsStream( "/rules/DroolsTest.drl" ) );
		System.out.println("Loaded rules");
		
		//Use package builder to build up a rule package.
		//An alternative lower level class called "DrlParser" can also be used...
		System.out.println("RULES000");		
		PackageBuilder builder = new PackageBuilder();
		System.out.println("RULES001");
...



Any ideas what I'm doing wrong? I have included the 14 jars (the 4 drools
ones and the 10 from the lib folder too in the drools required pack). I'm
new to Java so forgive me if it's obvious, but it's really annoying me.

Thanks,

mark.

-- 
View this message in context: http://www.nabble.com/NoClassDefFoundError-for-tf4259992.html#a12161643
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list