【发布时间】:2021-02-27 20:16:47
【问题描述】:
尝试将现有应用程序从 Wildfly 10.0.0.Final 升级到 WildFly 21.0.0.Final 并将其移动到容器中。我正在使用 Java 11 和最新版本的 Drools (7.46.0.Final)。当我启动 WildFly 14 或更高版本时,Drools 尝试加载时出现以下错误:
ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 96) MSC000001: Failed to start service jboss.deployment.unit."example.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.unit."example.war".undertow-deployment: java.lang.RuntimeException: java.lang.RuntimeException: Cannot find KieModule: com.package:example-validation:0.0.1
就在这一行之前,我在日志中注意到这条消息:
[org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (ServerService Thread Pool -- 96) Artifact not fetched from maven: com.package:example-validation:0.0.1-SNAPSHOT. To enable the KieScanner you need kie-ci on the classpath
奇怪的是我将 kie-ci 放在类路径中。以下是子示例验证项目的 pom.xml 的相关部分:
<packaging>kjar</packaging>
<artifactId>example-validation</artifactId>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<addMavenDescriptor/>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.kie</groupId>
<artifactId>kie-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-ci</artifactId>
<version>${drools.version}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-compiler</artifactId>
</dependency>
....
</dependencies>
但是当我在子项目上运行 mvn clean install 时,我收到以下消息:
[INFO] Artifact not fetched from maven: org.drools:drools-compiler:7.46.0.Final. To enable the KieScanner you need kie-ci on the classpath
[INFO] Artifact not fetched from maven: org.kie:kie-ci:7.46.0.Final. To enable the KieScanner you need kie-ci on the classpath
如何在类路径中获取 kie-ci,以便在类路径中获取 kie-ci?我看到有人在这里遇到了类似的问题(Drools session will not load after Wildfly Upgrade to 19.0.0),但公认的解决方案是升级 Drools(我有)。同样,这适用于 Wildfly 10.0.0.Final,因此我认为这与我们的规则无关,因为我们现有的 Drools 版本(6.5.0.Final)也存在同样的问题。我也尝试将 kie-ci 添加到父项目中,但没有骰子。
【问题讨论】: