N/A Exception in connector database

AntoninoProva

Member
{
"status": "ERROR",
"message": "argument \"content\" is null",
"exception": "IllegalArgumentException",
"timeStamp": "2023-09-07T12:50:39.675+0200"
}

hi, i ran the query which is in the below code but it doesn't run because it gives this exception. Am I doing something wrong?

import com.oracle.e1.common.OrchestrationAttributes;
HashMap<String, Object> main(OrchestrationAttributes orchAttr, Sql sqlInst, HashMap inputMap)
{
HashMap<String, Object> returnMap = new HashMap<String, Object>();
orchAttr.writeWarn("START DB Groovy");
/*Query che fa select della tab crpdta.F0011W*/
String querySelect = "SELECT ICICUT AS CAMPO 1, ICICU AS CAMPO2 FROM schemaDB.F0011W"
def righe = sql.rows(querySelect);

try {
def jsonArray = JsonOutput.toJson(righe);
returnMap.put("DATI", jsonArray);
} catch (Exception e) {
orchAttr.writeWarn("ERRORE IN CONNECTOR: ");
returnMap.put("returnStatus", "Falso");
}
orchAttr.writeWarn("END DB Groovy");
return returnMap;
}
 
Hi Antonio,

My first thought is to verify the database connection is setup in the environment where you are trying to run the connector. When you look in the connector, in the environment you are trying to run the orchestration, do you see connection in the database dropdown?

Kevin
 
When I'm having trouble in Groovy, I start putting in tracing statements after every line of code so that I can figure out exactly which line of code is causing the error. Are you seeing the "START DB Groovy" in the log? Are you seeing either of the other two writeWarn's in the log? If not, add more writeWarn's to track down which line is erring.

I noticed in your comment for the SQL statement you say crpdta.F0011W but when you build the actual string you use schemaDB.F0011W. Which is correct? If you copy paste that exact SQL statement and execute it manually, does it work?
 
Back
Top