java.lang.NoSuchMethodError from DmnEngineConfiguration.buildEngine() in 7.13.0-alpha3

Hello,

I am attempting to upgrade my Camunda project dependency from camunda-engine-dmn 7.12.0 to 7.13.0-alpha3. However, some Java Unit tests I had set up that worked with the previous version are now throwing an error when I run them with the newer version.

What is interesting is that, even with the new version, if I set enableFeelLegacyBehavior(true) on my DmnEngineConfiguration, the test passes fine. If I do not enable legacy FEEL behavior, the test fails by throwing the exception below. I do not want to use the legacy FEEL behavior, as I wish to implement custom functions through the Scala FEEL Engine.

Here is a simplified version of the Unit Test:

// Create Model Instance which we will fill in below.
DmnModelInstance modelInstance = Dmn.createEmptyModel();

// Create Definitions
Definitions definitions = modelInstance.newInstance(Definitions.class);
definitions.setNamespace("");
definitions.setName("definitions");
modelInstance.setDefinitions(definitions);

// Create Decision and append it to our model.
Decision decision = modelInstance.newInstance(Decision.class);
decision.setId("decision");
decision.setName("decisionTest");
definitions.addChildElement(decision);

// Create a Decision Table and append it to the decision.
DecisionTable decisionTable = modelInstance.newInstance(DecisionTable.class);
decisionTable.setHitPolicy(HitPolicy.FIRST);
decision.addChildElement(decisionTable);

// Create an Input and Input Expression and append to Decision Table.
Input input1 = modelInstance.newInstance(Input.class);
input1.setLabel("Season");
InputExpression inputExpression1 = modelInstance.newInstance(InputExpression.class);
inputExpression1.setTypeRef("string");
Text text = modelInstance.newInstance(Text.class);
text.setTextContent("season");
inputExpression1.setText(text);
input1.addChildElement(inputExpression1);
decisionTable.addChildElement(input1);

// Create Output and append to Decision Table.
Output output = modelInstance.newInstance(Output.class);
output.setLabel("Dish");
output.setName("dish");
output.setTypeRef("string");
decisionTable.addChildElement(output);

// Create a single Rule and append to Decision Table.
// season == "Summer".
Rule rule1 = modelInstance.newInstance(Rule.class);
// First Rule's input entry.
Text text1 = modelInstance.newInstance(Text.class);
text1.setTextContent("\"Summer\"");
InputEntry inputEntry = modelInstance.newInstance(InputEntry.class);
inputEntry.addChildElement(text1);
rule1.addChildElement(inputEntry);
// First Rule's output entry.
OutputEntry outputEntry = modelInstance.newInstance(OutputEntry.class);
Text text2 = modelInstance.newInstance(Text.class);
text2.setTextContent("\"Strawberries\"");
outputEntry.addChildElement(text2);
rule1.addChildElement(outputEntry);
// Append to Decision Table.
decisionTable.addChildElement(rule1);

// Validate.
Dmn.validateModel(modelInstance);

// Create DmnEngine.
DefaultDmnEngineConfiguration config = (DefaultDmnEngineConfiguration) DmnEngineConfiguration.createDefaultDmnEngineConfiguration();
config.setEnableFeelLegacyBehavior(false);
DmnEngine dmnEngine = config.buildEngine();

DmnDecision dmnDecision = dmnEngine.parseDecision("decision", modelInstance);

VariableMap variables = Variables
    .createVariables()
    .putValue("season", "Summer");

// Evaluate the Decision and analyze the result.
DmnDecisionTableResult decisionTableResult = dmnEngine.evaluateDecisionTable(dmnDecision, variables);
DmnDecisionRuleResult decisionRuleResult = decisionTableResult.getFirstResult();

Assert.assertEquals("Output from the Camunda DMN Engine was calculated incorrectly.", "Strawberries", decisionRuleResult.getEntry("dish"));

Here is the exception thrown from the test (when legacy FEEL behavior is turned off). It is thrown when building the DmnEngine:

Hi @Alex_Solorio,

thank you for reporting.

Based on the failure, I think that something is wrong with the dependencies (e.g. an older version of the FeelScala engine is included).

Please share the whole project including the pom.xml to reproduce the behavior.

Best regards,
Philipp

@Philipp_Ossler Thanks for the quick response! Our dependencies are:

camunda: [
   "org.camunda.bpm.extension.feel.scala:feel-engine:1.10.1",
   "org.camunda.bpm.dmn:camunda-engine-dmn-bom:7.13.0-alpha3",
   "org.camunda.bpm.dmn:camunda-engine-dmn:7.13.0-alpha3"
]

I played around with it a little bit, and it looks like if I remove that first dependency from the project (the standalone FEEL Scala Engine), the test will pass again. However, if it remains, the test fails with the original error. Do these two project dependencies not play well together?

We use both dependencies in separate parts of our project currently, but perhaps we need to unify to only require the 3rd dependency above…

:+1:

The Camunda DMN engine includes the FEEL-Scala engine in version 1.11.0. If you include an older version then it breaks (because of breaking changes) :slight_smile:

