[rules-users] Exception in thread "main" java.lang.NoClassDefFoundError: org/drools/RuleBase

Geoffrey Wiseman geoffrey.wiseman at gmail.com
Mon Jan 22 09:28:03 EST 2007


We don't know how you're executing the JAR, but normally, you'd make sure
that both the Jar and the Drools (& Dependency) jars are on the classpath,
then execute your program.

By way of example:

   - If you had an executable jar you'd built yourself, foo.jar, that
   depends on bar.jar, you might run: java -cp /path/to/bar.jar -jar
   /path/to/foo.jar
   - If you had a Jar you'd built yourself, foo.jar,  with a main class,
   Main, that depends on bar.jar, you might run: java -cp
   /path/to/bar.jar;/path/to/foo.jar my.package.Main

Fundamentally, though, what you're asking is a Java question, not a Drools
one.

On 1/22/07, mike20043 <mintymike20043 at yahoo.co.uk> wrote:
>
>
> Hi
>
> I'm currently working on a program which uses a rule based expert system.
> I
> am using eclipse with the expert system shell drools (3.0).
>
> The program works fine when I run it in eclipse but when I try to export
> the
> program as a jar file it does not seem to work. I did cmd java -jar to
> find
> out what's going wrong and it gives me the following error messages:
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/drools/RuleBase
> at com.sample.GUI.<init>(GUI.java:34)
> at com.sample.GUI.main(GUI.java:41)
>
> and also:
>
> Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError:
> org/drool
> s/RuleBase
>         at com.sample.beakAndBill.actionPerformed(beakAndBill.java:64)
>         at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
>         at javax.swing.AbstractButton$Handler.actionPerformed(Unknown
> Source)
>         at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown
> Source)
>         at javax.swing.JToggleButton$ToggleButtonModel.setPressed(Unknown
> Source
> )
>         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased
> (Unknown
> Sour
> ce)
>         at java.awt.Component.processMouseEvent(Unknown Source)
>         at javax.swing.JComponent.processMouseEvent(Unknown Source)
>         at java.awt.Component.processEvent(Unknown Source)
>         at java.awt.Container.processEvent(Unknown Source)
>         at java.awt.Component.dispatchEventImpl(Unknown Source)
>         at java.awt.Container.dispatchEventImpl(Unknown Source)
>         at java.awt.Component.dispatchEvent(Unknown Source)
>         at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown
> Source)
>         at java.awt.LightweightDispatcher.processMouseEvent(Unknown
> Source)
>         at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
>         at java.awt.Container.dispatchEventImpl(Unknown Source)
>         at java.awt.Window.dispatchEventImpl(Unknown Source)
>         at java.awt.Component.dispatchEvent(Unknown Source)
>         at java.awt.EventQueue.dispatchEvent(Unknown Source)
>         at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown
> Source)
>         at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown
> Source)
>         at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown
> Source)
>         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>         at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
>         at java.awt.EventDispatchThread.run(Unknown Source)
>
> can anyone help me with this problem. I know that it's probably missing
> the
> drools classes and if that is the case can anyone tell me how to add the
> classes and get the jar to work correctly.
>
> Thanks in advance.
>
> --
> View this message in context:
> http://www.nabble.com/Exception-in-thread-%22main%22-java.lang.NoClassDefFoundError%3A-org-drools-RuleBase-tf3054129.html#a8489470
> Sent from the drools - user mailing list archive at Nabble.com.
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>



-- 
Geoffrey Wiseman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070122/68a2b98b/attachment.html 


More information about the rules-users mailing list