[rules-users] JUnit testing problem

Edson Tirelli tirelli at post.com
Mon Dec 31 06:58:06 EST 2007


   Mike,

   This looks like a classpath problem indeed. Did you tried asking the JVM
to dump its classpath so that you can know for sure what jars are included
and if any of them embeds a non-compatible ASM version ?

   []s
   Edson

2007/12/30, J Michael Dean <mdean77 at comcast.net>:
>
> Continuing to have problems - can use Drools in RCP but when I try to
> JUnit test, I cannot instantiate a PackageBuilder.  With the following code
> fragment:
> @BeforeClass
> public static void setUp() throws Exception {
> Reader source;
> PackageBuilderConfiguration pkgConfig = new PackageBuilderConfiguration();
> JavaDialectConfiguration javaDialectConf = (JavaDialectConfiguration)
> pkgConfig.getDialectConfiguration("java");
> javaDialectConf.setCompiler(JavaDialectConfiguration.ECLIPSE);
>
>
> if (pkgConfig == null) {
> System.out.println("Error - null package configuration");
> } else {
> System.out.println("Package configuration is not null"); // NOTE THAT THIS
> EXECUTES SO NOT NULL
> }
> final PackageBuilder builder = new PackageBuilder(pkgConfig); // CRASH
> OCCURS IN THIS LINE OF CODE
>
>
> I get the following trace:
>
> Package configuration is not null
> 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:49
> )
> 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)
> at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(
> BeforeAndAfterRunner.java:74)
> at org.junit.internal.runners.BeforeAndAfterRunner.runBefores(
> BeforeAndAfterRunner.java:50)
> at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(
> BeforeAndAfterRunner.java:33)
> at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
> at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(
> JUnit4TestReference.java:38)
> at org.eclipse.jdt.internal.junit.runner.TestExecution.run(
> TestExecution.java:38)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:460)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
> RemoteTestRunner.java:673)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(
> RemoteTestRunner.java:386)
> at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(
> RemoteTestRunner.java:196)
> [MVEL] Notice: Possible incorrect version of ASM present (3.0 required).
> Disabling JIT compiler.  Reflective Optimizer will be used.
>
> I had similar issue a number of weeks ago that never resolved, but
> subsequently have upgraded Eclipse to 3.3.2, running on OSX Leopard.  I
> cannot locate a ASM library and obviously the error message is hinting at
> that.
>
> Any assistance will be appreciated.  I hate proceeding without JUnit
> testing in place.
>
> - Mike
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  JBoss Drools Core Development
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20071231/8a110b8f/attachment.html 


More information about the rules-users mailing list