Caused by: org.apache.bsf.BSFException: BeanShell script error: bsh.ParseException: Parse error at line 28, column 52. Encountered:

Which IIQ version are you inquiring about?

8.4

Please share any images or screenshots, if relevant.

[Please

insert images here, otherwise delete this section]

Please share any other relevant files that may be required (for example, logs).

Caused by: org.apache.bsf.BSFException: BeanShell script error: bsh.ParseException: Parse error at line 28, column 52. Encountered: ;
at bsh.util.BeanShellBSFEngine.eval(BeanShellBSFEngine.java:202) ~[bsh-2.1.8.jar:2.1.8 2018-10-02 08:36:04]
at org.apache.bsf.BSFManager$5.run(BSFManager.java:445) ~[bsf.jar:?]
… 24 more
sailpoint.tools.GeneralException: BeanShell script error: bsh.ParseException: Parse error at line 28, column 52. Encountered: ; BSF info: Philips Delete Email Values at line: 0 column: columnNo
2025-08-14T10:51:40,258 ERROR main sailpoint.tools.Console:594 - BeanShell script error: bsh.ParseException: Parse error at line 28, column 52. Encountered: ; BSF info: Philips Delete Email Values at line: 0 column: columnNo
sailpoint.tools.GeneralException: BeanShell script error: bsh.ParseException: Parse error at line 28, column 52. Encountered: ; BSF info: Philips Delete Email Values at line: 0 column: columnNo
at sailpoint.server.BSFRuleRunner.runRule(BSFRuleRunner.java:221) ~[identityiq.jar:8.4p1 Build e243e6f4783-20240325-035201]
at sailpoint.server.InternalContext.runRule(InternalContext.java:1322) ~[identityiq.jar:8.4p1 Build e243e6f4783-20240325-035201]
at sailpoint.server.InternalContext.runRule(InternalContext.java:1294) ~[identityiq.jar:8.4p1 Build e243e6f4783-20240325-035201]
at sailpoint.server.SailPointConsole.cmdRule(SailPointConsole.java:3827) ~[identityiq.jar:8.4p1 Build e243e6f4783-20240325-035201]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

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

Caused by: org.apache.bsf.BSFException: BeanShell script error: bsh.ParseException: Parse error at line 28, column 52. Encountered: ;

The highlighted error suggests that line 28 ends with + e; — that’s likely the issue.Always use e.getMessage() or e.toString() for better output when logging or printing exceptions.

I’m not positive here, but your for loop seems to be malformed. I think you really want it to be:

for (int i = 0; i < identityNames.size(); i++) {

The ⁢ is not valid.

The for loop is malformed as pointed out by @LarryG . There are also problems with the approach.

  1. Identities must be locked before being modified.
  2. There may also be metadata associated with the identity attributes (such as email). Modifying the Identity attributes directly is probably not the right way to do things if this is a production environment.
  3. reader.close() should be in a finally clause like:
    try {
    ...
    } finally {
    if (null != reader) {
    reader.close();
    }
    }
  4. Instead of using for (int i = 0; i @lt identityNames.size(); i++) use for (String identityName : identityNames).
  5. The code should call context.commitTransaction() at some point, to persist the Identity changes.

You can put this logic in any one of the IDE , Create a method there . Replace &amp etc . Put the CDATA while creating rule . It will automatically parse with correct format .

Yes, <![CDATA[ can be used, however, then the &lt; would need to be changed to < just to be clear.

Hi @LarryG , Yes . Just write the logic as you write in Java . It will automatically parse .

Yes, @harsh_gupta4 but since the entire time we have been discussing their code, I wanted to make sure they understood that it would not be a direct paste of the current code that we had been discussing. Not everyone immediately picks up on those subtle differences and I didn’t want them to be frustrated if they added in <![CDATA[ and it suddenly broke in a new way.

Hi @LarryG , I got your point and it dont make any changes in your core Logic . Its just the way of parsing the expression . Just to avoid this kind of parse error which takes unnecessary time for debugging etc . Also this is the recommended way from SailPoint as well.

@LarryG @harsh_gupta4,

Just for completeness, you can also use @lt with or without the CDATA tags in BeanShell instead of using < or &lt;.

2 Likes

**Sudheer Pathuri -**While fixing the issue, I also took time to understand the code. I haven’t seen anyone take this kind of approach to safeguard identities. What is the main objective behind your code?