# Token Parsing Error when running rule

**URL:** <https://community.sailpoint.com/discuss/t/token-parsing-error-when-running-rule/34918>\
**Category:** Implement & Extend\
**Tags:** technology, event-triggers-workflows\
**Created:** [October 19, 2024, 10:50am UTC](https://community.sailpoint.com/discuss/t/token-parsing-error-when-running-rule/34918 "2024-10-19T10:50:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![neal\_meagher](https://sea3.discourse-cdn.com/sailpoint2/discuss/user_avatar/community.sailpoint.com/neal_meagher/32/17984_2.png) [@neal\_meagher](https://community.sailpoint.com/discuss/u/neal_meagher)\
**Post date:** [October 19, 2024, 10:50am UTC](https://community.sailpoint.com/discuss/t/token-parsing-error-when-running-rule/34918/1 "2024-10-19T10:50:49Z")

</div>

Getting this error when running rule. The encrypted password is fine Not spaces or&nbsp; characters I can see

Looking at the lines listed. Everything looks in order Also happens when I take out the encrypted passwd for the actual passwd

**An unexpected error occurred: java.lang.Exception: sailpoint.tools.GeneralException: BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: ``import java.io.IOException; import org.apache.log4j.Logger; import net.schmi . . . ‘’ Token Parsing Error: Lexical error at line 104, column 28. Encountered: "A" (65), after : "@" : at Line: 71 : in file: inline evaluation of: ``import java.io.IOException; import org.apache.log4j.Logger; import net.schmi . . . ‘’ : sshClient .authPassword ( SFTPUSER , context .decrypt ( SFTPPASS ) ) BSF info: Rule-Delimited-Application-Feed File tracking at line: 0 column: columnNo**

String SFTPHOST = “FTP Server IP Address”;  
int SFTPPORT = 22;  
String SFTPUSER = “user”;  
String SFTPPASS = “2:ACP:4VxP5Y7NRbLr0LNMvkU0abjBjDL2RGknodqCYz1Br/8=”;  
SSHClient sshClient = new SSHClient();

sshClient.addHostKeyVerifier(new PromiscuousVerifier());  
sshClient.setConnectTimeout(2000);  
sshClient.connect(SFTPHOST, SFTPPORT);  
sshClient.authPassword(SFTPUSER, context.decrypt(SFTPPASS));  
try {  
List totalFiles = new ArrayList();  
HashMap map = new HashMap();  
lastFeedDateDaysAgo = getDateNDaysAgo(8);

SFTPClient sftpClient = sshClient.newSFTPClient();  
log.debug(rulename + " sftpClient :: "+sftpClient);

/\*Getting disconnected application list  
\*/  
Custom custom = context.getObject(Custom.class,“Custom-Disconnected-Application”);  
List applicationList = custom.get(“Disconnected Application”);

/\*Adding disconnected application file path with respect to application in map  
\*/  
for (String appName : applicationList){  
List flatFile = new ArrayList();  
application = context.getObjectByName(Application.class,appName);  
if(application != null){  
identity = application.getOwner();  
[//log.debug](https://log.debug)(rulename + " identity :: "+identity);  
}  
if(identity!=null){  
owner = identity.getDisplayName();  
ownerEmail = identity.getEmail();  
[//log.debug](https://log.debug)(rulename + " ownerEmail :: "+ownerEmail);  
}

if(ownerEmail!=null [@And](https://community.sailpoint.com/user/41403) !ownerEmail.isEmpty()){

flatFile.add(application.getAttributeValue(“file”));  
flatFile.add(owner);  
flatFile.add(ownerEmail);  
map.put(appName,flatFile);  
log.debug(rulename + " flatFile :: "+flatFile);

}

}

---

<div class="post-metadata">

**Author:** ![alfi\_fulgencio](https://sea3.discourse-cdn.com/sailpoint2/discuss/user_avatar/community.sailpoint.com/alfi_fulgencio/32/17626_2.png) [@alfi\_fulgencio](https://community.sailpoint.com/discuss/u/alfi_fulgencio)\
**Post date:** [October 20, 2024, 12:18am UTC](https://community.sailpoint.com/discuss/t/token-parsing-error-when-running-rule/34918/2 "2024-10-20T00:18:04Z")

</div>

if(ownerEmail!=null[@And](https://community.sailpoint.com/user/41403) !ownerEmail.isEmpty())

should be

if(ownerEmail!=null && !ownerEmail.isEmpty())

---

<div class="post-metadata">

**Author:** ![BhuvaneshGeddam](https://avatars.discourse-cdn.com/v4/letter/b/eb8c5e/32.png) [@BhuvaneshGeddam](https://community.sailpoint.com/discuss/u/BhuvaneshGeddam)\
**Post date:** [October 20, 2024, 4:33pm UTC](https://community.sailpoint.com/discuss/t/token-parsing-error-when-running-rule/34918/3 "2024-10-20T16:33:05Z")

</div>

> [@And](#):
>
> Looking at the lines listed. Everything looks in order Also happens when I take out the encrypted passwd for the actual passwd
> 
> **An unexpected error occurred: java.lang.Exception: sailpoint.tools.GeneralException: BeanShell script error: bsh.EvalError: Sourced file: inline evaluation of: ``import java.io.IOException; import org.apache.log4j.Logger; import net.schmi . . . ‘’ Token Parsing Error: Lexical error at line 104, column 28. Encountered: "A" (65), after : "@" : at Line: 71 : in file: inline evaluation of: ``import java.io.IOException; import org.apache.log4j.Logger; import net.schmi . . . ‘’ : sshClient .authPassword ( SFTPUSER , context .decrypt ( SFTPPASS ) ) BSF info: Rule-Delimited-Application-Feed File tracking at line: 0 column: columnNo**
> 
> if(ownerEmail!=null !ownerEmail.isEmpty()){

This should be

> if(ownerEmail!=null @and !ownerEmail.isEmpty()){

Notice the case.

Or you can follow what alfi suggested

---

<div class="post-metadata">

**Author:** ![neal\_meagher](https://sea3.discourse-cdn.com/sailpoint2/discuss/user_avatar/community.sailpoint.com/neal_meagher/32/17984_2.png) [@neal\_meagher](https://community.sailpoint.com/discuss/u/neal_meagher)\
**Post date:** [October 21, 2024, 4:37pm UTC](https://community.sailpoint.com/discuss/t/token-parsing-error-when-running-rule/34918/4 "2024-10-21T16:37:06Z")

</div>

Oh. LMFAO! I didnt see the capital A for some reason. Many thanks guys!!
