could not create constructor :: Kie Workbench

1.1k Views Asked by At

I am using Kie workbench 6.3.0 to create rules. I am trying to run rule in stream mode. I have created a project in kie-wb and created kie-base in it. We are using kie server runtime for this. This is the kmodule code generated:

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

And following is the persistence.xml file:

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

While deploying the project from Kie WB am getting the following error

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]

Please help me to resolve this error. Thank you

2

There are 2 best solutions below

1
On

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.

1
On

I removed the marshalling tag from kie-deployment-descriptor.xml and i didn't got any error while deploying project.

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

This tag is present under <marshalling-strategies>. From Editor of kie-deployment-descriptor.xml remove the row added.