Since version 7.13.0-alpha2, the Camunda DMN engine comes with the FEEL-Scala engine. So, it is not necessary to include the engine explicitly.

Hi Phillip, could you share a complete list of the library dependencies of “org.camunda.bpm.extension.feel.scala:feel-engine:1.11.0” . I tried to install it on the Databricks cluster and failed with the error message below.

Library resolution failed. Cause: java.lang.RuntimeException: unresolved dependency: org.camunda.bpm.extension.feel.scala:feel-engine:1.11.0: not found
at com.databricks.libraries.server.MavenInstaller.doDownloadMavenPackages(MavenLibraryResolver.scala:437)
at com.databricks.libraries.server.MavenInstaller.$anonfun$downloadMavenPackages$2(MavenLibraryResolver.scala:381)
at com.databricks.backend.common.util.FileUtils$.withTemporaryDirectory(FileUtils.scala:464)
at com.databricks.libraries.server.MavenInstaller.$anonfun$downloadMavenPackages$1(MavenLibraryResolver.scala:380)
at com.databricks.logging.UsageLogging.$anonfun$recordOperation$4(UsageLogging.scala:432)
at com.databricks.logging.UsageLogging.$anonfun$withAttributionContext$1(UsageLogging.scala:240)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
at com.databricks.logging.UsageLogging.withAttributionContext(UsageLogging.scala:235)
at com.databricks.logging.UsageLogging.withAttributionContext$(UsageLogging.scala:232)
at com.databricks.libraries.server.MavenInstaller.withAttributionContext(MavenLibraryResolver.scala:57)
at com.databricks.logging.UsageLogging.withAttributionTags(UsageLogging.scala:277)
at com.databricks.logging.UsageLogging.withAttributionTags$(UsageLogging.scala:270)
at com.databricks.libraries.server.MavenInstaller.withAttributionTags(MavenLibraryResolver.scala:57)
at com.databricks.logging.UsageLogging.recordOperation(UsageLogging.scala:413)
at com.databricks.logging.UsageLogging.recordOperation$(UsageLogging.scala:339)
at com.databricks.libraries.server.MavenInstaller.recordOperation(MavenLibraryResolver.scala:57)
at com.databricks.libraries.server.MavenInstaller.downloadMavenPackages(MavenLibraryResolver.scala:379)
at com.databricks.libraries.server.MavenInstaller.downloadMavenPackagesWithRetry(MavenLibraryResolver.scala:137)
at com.databricks.libraries.server.MavenInstaller.resolveMavenPackages(MavenLibraryResolver.scala:113)
at com.databricks.libraries.server.MavenLibraryResolver.resolve(MavenLibraryResolver.scala:44)
at com.databricks.libraries.server.ManagedLibraryManager$GenericManagedLibraryResolver.resolve(ManagedLibraryManager.scala:246)
at com.databricks.libraries.server.ManagedLibraryManagerImpl.$anonfun$resolvePrimitives$1(ManagedLibraryManagerImpl.scala:186)
at com.databricks.libraries.server.ManagedLibraryManagerImpl.$anonfun$resolvePrimitives$1$adapted(ManagedLibraryManagerImpl.scala:181)
at scala.collection.Iterator.foreach(Iterator.scala:941)
at scala.collection.Iterator.foreach$(Iterator.scala:941)
at scala.collection.AbstractIterator.foreach(Iterator.scala:1429)
at scala.collection.IterableLike.foreach(IterableLike.scala:74)
at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
at com.databricks.libraries.server.ManagedLibraryManagerImpl.resolvePrimitives(ManagedLibraryManagerImpl.scala:181)
at com.databricks.libraries.server.ManagedLibraryManagerImpl$ClusterStatus.installLibsWithResolution(ManagedLibraryManagerImpl.scala:833)
at com.databricks.libraries.server.ManagedLibraryManagerImpl$ClusterStatus.installLibs(ManagedLibraryManagerImpl.scala:819)
at com.databricks.libraries.server.ManagedLibraryManagerImpl$InstallLibTask$1.run(ManagedLibraryManagerImpl.scala:479)
at com.databricks.threading.NamedExecutor$$anon$2.$anonfun$run$1(NamedExecutor.scala:345)
at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
at com.databricks.logging.UsageLogging.$anonfun$withAttributionContext$1(UsageLogging.scala:240)
at scala.util.DynamicVariable.withValue(DynamicVariable.scala:62)
at com.databricks.logging.UsageLogging.withAttributionContext(UsageLogging.scala:235)
at com.databricks.logging.UsageLogging.withAttributionContext$(UsageLogging.scala:232)
at com.databricks.threading.NamedExecutor.withAttributionContext(NamedExecutor.scala:275)
at com.databricks.threading.NamedExecutor$$anon$2.run(NamedExecutor.scala:345)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

The group id has changed since 1.11.0 . Please have a look here:

https://mvnrepository.com/artifact/org.camunda.feel/feel-engine/1.12.4

1 Like