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:
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@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users