OCR plugin not working in RPA Express 2.0 WF Studio

Getting following exception when trying to run a simple OCR plugin code in WF Studio 2.0:

13:16:00 [INFO] VarDefProcessorValidated starts processing...
13:16:00 [INFO]     OcrPlugin starts processing...
13:16:00 [ERROR] <ocr> plugin: fail: null
13:16:00 [ERROR] 
java.lang.NullPointerException
	at com.freedomoss.crowdcontrol.webharvest.plugin.ocr.OcrPlugin.setContext(OcrPlugin.java:127)
	at com.freedomoss.crowdcontrol.webharvest.plugin.ocr.OcrPlugin.executePlugin(OcrPlugin.java:101)
	at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125)
	at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
	at org.webharvest.runtime.processors.BodyProcessor.execute(BodyProcessor.java:27)
	at org.webharvest.runtime.processors.VarDefProcessor.execute(VarDefProcessor.java:59)
	at com.freedomoss.crowdcontrol.webharvest.processors.VarDefProcessorValidated.execute(VarDefProcessorValidated.java:28)
	at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
	at org.webharvest.runtime.Scraper.execute(Scraper.java:169)
	at org.webharvest.runtime.Scraper.execute(Scraper.java:182)
	at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:187)
	at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.processTaskInputs(SingleThreadWebHarvestProcess.java:77)
	at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.start(SingleThreadWebHarvestProcess.java:46)
	at com.workfusion.studio.launch.WebHarvestMainLauncher.launch(WebHarvestMainLauncher.java:102)
	at com.workfusion.studio.launch.WebHarvestMainLauncher.main(WebHarvestMainLauncher.java:174)

OCR settings are filled as below:

OCR Instance: http://localhost:15580/api
JWT Issuer: rpaexpress
JWT Secret: **********
Polling Interval (seconds): 15
Timeout (seconds): 1800

However, same code is working fine in Control Tower as BP but I’m looking to run this in WF Studio. Any help is appreciated.

Hi @oswaldo_razo, is the script executed on one of the remote desktops when you run it fron the Studio?
Could you also the full exception message?

Hi @ashapkina, this is the complete output from console:

12:27:10 [INFO] VarDefProcessorValidated starts processing…
12:27:10 [INFO] OcrPlugin starts processing…
12:27:10 [ERROR] plugin: fail: null
12:27:10 [ERROR]
java.lang.NullPointerException
at com.freedomoss.crowdcontrol.webharvest.plugin.ocr.OcrPlugin.setContext(OcrPlugin.java:127)
at com.freedomoss.crowdcontrol.webharvest.plugin.ocr.OcrPlugin.executePlugin(OcrPlugin.java:101)
at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125)
at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
at org.webharvest.runtime.processors.BodyProcessor.execute(BodyProcessor.java:27)
at org.webharvest.runtime.processors.VarDefProcessor.execute(VarDefProcessor.java:59)
at com.freedomoss.crowdcontrol.webharvest.processors.VarDefProcessorValidated.execute(VarDefProcessorValidated.java:28)
at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
at org.webharvest.runtime.Scraper.execute(Scraper.java:169)
at org.webharvest.runtime.Scraper.execute(Scraper.java:182)
at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:187)
at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.processTaskInputs(SingleThreadWebHarvestProcess.java:77)
at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.start(SingleThreadWebHarvestProcess.java:46)
at com.workfusion.studio.launch.WebHarvestMainLauncher.launch(WebHarvestMainLauncher.java:102)
at com.workfusion.studio.launch.WebHarvestMainLauncher.main(WebHarvestMainLauncher.java:174)
12:27:10 [INFO] -------------------------------------------
12:27:10 [INFO] EXECUTION FAILED
12:27:10 [INFO] Exception occurred (core_advanced_a4.xml:5)
12:27:10 [INFO] -------------------------------------------

I’m executing the following test script in my main desktop, not into any remote one:

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns="http://web-harvest.sourceforge.net/schema/1.0/config" scriptlang="groovy">
  <var-def name="ocr_scanned_img">
    <ocr correct-skew="true">
      <ocr-image>
        <http url="https://blog.magestore.com/wp-content/uploads/2018/02/Ideal-POS-receipt-configure.png" />
      </ocr-image>
    </ocr>
  </var-def>

  <script><![CDATA[
		println ocr_scanned_img.getWrappedObject().getClass().toString()
		println ocr_scanned_img.toString()
  ]]></script>

  <export include-original-data="false">
  </export>
</config>

@oswaldo_razo thanks for providing the code. Looks like there is a bug with this plugin in the Studio - we will investigate it.

1 Like

Hi @oswaldo_razo , one more question for the investigation: are you using version 2.0.0 or 2.0.1?

Hi @ashapkina, I’m using RPA Express 2.0.1 :wink:

Thank you.

Any updates about this error? I’m also can’t run bot task with OCR plugin in local machine, displayed same error

@valentyn_hodun we have fixed this issue. The fix will be included in the future release.

Your process should work if you run it from Control Tower.

@ashapkina
Thank you!
Also I install WF Studio 2.0.2 and OCR work correct

1 Like

WF Studio 2.0.3 and 9.0.0 OCR not working

15:29:57 [ERROR]
java.lang.NullPointerException
at com.freedomoss.crowdcontrol.webharvest.plugin.ocr.OcrPlugin.setContext(OcrPlugin.java:127)
at com.freedomoss.crowdcontrol.webharvest.plugin.ocr.OcrPlugin.executePlugin(OcrPlugin.java:101)
at org.webharvest.runtime.processors.WebHarvestPlugin.execute(WebHarvestPlugin.java:125)
at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
at org.webharvest.runtime.processors.BodyProcessor.execute(BodyProcessor.java:27)
at org.webharvest.runtime.processors.VarDefProcessor.execute(VarDefProcessor.java:59)
at com.freedomoss.crowdcontrol.webharvest.processors.VarDefProcessorValidated.execute(VarDefProcessorValidated.java:28)
at org.webharvest.runtime.processors.BaseProcessor.run(BaseProcessor.java:127)
at org.webharvest.runtime.Scraper.execute(Scraper.java:169)
at org.webharvest.runtime.Scraper.execute(Scraper.java:182)
at com.freedomoss.crowdcontrol.webharvest.executor.LocalWebharvestTaskExecutor.executeWebHarvestTask(LocalWebharvestTaskExecutor.java:187)
at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.processTaskInputs(SingleThreadWebHarvestProcess.java:77)
at com.workfusion.studio.launch.SingleThreadWebHarvestProcess.start(SingleThreadWebHarvestProcess.java:46)
at com.workfusion.studio.launch.WebHarvestMainLauncher.launch(WebHarvestMainLauncher.java:102)
at com.workfusion.studio.launch.WebHarvestMainLauncher.main(WebHarvestMainLauncher.java:174)

@s.halavach we haven’t released the version with the fix yet. Planning to release it by the end of August.

:tired_face:

The plugin works in Control Tower, so as a workaround try publishing the scripts that use OCR plugin and run them from from CT.

Hi @oswaldo_razo @valentyn_hodun @s.halavach

this bug has been fixed in release 2.1.0.

1 Like