Error executing two jasper connectors in parallel

I have two tasks after a parallel gateway, each of the executing a Jasper connector with different jrxml files and the same database configuration. They generate the following exception (complete stack trace at the bottom):

org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.

I supposed the two connectors were interfering with each other so I added an event that captures the error and goes to a timer that waits one or two seconds (at random) and goes back to the task to try again.

This workaround is doing ok but I would like to make things right and get these two connectors to work in parallel without errors. I pretend to use this process in a production environment with multiple users and I need to avoid any concurrency errors.

Please help

Complete stack trace:

GRAVE: THREAD_ID=2340 | HOSTNAME=xps12 | TENANT_ID=1 | The work [ExecuteConnectorOfActivity: flowNodeInstanceId = 1657, connectorDefinitionName = Crear Report Evolucion] failed. The failure will be handled.
2015-10-23 20:35:06.140 +0200 org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork org.bonitasoft.engine.log.technical.TechnicalLoggerSLF4JImpl log
GRAVE: THREAD_ID=2340 | HOSTNAME=xps12 | TENANT_ID=1 | org.bonitasoft.engine.core.connector.exception.SConnectorException : “PROCESS_DEFINITION_ID=6691142649399358496 | PROCESS_NAME=Test jasper | PROCESS_VERSION=1.0 | PROCESS_INSTANCE_ID=175 | ROOT_PROCESS_INSTANCE_ID=175 | FLOW_NODE_DEFINITION_ID=6029371426308825705 | FLOW_NODE_INSTANCE_ID=1657 | FLOW_NODE_NAME=Generar Evolución | CONNECTOR_DEFINITION_IMPLEMENTATION_CLASS_NAME=Crear Report Evolucion | CONNECTOR_INSTANCE_ID=344 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.”
org.bonitasoft.engine.core.connector.exception.SConnectorException: PROCESS_DEFINITION_ID=6691142649399358496 | PROCESS_NAME=Test jasper | PROCESS_VERSION=1.0 | PROCESS_INSTANCE_ID=175 | ROOT_PROCESS_INSTANCE_ID=175 | FLOW_NODE_DEFINITION_ID=6029371426308825705 | FLOW_NODE_INSTANCE_ID=1657 | FLOW_NODE_NAME=Generar Evolución | CONNECTOR_DEFINITION_IMPLEMENTATION_CLASS_NAME=Crear Report Evolucion | CONNECTOR_INSTANCE_ID=344 | org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:325)
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnector(ConnectorServiceImpl.java:143)
at org.bonitasoft.engine.connector.ConnectorServiceDecorator.executeConnector(ConnectorServiceDecorator.java:111)
at org.bonitasoft.engine.execution.work.ExecuteConnectorWork.work(ExecuteConnectorWork.java:131)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.failurewrapping.TxInHandleFailureWrappingWork.work(TxInHandleFailureWrappingWork.java:42)
at org.bonitasoft.engine.execution.work.FailureHandlingBonitaWork.work(FailureHandlingBonitaWork.java:66)
at org.bonitasoft.engine.work.BonitaWork.run(BonitaWork.java:56)
at org.bonitasoft.engine.work.SequenceRunnableExecutor.innerRun(SequenceRunnableExecutor.java:47)
at org.bonitasoft.engine.work.BonitaRunnable.run(BonitaRunnable.java:35)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:128)
at org.bonitasoft.engine.core.connector.impl.ConnectorServiceImpl.executeConnectorInClassloader(ConnectorServiceImpl.java:317)
… 14 more
Caused by: java.util.concurrent.ExecutionException: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:192)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.getValue(ConnectorExecutorImpl.java:152)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl.execute(ConnectorExecutorImpl.java:122)
… 15 more
Caused by: org.bonitasoft.engine.connector.exception.SConnectorException: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:71)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:208)
at org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:179)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
… 3 more
Caused by: org.bonitasoft.engine.connector.ConnectorException: org.postgresql.util.PSQLException: This connection has been closed.
at org.bonitasoft.connectors.jasper.CreateReportFromDataBase.executeBusinessLogic(CreateReportFromDataBase.java:213)
at org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:77)
at org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:69)
… 6 more
Caused by: org.postgresql.util.PSQLException: This connection has been closed.
at org.postgresql.jdbc2.AbstractJdbc2Connection.checkClosed(AbstractJdbc2Connection.java:822)
at org.postgresql.jdbc2.AbstractJdbc2Connection.rollback(AbstractJdbc2Connection.java:839)
at org.bonitasoft.connectors.jasper.CreateReportFromDataBase.createJasperReportFromDataBase(CreateReportFromDataBase.java:355)
at org.bonitasoft.connectors.jasper.CreateReportFromDataBase.executeBusinessLogic(CreateReportFromDataBase.java:211)
… 8 more

Yes, I can run them in sequence as you suggest and I don’t get this error, but the problem persists in different cases of the same process, executed by different users.

I mean that if user1 and user2 execute this process at the same time I get this error too!!

While I agree, a minor inconvenience, why not just run them in sequence? they are reports after all…

I would however report this as a bug, and hopefully Bonitasoft will fix it in a new release.

regards

Ahhh, you didn’t say that… :slight_smile:

I would definitely report a bug in this case. https://bonita.atlassian.net

regards

Ok, I will report a bug.
Thank you!

m having a hard time getting my PDF file filled, it’s always coming out blank. Could you show me how you set up your report? Thank you

I have not done anything special, just fill in the connector fields selecting PDF as output in my case. When I get the report coming out blank is because the query returns no data, so check out if that is your case. I recommend debugging the jrxml using iReport preview before using it in a Bonita diagram.

I made the debugging in the preview of Jasper Studio and everything worked fine, I even did a test to generate a * .jrxml file with only a fixed text but even then the PDF goes blank. What version of Jasper Studio did you report to? I make mine in version 5.6.0 of Jasper Studio

@fenros, Would not you have a file generated at Jasper Studio by you to send me just to see how you did?

I use iReport-5.1.0 and in Bonita I add the following JAR files as dependecies to the process:

postgresql-9.2-1002.jdbc4.jar
jasperreports-5.1.0.jar
commons-digester-2.1.jar
itext-2.1.7.jar
jcommon-1.0.15.jar

Hope this helps.

Did you happen to have an iReport 5.1.0 installation executable file (* .exe) to share with me? Or just a link so I can download it, because I can not download this program and make it work it opens the first screen and never loads the program

Create a jrxml with a simple select query and add some text to the page header and a text field with $F{column} in a detail band, and that should work.

Sorry, I don’t have the executable but your problem may have a workaround. Try googling it.

I’ve already done a test by putting just a title written “JASPER TEST” but even then the generated file dont had some content, the problem is that I only managed to download version 5.6.0 of jasper studio so I do not know if this could not be causing

Worse than that I’m two days looking for ways to make my reports work and nothing has been resolved yet

You would not just have a * jrxml file to share with me?

I was able to generate a report now, but everything I put in the “Details” section does not appear in the report, my configuration is like this:

Link Image