PVP/Using org.drools.persistence.jpa.marshaller.VariableEntity

54 views
Skip to first unread message

Basit Mustafa

unread,
Aug 2, 2020, 7:49:45 PM8/2/20
to Drools Development
I have spent three days struggling with an error and reading every single thread I can find on this issue, but cannot seem to tackle it.

Configuration
-Workbench & KIE 7.40.0.Final on Wildfly (using distribution and configs largely from the showcase github repo)
-Postgres 12 via DS in said configs - underlying DB is accessible, it is writing data (see below, Baseline Testing)

Baseline Testing
Examples work quite well, tested out pretty clearly with no problems. Maven repo from Workbench - KIE and server registration and updates, deploys all happen no problem. Starting flows, using them, totally normal. No issues. No odd warnings on consoles. 

Manually introspecting the PG 12 db via SQL UI shows data is certainly (both operational and info) is being written. 

Moving on...
We started development of our custom processes & entities, no problem, things working well, can use KIE API via REST to create instances of processes, pass in variables. 

Specifically, a very simple Entity passed into processes as a variable works, no problem, created Human Tasks, no problem. 

Leveling Up to Persisting Process Variables (PVP/Marshalling)
We first followed all the directions in jBPM documentation 10.5 "Persisting process variables in a separate database schema in jBPM".

As part of this process, we created a new Entity that extends org.drools.persistence.jpa.marshaller.VariableEntity

We verified that:
-The class is listed in the persistence unit config
- org.drools.persistence.jpa.marshaller.MappedVariable is listed as well
- the new org.drools.persistence.jpa.marshaller.JPAPlaceholderResolverStrategy("myPersistenceUnit", classLoader) has the proper string in place for "myPersistenceUnit"

Awkward, Not Working...
When we deployed the project after making said changes, we get the following error: 

java.lang.RuntimeException: [Error: could not create constructor: null] [kie-server-b985fc9b9-7sgbh] [Near : {... new org.drools.persistence.jpa.mar ....}]


But, we can avoid the error but lose the functions we need...
Making it implement Serializable but no longer extending org.drools.persistence.jpa.marshaller.VariableEntity and everything "works" without an error, and objects end up in the DB, but of course, we don't get the mapping functionality we need, which is the whole point, from VariableEntity...

Thoughts...
There is no table in the DB called "MappedVariables" - I would expect to see this, but I cannot seem to understand if the error here is happening BEFORE this would happen or this is happening BECAUSE said table was never created? Or is it something else? 

Thoughts on what is going wrong? 

Entity Class: https://pastebin.com/wC4cB8G7


Basit Mustafa

unread,
Aug 3, 2020, 12:08:16 AM8/3/20
to Drools Development
Turned on DEBUG for a bunch of things and think I'm getting closer. 

This line is a smoking gun: Unable to resolve class [org.drools.persistence.jpa.marshaller.MappedVariables] named in persistence unit [file:/opt/jboss/.m2/repository/com/agileonboarding/AgileCapture/1.0.1-SNAPSHOT/AgileCapture-1.0.1-SNAPSHOT.jar]

Makes sense, it's not finding the dep, but it is listed in the pom.xml (attached below), am I missing something else that's causing the class load failure? 

<?xml version="1.0" encoding="UTF-8"?>
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.agileonboarding</groupId>
  <artifactId>AgileCapture</artifactId>
  <version>1.0.1-SNAPSHOT</version>
  <packaging>kjar</packaging>
  <name>AgileCapture</name>
  <description></description>
  <dependencies>
      <dependency>
      <groupId>org.jbpm</groupId>
      <artifactId>jbpm-persistence-jpa</artifactId>
      <version>7.40.0.Final</version>
      <scope>provided</scope>
    </dependency>
     <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-persistence-api</artifactId>
      <version>7.40.0.Final</version>
      <scope>provided</scope>
    </dependency>
      <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-persistence-jpa</artifactId>
      <version>7.40.0.Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-api</artifactId>
      <version>7.40.0.Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-internal</artifactId>
      <version>7.40.0.Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-core</artifactId>
      <version>7.40.0.Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-persistence-jaxb</artifactId>
      <version>7.40.0.Final</version>
      <scope>provided</scope>
    </dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.12</version>
      <scope>test</scope>
    </dependency>
    <dependency>
      <groupId>com.thoughtworks.xstream</groupId>
      <artifactId>xstream</artifactId>
      <version>1.4.11.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
  <build>
    <plugins>
      <plugin>
        <groupId>org.kie</groupId>
        <artifactId>kie-maven-plugin</artifactId>
        <version>7.40.0.Final</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
</project>
Reply all
Reply to author
Forward
Reply all
Reply to author
Forward
0 new messages