CSVReader is giving error in Control Tower

I’ve created a script and it works fine in the WFS. When I copied the same script to Control Tower BP it is giving the errors.
Error in Control Tower:

Step name ‘Excel Data’ has failed. Reason: '[urn:uuid:9514CEE79807DCBDA9155310276547921] robotics-flow executePlugin exception: [nodeId=http://127.0.0.1:15410] org.webharvest.exception.ScriptException: Config line 26: script block org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script5_genScript_17.groovy: 39: unable to resolve class CSVReader @ line 39, column 15.
CSVReader csvReader = new CSVReader(new FileReader(FileName.toString()));

Please help me to fix this.

I get the same issue in Control Tower. I recently updated to RPA Express 2.2.

Error logs:

org.webharvest.exception.PluginException: [urn:uuid:9514CEE79807DCBDA9155311266660436] robotics-flow executePlugin exception: [nodeId=http://127.0.0.1:15410] org.webharvest.exception.ScriptException: 
Config line 25: script block
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script6_genScript_35.groovy: 38: unable to resolve class CSVReader 
 @ line 38, column 15.
   				CSVReader csvReader = new CSVReader(new FileReader(FileName.toString()));
Script6_genScript_35.groovy: 38: unable to resolve class CSVReader 
 @ line 38, column 27.
   				CSVReader csvReader = new CSVReader(new FileReader(FileName.toString()));
Script6_genScript_35.groovy: 65: unable to resolve class CSVReader 
 @ line 65, column 16.
   					CSVReader reader = new CSVReader(new FileReader(FileName.toString()));
Script6_genScript_35.groovy: 65: unable to resolve class CSVReader 
 @ line 65, column 25.
  					CSVReader reader = new CSVReader(new FileReader(FileName.toString()));
Script6_genScript_35.groovy: 69: unable to resolve class CSVWriter 
 @ line 69, column 16.
   					CSVWriter writer = new CSVWriter(new FileWriter(FileName.toString()));
Script6_genScript_35.groovy: 69: unable to resolve class CSVWriter 
 @ line 69, column 25.
   					CSVWriter writer = new CSVWriter(new FileWriter(FileName.toString()));

Is there any way that I can read the csv file which is input to my business process and the data is changed everytime the bot runs?

Hello @bhanubachu.
Can you please share your custom script?

@Lera, attaching my scriptAutomation_Script.xml (31.4 KB)

I’m able to run this with no errors in WF Studio but it is giving the compilation errors (posted in my earlier messages) when I run from Control Room.

What are the alternate ways to read the csv input file (dynamic) and write some data into it?

Thanks. Sorry, forgot to ask for RPA Express version. You can check it in Control Panel - Programs and Features.

Workfusion RPA Express version 2.2.2.1080

Is this failing because of opencsv.jar could not found by Control Tower? I copied com.opencsv.jar at C:\RPAExpress\Workfusion\tomcat\webapps\workfusion\WEB-INF\lib.
opencsv-2.0.jar is already available in the above path. Is there any other locations I need to copy opencsv.jar file?

Is this opencsv.jar custom jar?

Opencsv is a CSV parser library for Java. This is an opensource library.
I’ve noticed opencsv-2.0.jar which is similar to the above is available in the Workfusion installation folder “C:\RPAExpress\Workfusion\tomcat\webapps\workfusion\WEB-INF\lib”

Thank you.
Yes, this is the same jar that you tried to use and you don’t need to add your jar to the folder. Could you please try to write fully qualified class path instead of “import com.opencsv.*” and let me know what will happen?

do you mean import “C:\RPAExpress\Applications\Java\lib\com.opencsv.jar”? gives the compilation errors.

Hi @bhanubachu.
No, I mean to write full path for specific classes that you’re using from this package like import com.opencsv.CSVReader (not sure which is full path for this package, this is just an example).

Hello @bhanubachu.
Did this solution help you?