"NoSuchMethodError" seen when deploying BE application

"NoSuchMethodError" seen when deploying BE application

book

Article ID: KB0072919

calendar_today

Updated On:

Products Versions
TIBCO BusinessEvents Enterprise Edition 5.6 and later

Description

When deploying our BE application, the deployment fails with the error:
ErrorStackTrace=com.tibco.cep.runtime.model.exception.impl.BEExceptionImpl: java.lang.NoSuchMethodError: 
com.tibco.be.functions.java.util.collection.CollectionHelper.toArray(Ljava/lang/Object;)Ljava/lang/Object;
The application runs fine in a local test environment. How can we resolve this error in our deployment environment?

Issue/Introduction

Outlines some common configuration errors that result in a NoSuchMethodError when deploying a recently-upgraded BE application.

Environment

All Supported Environments

Resolution

This error indicates the application is referring to BE libraries and/or plugins from a different BE version than the one used to build the application archive/image.

If applicable, check your project's pom.xml for any older/incorrect versions of BE-related dependencies and/or plugins. For example, if your application was originally developed in BE 5.6.0, you should expect to see the following reference to the BE maven plugin:
<plugins>
  <plugin>
    <groupId>com.tibco.be.maven.plugin</groupId>
    <artifactId>be-maven-plugin</artifactId>
    <version>5.6.0</version>
If you have since upgraded your deployment environment to use BE 6.1, for example, you can expect to see the above error in the console log. The solution would be to install the updated BE 6.1 maven plugin, and update the <version> in your pom.xml.

In addition, ensure the Java version you're referencing is compatible with the version of BE. For example..
<be.home>/opt/jenkins/tools/tibco/be/5.6</be.home>
<be.local>C:\tibco\be\5.6</be.local>
<java.version>1.8</java.version>
This again, would be incompatible for a BE 6.1 application, since the older BE 5.6 home and Java version (1.8) are still being referenced. For BE 6.1, these should be corrected as follows:
<be.home>/opt/jenkins/tools/tibco/be/6.1</be.home>
<be.local>C:\tibco\be\6.1</be.local>
<java.version>11</java.version>