How to solve this error org.apache.spark.sql.catalyst.errors.package$TreeNodeException
I was closing the sparkSession in finally block in the first processor/called class. I moved it out of the processor and placed inside the calling class which solved the issue.