All Drools examples 6.x fail on Mvel dependency error

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

All Drools examples 6.x fail on Mvel dependency error

mattmadhavan
Hello,
I have downloaded the new Drools 6.x distribution. All the example tests fail (out of the box) with the following  stacktrace.

java.lang.NoClassDefFoundError: org/mvel2/ConversionHandler
        at org.drools.compiler.rule.builder.DefaultConstraintBuilderFactory.<clinit>(DefaultConstraintBuilderFactory.java:6)
        at org.drools.compiler.rule.builder.DroolsCompilerComponentFactory.<init>(DroolsCompilerComponentFactory.java:11)
        at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.init(KnowledgeBuilderConfigurationImpl.java:238)
        at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.init(KnowledgeBuilderConfigurationImpl.java:188)
        at org.drools.compiler.builder.impl.KnowledgeBuilderConfigurationImpl.<init>(KnowledgeBuilderConfigurationImpl.java:153)
        at org.drools.compiler.kie.builder.impl.AbstractKieModule.buildKnowledgePackages(AbstractKieModule.java:178)
        at org.drools.compiler.kie.builder.impl.KieContainerImpl.createKieBase(KieContainerImpl.java:386)
        at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:346)
        at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:498)
        at org.drools.compiler.kie.builder.impl.KieContainerImpl.newKieSession(KieContainerImpl.java:469)
        at org.drools.example.api.namedkiesession.NamedKieSessionExample.go(NamedKieSessionExample.java:15)
        at org.drools.example.api.namedkiesession.NamedKieSessionExampleTest.testGo(NamedKieSessionExampleTest.java:17)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassNotFoundException: org.mvel2.ConversionHandler
        at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        ... 35 more

Reply | Threaded
Open this post in threaded view
|

Re: All Drools examples 6.x fail on Mvel dependency error

mattmadhavan
This happens even after I added the following dependency

        <dependency>
                <groupId>org.mvel</groupId>
                <artifactId>mvel2</artifactId>
        </dependency>
Reply | Threaded
Open this post in threaded view
|

Re: [rules-users] All Drools examples 6.x fail on Mvel dependency error

Mark Proctor
Those all have unit test, that get run as part of the build. So there must be something wrong your side.

Most likely mismatched MVEL versions.

Mark
On 5 Aug 2014, at 22:06, mattmadhavan <[hidden email]> wrote:

> This happens even after I added the following dependency
>
> <dependency>
> <groupId>org.mvel</groupId>
> <artifactId>mvel2</artifactId>
> </dependency>
>
>
>
>
> --
> View this message in context: http://drools.46999.n3.nabble.com/All-Drools-examples-6-x-fail-on-Mvel-dependency-error-tp4030576p4030577.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/rules-users


_______________________________________________
rules-users mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/rules-users
Reply | Threaded
Open this post in threaded view
|

Re: All Drools examples 6.x fail on Mvel dependency error

Mario Fusco
In reply to this post by mattmadhavan
Hi,

I am not sure of what you mean with "new Drools 6.x distribution". I downloaded the latest Drools 6.1 distribution from here http://drools.jboss.org/downloads.html launched the runExample.sh script and everything seems to work as expected.

Can you be a bit more specific? On which distribution are you trying the examples? How are you launching them? Which OS and JVM are you using?

Thanks,
Mario
Reply | Threaded
Open this post in threaded view
|

Re: All Drools examples 6.x fail on Mvel dependency error

mattmadhavan
HI Mario,
Thank you very much for your reply.

I downloaded 6.1.1-SNAPSHOT
I imported the whole project into Eclipse (Spring STS), JDK 1.7 Windows.

I didn't run runExamples.sh. I tried to run them as JUnit tests in Eclipse.

I hope this explains what I am trying to do.

Thanks in advance!

Matt'M