# Tengo un error que se muestra en el log y no me permite ejecutar una query desde Groovy Script:  sql.executeQuery():GRAVE: Message: Operation not allowed after ResultSet closed

**URL:** <https://community.ofelia.com/t/tengo-un-error-que-se-muestra-en-el-log-y-no-me-permite-ejecutar-una-query-desde-groovy-script-sql-executequery-message-operation-not-allowed-after-resultset-closed/7604>\
**Category:** Q&A\
**Created:** [14 July 2016 15:30 UTC](https://community.ofelia.com/t/tengo-un-error-que-se-muestra-en-el-log-y-no-me-permite-ejecutar-una-query-desde-groovy-script-sql-executequery-message-operation-not-allowed-after-resultset-closed/7604 "2016-07-14T15:30:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hectorta](https://avatars.discourse-cdn.com/v4/letter/h/a87d85/32.png) [@hectorta](https://community.ofelia.com/u/hectorta)\
**Post date:** [14 July 2016 15:30 UTC](https://community.ofelia.com/t/tengo-un-error-que-se-muestra-en-el-log-y-no-me-permite-ejecutar-una-query-desde-groovy-script-sql-executequery-message-operation-not-allowed-after-resultset-closed/7604/1 "2016-07-14T15:30:31Z")

</div>

Buenas tardes a todos.  
Soy Nuevo en Bonita 7.2, estoy atascado en intentar mostrar los valores en una tabla personalizada desde una base de datos Mysql  
Estoy ejecutando un Script groovy desde Bonita 7.2 y obtengo el siguiente error:` GRAVE: Message: Operation not allowed after ResultSet closed `. Y no entiendo por qué me da este error si no he cerrado el resultSet.

Este es mi 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());
}
}
`

Aqui está el StackTrace completo:  
`
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)]
`

Saludos y gracias
