Drols 异常无法加载方言 'mvel'

Drols exception Unable to load dialect 'mvel'

我正在尝试开始一个相当简单的例子

KieContainer kieContainer = KieServices.Factory.get().getKieClasspathContainer();
StatelessKieSession kieSession = kieContainer.newStatelessKieSession("MyStatelessValidationStep");

并且在第 2 行我得到一个错误 NullPointerException,这似乎是由异常 Unable to load dialect 'mvel' 引起的。 它发生在最新的 Drools 版本 7.57.0.Final 中,但可以正常使用,例如7.39.0.Final。我列出了试图找出这些版本之间发生了什么变化的文档,但找不到答案。那么,这是错误还是我的源代码中遗漏了一些新内容?

p.s.

这是我正在使用的库的列表:

ext {
    drools_version = '7.57.0.Final'
    slf4j_version = '1.7.32'
    mvel_version = '2.4.12.Final'
    junit_version = '5.6.0'
}

@“Roddy of the Frozen Peas”,这里是依赖项:

dependencies {
    // https://mvnrepository.com/artifact/org.drools/drools-core
    implementation group: 'org.drools', name: 'drools-core', version: "$drools_version"

    // https://mvnrepository.com/artifact/org.drools/drools-compiler
    implementation group: 'org.drools', name: 'drools-compiler', version: "$drools_version"

    // https://mvnrepository.com/artifact/org.kie/kie-api
    compileOnly group: 'org.kie', name: 'kie-api', version: "$drools_version"

    // https://mvnrepository.com/artifact/org.kie/kie-internal
    implementation group: 'org.kie', name: 'kie-internal', version: "$drools_version"

    // https://mvnrepository.com/artifact/org.slf4j/slf4j-api
    implementation group: 'org.slf4j', name: 'slf4j-api', version: "$slf4j_version"

    // https://mvnrepository.com/artifact/org.slf4j/slf4j-nop
    implementation group: 'org.slf4j', name: 'slf4j-nop', version: "$slf4j_version"

    // https://mvnrepository.com/artifact/org.mvel/mvel2
    implementation group: 'org.mvel', name: 'mvel2', version: "$mvel_version"

    testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_version"
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

请注意,如果我将 compileOnly 替换为 implementation 作为 kie-api,最终结果没有任何变化 - 我仍然得到 NPE.

由于 7.45.0.Final MVEL 评估已移至名为 drools-mvelsee the release notes 的单独模块。请也添加该模块或改用聚合器模块 drools-engine-classic