Error Jasper connector (new version 2021)

Hello,

I am testing the new version 2021 (currently 7.3.3) and, after migrating a process, when it generates a report it gives the following error:

----

10-Mar-2021 11:38:09.074 INFO [ConnectorExecutor-3] org.bonitasoft.connectors.jasper.CreateReportFromDataBase.createJasperReportFromDataBase Creating a new Jasper Report from database

10-Mar-2021 11:38:09.110 SEVERE [ConnectorExecutor-3] org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl.log THREAD_ID=174 | HOSTNAME=GTUTICTECDEV02 | TENANT_ID=1 | The work [ExecuteConnectorOfActivity: flowNodeInstanceId = 60024, connectorDefinitionName = generaReportDocSolicitud] failed. The failure will be handled.

10-Mar-2021 11:38:09.152 INFO [ConnectorExecutor-3] org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl.log THREAD_ID=174 | HOSTNAME=GTUTICTECDEV02 | TENANT_ID=1 | Process instance 3003 and its children were aborted by flownode 60026

10-Mar-2021 11:38:09.168 SEVERE [ConnectorExecutor-3] org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl.log THREAD_ID=174 | HOSTNAME=GTUTICTECDEV02 | TENANT_ID=1 | org.bonitasoft.engine.commons.exceptions.SBonitaRuntimeException : "java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap"

  org.bonitasoft.engine.commons.exceptions.SBonitaRuntimeException: java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap

    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.lambda$execute$0(ConnectorExecutorImpl.java:159)

    at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source)

    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)

    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

    at java.base/java.lang.Thread.run(Unknown Source)

  Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections/map/ReferenceMap

    at net.sf.jasperreports.engine.util.JRSingletonCache.<init>(JRSingletonCache.java:53)

    at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.<clinit>(JRXmlDigesterFactory.java:197)

    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:262)

    at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:247)

    at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:338)

    at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:605)

    at org.bonitasoft.connectors.jasper.CreateReportFromDataBase.createJasperReportFromDataBase(CreateReportFromDataBase.java:307)

    at org.bonitasoft.connectors.jasper.CreateReportFromDataBase.executeBusinessLogic(CreateReportFromDataBase.java:212)

    at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:77)

    at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:74)

    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:258)

    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:217)

    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.lambda$wrapForStats$1(ConnectorExecutorImpl.java:169)

    at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.lambda$execute$0(ConnectorExecutorImpl.java:156)

    ... 4 more

  Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.map.ReferenceMap

    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1358)

    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1180)

    at org.bonitasoft.engine.classloader.VirtualClassLoader.loadClass(VirtualClassLoader.java:105)

    at org.bonitasoft.engine.classloader.BonitaClassLoader.loadClass(BonitaClassLoader.java:175)

    at org.bonitasoft.engine.classloader.VirtualClassLoader.loadClass(VirtualClassLoader.java:102)

    at org.bonitasoft.engine.classloader.BonitaClassLoader.loadClass(BonitaClassLoader.java:175)

    at java.base/java.lang.ClassLoader.loadClass(Unknown Source)

    ... 18 more

----

After installing the new version, I did not find the Jasper connector. What I did was export / import it.

Thanks

I guess you are using https://github.com/Bonitasoft-Community/bonita-connector-jasper

This connector hasn't been updated for a while and it probably cannot be used out of the box with Bonita Community 2021.1

Disclaimer: I don't know if this connector is supported nor if someone is working on it

 

The error in the logs states that the connector needs to load Apache commons-collections 1.x or 2.x classes (org/apache/commons/collections/...). Bonita now ships Apache commons-collections 4.x and related classes are in org/apache/commons/collections4 (commons-collections 3.x would be in org/apache/commons/collections3). So this is why classes are missing (if the connector doesn't provide .

Workaround to be tested: copy commons-collections 2.x jar in BONITA_INSTALLATION/server/webapps/WEB-INF/lib (path will be slightly different if you are using a Bonita Studio) and restart the Bonita server. You can retrieve the commons-collections jar from your 7.3.3 installation.

But be ready to face other issues afterwards as this connector seems out dated.

You may probably fill an issue or provide a Pull Request directly in the bonita-connector-jasper project to go any further.