在 Wildfly 上部署 KIE-CI 失败

Posted

技术标签:

【中文标题】在 Wildfly 上部署 KIE-CI 失败【英文标题】:Deploy KIE-CI on Wildfly fails 【发布时间】:2014-06-22 21:07:52 【问题描述】:

我正在尝试在 Wildfly 8.0.0.Final 上使用 KIE-CI(用于动态 Maven 打包规则)部署 Drools。

我的简约测试项目的POM是:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>de.testing</groupId>
    <artifactId>testprojekt</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>

    <properties>
        <drools-version>6.0.1.Final</drools-version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-core</artifactId>
            <version>$drools-version</version>
        </dependency>
        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-compiler</artifactId>
            <version>$drools-version</version>
        </dependency>
        <dependency>
            <groupId>org.kie</groupId>
            <artifactId>kie-ci</artifactId>
            <version>$drools-version</version>
        </dependency>
    </dependencies>
</project>

部署失败并出现以下错误:

11:58:35,430 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."testprojekt-1.0-SNAPSHOT.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."testprojekt-1.0-SNAPSHOT.war".WeldStartService: Failed to start service
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_51]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_51]
    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_51]
Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 2 exceptions:
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Injector with qualifiers @Default
  at injection point [BackedAnnotatedField] @Inject private org.sonatype.guice.bean.binders.TypeConverterMap.injector
  at org.sonatype.guice.bean.binders.TypeConverterMap.injector(TypeConverterMap.java:0)

    at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:368)
    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:289)
    at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:135)
    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:166)
    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:514)
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001408: Unsatisfied dependencies for type Injector with qualifiers @Default
  at injection point [BackedAnnotatedParameter] Parameter 1 of [BackedAnnotatedMethod] @Inject org.sonatype.guice.bean.locators.DefaultBeanLocator.autoPublish(Injector)
  at org.sonatype.guice.bean.locators.DefaultBeanLocator.autoPublish(DefaultBeanLocator.java:0)

    at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:368)
    at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:289)
    at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:135)
    at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:166)
    at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:514)
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:68)
    at org.jboss.weld.bootstrap.ConcurrentValidator$1.doWork(ConcurrentValidator.java:66)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:60)
    at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:53)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:744)

    at org.jboss.weld.bootstrap.ConcurrentValidator.validateBeans(ConcurrentValidator.java:76)
    at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:475)
    at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:392)
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:85)
    at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:93)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
    ... 3 more

(还有一些类似的例外)

如果我从 kie-ci 依赖项中排除 sisu-inject-plexus,它会起作用,例如:

<exclusions>
    <exclusion>
        <groupId>org.sonatype.sisu</groupId>
        <artifactId>sisu-inject-plexus</artifactId>
    </exclusion>
</exclusions>

但我在“真实”项目中需要这种依赖关系。

有人知道如何让这两个(Wildfly 和 Drools 与 KIE-CI)一起工作吗?和建议,我应该在哪里提交错误报告?

【问题讨论】:

【参考方案1】:

嗯...搜索后半天后总是会出现决议...

问题在于within the CDI 1.1 specification。 Wildfly 的解决方案很简单,甚至写成in the WELD documentation:

将以下内容添加到META-INF/jboss-all.xml的 应用

<jboss xmlns="urn:jboss:1.0">
    <weld xmlns="urn:jboss:weld:1.0" require-bean-descriptor="true"/>
</jboss>

【讨论】:

以上是关于在 Wildfly 上部署 KIE-CI 失败的主要内容,如果未能解决你的问题,请参考以下文章

Wildfly 命令行部署失败

如何让 JBoss/WildFly 在应用程序部署/初始化失败时自动终止?

使用 RESTEasy、Weld 和 Wildfly 失败的 @Inject 对象

在“更新服务器的部署扫描程序:WildFly 23”期间发生内部错误

Spring Boot 应用程序未部署在 Wildfly 上

如何减少 Wildfly 部署所需的时间?