Hi all
I am a newbie at Bonita 7.2, struggling with displaying values, retrieved from a My SQL DB, in a custom table Widget. I need a little help, please.
I’m executin a groovy script, from Bonita 7.2 and I get an error saying: GRAVE: Message: Operation not allowed after ResultSet closed
. I don’t understand it because I don’t have closed the resultSet.
This is my GroovyScript:
String consulta = “SELECT * FROM reportes”;
SMSOpConfig smsOpConfig = new SMSOpConfig();
SMSOpBase.connectSMS(smsOpConfig.getDBUrl(), smsOpConfig.getDBUser(), smsOpConfig.getDBPass());
//SMSOpBase.connectSMS();
loggerJava.info("Notificacion: desc");
//+notificacionRiesgo.getDescripcion() +" , titulo: "+ notificacionRiesgo.getTitulo() +" , codigo: "+notificacionRiesgo.getCodigo(), notificacionRiesgo.getOperador(),notificacionRiesgo.getTipoOperacion(), notificacionRiesgo.getMatricula(), notificacionRiesgo.getVuelo(), notificacionRiesgo.getCallSign(), notificacionRiesgo.getModerador(), notificacionRiesgo.getEstado(), notificacionRiesgo.getObligatoriedad(), notificacionRiesgo.getIncidenciaPadre(), notificacionRiesgo.getDni(),notificacionRiesgo.getNombre(),notificacionRiesgo.getApellidos(),notificacionRiesgo.getCorreo(),notificacionRiesgo.getTipo()+" , asunto: "+notificacionRiesgo.getAsunto());
resultSet = SMSOpBase.getConn().executeQuery(consulta);
// (consulta,notificacionRiesgo.getId(),notificacionRiesgo.getDescripcion(),notificacionRiesgo.getTitulo(),notificacionRiesgo.getCodigo(), notificacionRiesgo.getOperador(),notificacionRiesgo.getTipoOperacion(), notificacionRiesgo.getMatricula(), notificacionRiesgo.getVuelo(), notificacionRiesgo.getCallSign(), notificacionRiesgo.getModerador(), notificacionRiesgo.getEstado(), notificacionRiesgo.getObligatoriedad(), notificacionRiesgo.getIncidenciaPadre(), notificacionRiesgo.getDni(),notificacionRiesgo.getNombre(),notificacionRiesgo.getApellidos(),notificacionRiesgo.getCorreo(),notificacionRiesgo.getTipo(),notificacionRiesgo.getAsunto(),new Date());
while (resultSet.next()) {
loggerJava.info("************************************** REPORTES id: " + resultSet.getInt("id") +
"entidad_reportante: " + resultSet.getString(2) +
" entidad_reportante_name: " + resultSet.getString(3));
}
// SMSOpBase.closeConnection();
loggerJava.info(“#########################################################################################################script eNTRADA , scriptLeeReportes”);
/*
logger.error(“-----ERROR guardar en bbdd”); /
} catch (e2) {
loggerJava.error("ERROR: scriptLeeReportes Notificación de BBDD********************************");
// loggerJava.error("Cause: "+ e2.getCause());
loggerJava.error("Message Localized: "+ e2.getLocalizedMessage().toString());
loggerJava.error("Message: "+ e2.getMessage().toString());
loggerJava.error("GetStacktrace.ToString: "+ e2.getStackTrace().toString());
}finally{
try{resultSet.close();}catch(Exception e){}
try{SMSOpBase.closeConnection();}catch(Exception e1){
loggerJava.error(“ERROR: scriptLeeReportes Notificación de BBDD*********************************”);
// loggerJava.error("Cause: "+ e2.getCause());
loggerJava.error("Message Localized: "+ e1.getLocalizedMessage().toString());
loggerJava.error("Message: "+ e1.getMessage().toString());
loggerJava.error("GetStacktrace.ToString: "+ e1.getStackTrace().toString());
}
}
Here is the hole StackTrace:
GRAVE: GetStacktrace.ToString: [com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074), com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988), com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974), com.mysql.jdbc.SQLError.createSQLException(SQLError.java:919), com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java:804), com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:6986), java_sql_ResultSet$next.call(Unknown Source), org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48), org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113), org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117), Script1.run(Script1.groovy:93), groovy.lang.GroovyShell.evaluate(GroovyShell.java:591), groovy.lang.GroovyShell.evaluate(GroovyShell.java:629), groovy.lang.GroovyShell.evaluate(GroovyShell.java:600), org.bonitasoft.connectors.scripting.GroovyScriptConnector.executeBusinessLogic(GroovyScriptConnector.java:48), org.bonitasoft.engine.connector.AbstractConnector.execute(AbstractConnector.java:77), org.bonitasoft.engine.core.connector.impl.SConnectorAdapter.execute(SConnectorAdapter.java:73), org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:205), org.bonitasoft.engine.connector.impl.ConnectorExecutorImpl$ExecuteConnectorCallable.call(ConnectorExecutorImpl.java:176), java.util.concurrent.FutureTask.run(FutureTask.java:262), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615), java.lang.Thread.run(Thread.java:745)]
Thank you!!