2

我正在使用 Kie 工作台 6.3.0 创建规则。我正在尝试以流模式运行规则。我在 kie-wb 中创建了一个项目,并在其中创建了 kie-base。为此,我们正在使用 kie 服务器运行时。这是生成的 kmodule 代码:

<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>

以下是 persistence.xml 文件:

<?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>

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

Deployment of unit com.sample:SampleBusinessRules:2.7 failed: [Error: could not create constructor: null] [Near : {... new org.drools.persistence.jpa.mar ....}] ^ [Line: 1, Column: 5]

请帮我解决这个错误。谢谢

4

2 回答 2

3

我从 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 的编辑器中删除添加的行。

于 2016-08-30T06:15:27.730 回答
0

This persistence.xml file is for unit com.sample:EventBusinessRules:2.6.

<persistence-unit name="com.sample:EventBusinessRules:2.6" transaction-type="JTA">

The unit you try to deploy is com.sample:SampleBusinessRules:2.7. As a first step, I think you should try changing the name in xml.

于 2016-08-29T09:54:08.030 回答