[rules-users] Eclipse, JUnit and Classpaths (sorry, back)
J Michael Dean
mdean77 at comcast.net
Sat Mar 22 20:21:02 EDT 2008
I have been unable to work on this for a while but problem has not
gone away. I have an RCP that runs and Drools runs and works. But
when I try to run unit tests that involve Drools, I get this recurrent
problem:
java.lang.NullPointerException
at
org.mvel.optimizers.OptimizerFactory.<clinit>(OptimizerFactory.java:43)
at
org.drools.rule.builder.dialect.mvel.MVELDialect.init(MVELDialect.java:
142)
at org.drools.compiler.DialectRegistry.initAll(DialectRegistry.java:49)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:146)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:108)
at
droolsRules.tests.AllDroolsRulesTests.setUp(AllDroolsRulesTests.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun
.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
39)
at
sun
.reflect
.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
at java.lang.reflect.Method.invoke(Method.java:585)
So I am writing to describe this environment again, and see if anyone
has suggestions.
I have the Eclipse plugin in my development environment. It is NOT in
my target environment.
I have a privately minted "MinimalDroolsPlugin" that includes the
core, compiler, and the dependency library. THIS plugin is what is in
my manifest.
This works when I run the application, as an RCP with product
branding, or as a product. When I use the target environment in
Eclipse to create Mac, Linux, and W32 applications, all is well.
When I run JUnit tests, I get the error above.
I am wondering if the problem is the simultaneous presence of my
minimal plugin as well as the eclipse Drools plugin?
The Drools jars that are needed by the application need to be
incorporated into some kind of Eclipse plugin so that they are
exposed, which is why I created the minimal plugin. But if I leave
this out completely and then try to setup a routine that imports a
Drools compiler class, for example, Eclipse does not find it merely
from the Eclipse plugins (Drools plugins).
Sorry if this sounds ludicrous and confused, but any help greatly
appreciated!
- Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20080322/f4ce7ff4/attachment.html
More information about the rules-users
mailing list