MVEL错误引起:java.lang.NoClassDefFoundError:org / mvel2 / ConversionHandler

时间:2018-01-25 21:19:10

标签: java eclipse drools owl mvel

我遇到了问题。执行程序后我收到错误信息:Caused by: java.lang.NoClassDefFoundError: org/mvel2/ConversionHandler

下面还可以找到其他消息。可能是我的pom文件中有错误版本的mvel?我怎么知道哪个版本合适?

我正在使用Drools:6.1.0.Final Mvel:mvel2.4.0.Final



java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:297)
    at java.lang.Thread.run (Thread.java:748)
Caused by: 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.AbstractKieProject.verify (AbstractKieProject.java:43)
    at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject (KieBuilderImpl.java:208)
    at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll (KieBuilderImpl.java:177)
    at irobot.RuleE.createKieContainer (RuleE.java:48)
    at irobot.RuleE.createStatelessKieSession (RuleE.java:36)
    at irobot.RuleE.<init> (RuleE.java:23)
    at irobot.Client.main (Client.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:297)
    at java.lang.Thread.run (Thread.java:748)
Caused by: java.lang.ClassNotFoundException: org.mvel2.ConversionHandler
    at java.net.URLClassLoader.findClass (URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:424)
    at java.lang.ClassLoader.loadClass (ClassLoader.java:357)
    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.AbstractKieProject.verify (AbstractKieProject.java:43)
    at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject (KieBuilderImpl.java:208)
    at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll (KieBuilderImpl.java:177)
    at irobot.RuleE.createKieContainer (RuleE.java:48)
    at irobot.RuleE.createStatelessKieSession (RuleE.java:36)
    at irobot.RuleE.<init> (RuleE.java:23)
    at irobot.Client.main (Client.java:30)
    at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:498)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:297)
    at java.lang.Thread.run (Thread.java:748)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.770 s
[INFO] Finished at: 2018-01-25T22:06:21+01:00
[INFO] Final Memory: 25M/208M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:java (default-cli) on project irobot: An exception occured while executing the Java class. null: InvocationTargetException: org/mvel2/ConversionHandler: org.mvel2.ConversionHandler -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
'cmd' is not recognized as an internal or external command,
operable program or batch file.
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

这是因为缺少MVEL依赖项,请尝试从此处添加: https://mvnrepository.com/artifact/org.mvel/mvel2