ToUpperCase error in JDBC connector

Hello,

I am currently facing a new issue for a provisioning rule that seems to be failing only in production, while it worked within development.

[“sailpoint.tools.GeneralException: BeanShell script error: Sourced file: inline evaluation of: import sailpoint.object.ProvisioningPlan.AccountRequest; import sailpoi . . . \ : Error in method invocation: Method toUpperCase() not found in class\u0027java.util.ArrayList : at Line: 19 : in file: inline evaluation of: `` import sailpoint.object.ProvisioningPlan.AccountRequest; import sailpoi . . . : .toUpperCase ( ) \n BSF info: iSeries Before Provisioning at line: 0 column: columnNo”]

– I’m confused because I am not calling the toUpperCase() method in the java itself. There is a transform on one of the attributes that does an upper; but not sure how that would be reflected here. I’ve pasted the working code from dev that does not work as is in production.

    import java.sql.Types;
    import java.sql.CallableStatement;
    import java.sql.PreparedStatement;
    import java.sql.Date;
    import java.sql.Decimal;

    import sailpoint.object.ProvisioningPlan;
    import sailpoint.object.ProvisioningPlan.AccountRequest;
    import sailpoint.object.ProvisioningPlan.AttributeRequest;
    import sailpoint.object.ProvisioningResult;

    import sailpoint.tools.Util;

    // Get a string value from an attribute request object
    public String getAttributeRequestValue(AccountRequest acctReq, String attribute) {
      String val = null;
      if ( acctReq != null ) {
        AttributeRequest attrReq = acctReq.getAttributeRequest(attribute);
        if ( attrReq != null && attrReq.getValue() instanceof String ) {
          val = attrReq.getValue();
        }
      }
      log.debug(attribute + \" = \" + val);
      return val;
    }

    // Start of iSeries Provision rule
    log.debug(\"Enter iSeries JDBC Provisioning\");

    ProvisioningResult result = new ProvisioningResult();
    CallableStatement cStatement = null;
    String roleiSeries = \"ROLEALLUSERS\";
    String useriSeries = \"SERVICEUSER\";

    // Check if plan is null
    if ( plan instanceof ProvisioningPlan ) {
      // Get all account requests from plan
      List accounts = plan.getAccountRequests();
      // If the plan contains one or more account requests, we'll iterate through them
      if ((accounts != null) && (accounts.size() > 0)) {
        for (AccountRequest account : accounts) {
          String nativeId = (String) account.getNativeIdentity();
          log.debug(\"native identity: \" + nativeId);
          log.debug(\"application: \" + account.getApplicationName());
          log.debug(\"operation: \" + account.getOperation());

          try {
            // CREATE procedure
            if ( AccountRequest.Operation.Create == account.getOperation() ) {
              log.debug(\"Entering Create Operation\");

              cStatement = connection.prepareCall(\"CALL OBJECT.EX850SP (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\");

              // Add attributes from account create profile
              log.debug(\"setting value for index 1\");
              cStatement.setString(1, getAttributeRequestValue(account, \"CUSTS\")); //employment status code
              log.debug(\"setting value for index 2\");
              cStatement.setString(2, getAttributeRequestValue(account, \"CUETYP\")); //employee type code
              log.debug(\"setting value for index 3\");
              cStatement.setString(3, getAttributeRequestValue(account, \"CULOCN\")); //location code
              log.debug(\"setting value for index 4\");
              cStatement.setString(4, getAttributeRequestValue(account, \"CUEMAD\")); //work email
              log.debug(\"setting value for index 5\");
              cStatement.setString(5, getAttributeRequestValue(account, \"CUEMPL\")); //company code
              log.debug(\"setting value for index 6\");
              cStatement.setString(6, getAttributeRequestValue(account, \"CUFNAM\")); //legal first name
              log.debug(\"setting value for index 7\");
              cStatement.setString(7, getAttributeRequestValue(account, \"CULNAM\")); //last name
              log.debug(\"setting value for index 8\");
              cStatement.setString(8, getAttributeRequestValue(account, \"CUSPRV\")); //manager name
              log.debug(\"setting value for index 9\");
              cStatement.setString(9, nativeId); //search sam upper (CUNETU)
              log.debug(\"setting value for index 10\");
              cStatement.setString(10, getAttributeRequestValue(account, \"CUDPDS\")); //department description
              log.debug(\"setting value for index 11\");
              cStatement.setString(11, getAttributeRequestValue(account, \"CUJBDS\")); //job title
              log.debug(\"setting value for index 12\");
              cStatement.setString(12, getAttributeRequestValue(account, \"CULEAD\")); //employee management level
              log.debug(\"setting value for index 13\");
              cStatement.setString(13, getAttributeRequestValue(account, \"CUODCD\")); //org level 1 code
              log.debug(\"setting value for index 14\");
              cStatement.setString(14, getAttributeRequestValue(account, \"CUEXDT\")); //iSeries term date
              log.debug(\"setting value for index 15\");
              cStatement.setString(15, getAttributeRequestValue(account, \"CULUDT\")); //iSeries update date
              log.debug(\"setting value for index 16\");
              cStatement.setString(16, useriSeries); //service user dirxml
              log.debug(\"setting value for index 17\");
              cStatement.setString(17, (String) plan.getNativeIdentity()); //employee id
              log.debug(\"setting value for index 18\");
              cStatement.setString(18, roleiSeries); //role
              log.debug(\"EX850SP full statement: \" + cStatement.toString());

              cStatement.executeUpdate();

              // Successful Create, so mark result as COMMITTED
              log.debug(\"Create Account Execution successfully completed\");
              result.setStatus(ProvisioningResult.STATUS_COMMITTED);

              log.debug(\"Exiting Create Operation\");
            } else if ( AccountRequest.Operation.Modify == account.getOperation() ) {
              log.debug(\"Entering Modify Operation\");

              cStatement = connection.prepareCall(\"CALL OBJECT.EX850SP (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\");

              // Add attributes from account modify profile
              log.debug(\"setting value for index 1\");
              cStatement.setString(1, getAttributeRequestValue(account, \"CUSTS\")); //employment status code
              log.debug(\"setting value for index 2\");
              cStatement.setString(2, getAttributeRequestValue(account, \"CUETYP\")); //employee type code
              log.debug(\"setting value for index 3\");
              cStatement.setString(3, getAttributeRequestValue(account, \"CULOCN\")); //location code
              log.debug(\"setting value for index 4\");
              cStatement.setString(4, getAttributeRequestValue(account, \"CUEMAD\")); //work email
              log.debug(\"setting value for index 5\");
              cStatement.setString(5, getAttributeRequestValue(account, \"CUEMPL\")); //company code
              log.debug(\"setting value for index 6\");
              cStatement.setString(6, getAttributeRequestValue(account, \"CUFNAM\")); //legal first name
              log.debug(\"setting value for index 7\");
              cStatement.setString(7, getAttributeRequestValue(account, \"CULNAM\")); //last name
              log.debug(\"setting value for index 8\");
              cStatement.setString(8, getAttributeRequestValue(account, \"CUSPRV\")); //manager name
              log.debug(\"setting value for index 9\");
              cStatement.setString(9, getAttributeRequestValue(account, \"CUNETU\")); // search sam upper (CUNETU)
              log.debug(\"setting value for index 10\");
              cStatement.setString(10, getAttributeRequestValue(account, \"CUDPDS\")); //department description
              log.debug(\"setting value for index 11\");
              cStatement.setString(11, getAttributeRequestValue(account, \"CUJBDS\")); //job title
              log.debug(\"setting value for index 12\");
              cStatement.setString(12, getAttributeRequestValue(account, \"CULEAD\")); //employee management level
              log.debug(\"setting value for index 13\");
              cStatement.setString(13, getAttributeRequestValue(account, \"CUODCD\")); //org level 1 code
              log.debug(\"setting value for index 14\");
              cStatement.setString(14, getAttributeRequestValue(account, \"CUEXDT\")); //iSeries term date
              log.debug(\"setting value for index 15\");
              cStatement.setString(15, getAttributeRequestValue(account, \"CULUDT\")); //iSeries update date
              log.debug(\"setting value for index 16\");
              cStatement.setString(16, useriSeries); //service user
              log.debug(\"setting value for index 17\");
              cStatement.setString(17, (String) plan.getNativeIdentity()); //employee id
              log.debug(\"setting value for index 18\");
              cStatement.setString(18, getAttributeRequestValue(account, \"CUROLE\")); //iSeries role
              log.debug(\"EX850SP full statement: \" + cStatement.toString());

              cStatement.executeUpdate();

              // Successful Modify, so mark result as COMMITTED
              log.debug(\"Modify Account Execution successfully completed\");
              result.setStatus(ProvisioningResult.STATUS_COMMITTED);

              log.debug(\"Exiting Modify Operation\");
            }
          } catch(Exception e) {
            result.setStatus(ProvisioningResult.STATUS_FAILED);
            result.addError(e);
            log.debug(\"iSeries JDBC Provisioning SQL Error: \" + e.getMessage());
          } finally {
            if(cStatement != null) {
              cStatement.close();
            }
          }
        }
      }
    }

    log.debug(\"Exit iSeries JDBC Provisioning\");
    return result;

Hi Tim, in your log, what is the inmediately json object that comes before this error? can you copy its message?

What is your transform upper input ?

Are you this error came from your rules ?

Hi Ousmane,

This is the transform:

{
    "id": "2819b94d-c807-4f23-9cd7-494265f77a1b",
    "name": "iSeries CUDPDS SubstringUpper Transform",
    "type": "upper",
    "attributes": {
        "input": {
            "attributes": {
                "values": [
                    {
                        "type": "substring",
                        "attributes": {
                            "begin": 0,
                            "end": 28,
                            "input": {
                                "type": "identityAttribute",
                                "attributes": {
                                    "name": "department"
                                }
                            }
                        }
                    },
                    {
                        "type": "identityAttribute",
                        "attributes": {
                            "name": "department"
                        }
                    }
                ]
            },
            "type": "firstValid"
        }
    },
    "internal": false
}

I’m not sure where the error came, so just a hunch.

The weird thing is, with debug enabled, CREATE operations aren’t even being logged. However, MODIFY is working. I’m going to change the level from debug to trace for jdbc and see if that helps.

I had the same problem, log4j2.properties was in DEBUG mode, but log.debug did not print anything. Changing it to log.warn on code begun to print all messages to log.

Thanks, for this tip, I’ll give it a go. I saw some other threads about this same issue, so must be some kind of bug for having it forward the java based logging. The debug at the connector level wasn’t coming in.

We realized there was a pre-processing rule that was cloud based and not in our usual view that was causing the method error. As we don’t rely on this pre-processing rule, we simply removed it and all was well.

Thanks all for your guidance during my wild goose chase.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.