无法创建构造函数:: Kie Workbench

时间:2016-08-29 06:52:02

标签: drools complex-event-processing kie drools-fusion kie-wb

我正在使用Kie workbench 6.3.0来创建规则。我试图在流模式下运行规则。 我在kie-wb中创建了一个项目并在其中创建了kie-base。 我们正在使用kie服务器运行时。 这是生成的kmodule代码:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<button id="add">
  Add to catcher: <span></span>
</button>
<button id="stop">
  Stop catching
</button>
<h2>Catcher:</h2>
<div id="catcher"></div>

以下是persistence.xml文件:

<kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <kbase name="myKieBase" default="false" eventProcessingMode="stream" equalsBehavior="identity" packages="*"/>
</kmodule>

从Kie WB部署项目时出现以下错误

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:orm="http://java.sun.com/xml/ns/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd">
    <persistence-unit name="com.sample:EventBusinessRules:2.6" transaction-type="JTA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
        <class>com.sample.EventData</class>
        <exclude-unlisted-classes>true</exclude-unlisted-classes>
        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect"/>
            <property name="hibernate.max_fetch_depth" value="3"/>
            <property name="hibernate.hbm2ddl.auto" value="update"/>
            <property name="hibernate.show_sql" value="false"/>
            <property name="hibernate.id.new_generator_mappings" value="false"/>
            <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/>
        </properties>
    </persistence-unit>
</persistence>

请帮我解决此错误。 谢谢

2 个答案:

答案 0 :(得分:2)

我从kie-deployment-descriptor.xml中删除了编组标记,并且在部署项目时没有出现任何错误。

<marshalling-strategy>
                <resolver>mvel</resolver>
                <identifier>new org.drools.persistence.jpa.marshaller.JPAPlaceholderResolverStrategy("com.sample.rules:EventBusinessRules:2.6", classLoader)</identifier>
                <parameters/>
            </marshalling-strategy>

此标记位于<marshalling-strategies>下方。 从kie-deployment-descriptor.xml的编辑器中删除添加的行。

答案 1 :(得分:0)

此persistence.xml文件适用于单元com.sample:EventBusinessRules:2.6。

app.directive("myDirective", function ($rootScope) {

    return {
        controller: function ($scope) {

        }, //end of controller
        restrict: 'A',
        // element must have ng-model attribute.
        require: 'ngModel',
        link: function ($scope, ele, attrs, ngModel, $rootScope) {

            ele.on('blur', function () {
               //write functionality here 

            });

        }, //end of link function
    } //end of return
}); //end of myDirective

您尝试部署的单元是com.sample:SampleBusinessRules:2.7。作为第一步,我认为您应该尝试更改xml中的名称。