Exception running rule: BeanShell script error: bsh.ParseException: Parse error at line 109, column 27. Encountered: , BSF info: KONE-RULE-PAM at line: 0 column: columnNo

Which IIQ version are you inquiring about?

Version 8.3

Share all details related to your problem, including any error messages you may have received.

 String resStr = EntityUtils.toString(httpResponse.getEntity());
        if (resStr != null) {
            JsonUtil parseJson = new JsonUtil();
            HashMap<String, String> objJson = (HashMap<String, String>) parseJson.parse(resStr);
            String accessToken = (String) objJson.get(API_RESPONSE_PARAM_TOKEN);
            if (accessToken != null) {
                encryptedAccessToken = context.encrypt(accessToken);
               // log.info("Bearer encryptedAccessToken :: " + encryptedAccessToken);
            } else {
               // log.error("Access token not found in response");
                throw new GeneralException("Access token not found in response");
            }
        } else {
          //  log.error("Empty response received from API");
            throw new GeneralException("Empty response received from API");
        }
    } catch (Exception e) {
      //  log.error("Exception while generating Bearer Token...!", e);
          taskResult.addException(e);
        
    }
    return encryptedAccessToken;
    } Exception running rule: BeanShell script error: bsh.ParseException: Parse error at line 109, column 27.  Encountered: , BSF info: KONE-RULE-PAM at line: 0 column: columnNo

Can you please Share your complete rule xml to check the exact line of error code

Hi Haseen,
Welcome to Sailpoint Developer Community.
If this is in beanshell you have to escape < characters or even better don’t use strict typing like in java as it’s not needed in beanshell. You can also serround your rule with <![CDATA[ RULE CONTENT ]]> to escape all not acceptable characters.

That’s my first thought - indeed it would be easier to debug the rule with complete rule here.

2 Likes

Sure i will follow that

Hi @haseenfarzana25,

Welcome to the Sailpoint Developer Community!

Try to change the catch block code by adding the + symbol instead of comma"," while printing with loggers.

Change:

catch (Exception e) {
// log.error(“Exception while generating Bearer Token…!”+ e);
taskResult.addException(e);
}

1 Like

Hi and Hello?

The error you’re encountering, bsh.ParseException: Parse error at line 109, column 27, suggests there’s a syntactical issue in your BeanShell script.

Incorrect Quote Characters
The code uses typographic quotes (“ and ”) instead of the standard ASCII quotes ("). Java and BeanShell scripts require standard quotes for string literals.

Exception Handling
Ensure that all exceptions are properly caught and that class casts are safely performed with checks or surrounded by try-catch blocks.

Regards,
Adam

4 Likes

I Will do that and i will run that one. Thank you @VinodC

1 Like

Hope the issue has resolved?

yes it is resolved now

Excellent! What’s the solution?

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