Sidebar
0 votes
17 views
ago by ron-s-6919 (4.6k points)

After upgrading QIE to the latest release, I have a script that stopped working.  Now it throws an exception:

TypeError: Cannot call property escapeCsv in object [JavaPackage org.apache.commons.lang.StringEscapeUtils]. It is not a function, it is "object". 

What caused this and how do I fix it?

1 Answer

+1 vote
 
Best answer

This is caused by libraries in QIE switching from the older Apache commons-lang packages to the new commons-lang3 packages. This was necessary to ensure that the Apache libraries are kept up-to-date with the latest versions that do not have vulnerabilities.

However, the fix to this error is simple, but does required the channel to be updated.  We can fix the script by replacing all instances of 'Packages.org.apache.commons.lang.' in the code with 'Packages.org.apache.commons.lang3.'.  For example, to fix this script

var csv = Packages.org.apache.commons.lang.StringEscapeUtils.escapeCsv('select * from patient');

we will replace it with this

var csv = Packages.org.apache.commons.lang3.StringEscapeUtils.escapeCsv('select * from patient');

Once the references to commons.lang are replaced with commons.lang3 you will be able to save the channel and restart it.  The process should start working as designed.

ago by ron-s-6919 (4.6k points)
selected ago by nathan-c-4426
...