Drools 6.50使用JDK 1.8时出错

时间:2017-02-17 01:41:29

标签: compiler-errors drools

运行drools-core 6.5.0.Final时出现错误,在mule中使用简单的弹簧配置。我使用的是spring 4.3.5.Final和JDK 1.8。我收到了一个错误  org.mule.module.launcher.DeploymentInitException:NoSuchFieldError:COMPILER_OPT_ALLOW_RESOLVE_INNERCLASSES_WITH_DOTNOTATION     在org.mule.module.launcher.application.DefaultMuleApplication.init(DefaultMuleApplication.java:205。初始化和验证KieContainer时失败。请注意我解压缩了存档,存档中没有冲突的jar。我只找到了2 drools特定的jar,drools-core和drools-decisiontables,版本6.5.0.Final。此外,没有重复的jar用于剩余的依赖项.pom只有所有spring框架4.3.5.RELEASE和Hibernate 4.3。< / p>

  kieContainer = KieServices.Factory.get().getKieClasspathContainer();

  LOG.info(kieContainer.verify().getMessages().toString());

我正在处理Excel电子表格决策表。

         <?xml version="1.0" encoding="UTF-8"?>

      <mule xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc=
       "http://www.mulesoft.org/schema/mule/documentation"
      xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.8.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-current.xsd
         http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">
        <spring:beans>
            <spring:bean id="letter" name="letter" class="org.springframework.core.io.ClassPathResource">
                    <spring:constructor-arg name="path" value="com/xyz/db-config.xml"/>
            </spring:bean>
        <spring:bean id="stylusConfiguration"  name="stylusConfiguration" class="com.xyz.Talent">
                <spring:property name="config">
                    <spring:map>
                        <spring:entry key="member" value-ref="letter"/>
                    </spring:map>
                </spring:property>
            </spring:bean>

        <spring:bean id="builderFactory" name="builderFactory" class="com.xyz.BuilderFactory" 
        factory-method="newInstance"/>
        <spring:bean id="translator" name="translator" class="com.xyz.TranslatorConfigurator">
            <spring:property name="factory" ref="builderFactory"/>
            <spring:property name="stylus" ref="stylusConfiguration"/>
        </spring:bean>

        <spring:bean id="eLander" name="eLander"   class="com.xyz.transformers.TranslatorConfigurer">
           <spring:property name="translator" ref="translator"/>
        </spring:bean>

        </spring:beans>

我搜索了一个原因,但没有找到答案。问题似乎与mvel库有关,但我不知道可能触发它的是什么。请帮忙!

        </mule>

我可以从堆栈跟踪中看到问题出现在我实现的spring方法中 它在LOG.info下面失败了

     @Override
 public void afterPropertiesSet() throws Exception {
    kieContainer = ...;

        LOG.info(kieContainer.verify().getMessages().toString());
    try {


                  this.builder=factory.newDocumentBuilder();

             } catch (ParserConfigurationException e) {

以下是我的pom中的依赖项:

                             <dependencies>
                <dependency>
                  <groupId>junit</groupId>
                  <artifactId>junit</artifactId>
                  <version>3.8.1</version>
                  <scope>test</scope>
                </dependency>

                        <dependency>
                <groupId>org.drools</groupId>
                <artifactId>drools-core</artifactId>
                <version>6.5.0.Final</version>
            </dependency>
            <dependency>
                <groupId>org.springframework</groupId>
                <artifactId>spring-core</artifactId>
                <version>4.3.6.RELEASE</version>
            </dependency>

            <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>4.3.6.RELEASE</version>
        </dependency>

        <dependency>
         <groupId>commons-io</groupId>
         <artifactId>commons-io</artifactId>
          <version>2.5</version>
        </dependency>

                   <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-beans</artifactId>
            <version>4.3.6.RELEASE</version>
        </dependency>

        <dependency>
         <groupId>org.drools</groupId>
         <artifactId>drools-decisiontables</artifactId>
         <version>6.5.0.Final</version>
        </dependency>
              <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator</artifactId>
        <version>4.3.1.Final</version>
      </dependency>
              <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>4.3.5.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>javax.persistence</groupId>
        <artifactId>persistence-api</artifactId>
        <version>1.0</version>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>4.3.5.Final</version>
    </dependency>



          </dependencies>

1 个答案:

答案 0 :(得分:0)

问题在于类加载器。我做了以下解决问题:

 KieServices ks = KieServices.Factory.get();
        kieContainer = ks.newKieClasspathContainer(getClass    ().getClassLoader());