09-03-2021 06:45 AM
Hi,
I have a Java Jar file which has a method inside a class that returns a string value, and I also have a log4j logger inside the method.
I placed these 2 jars mycustom.jar and log4j.jar in node path.
In script snap (python) I mentioned the path of the jar and importing the class and able to call the method and get the output string successfully.
The problem is mycustom.jar is not able to create a log file in the path that I mentioned in the log4j.properties file and append logs to it.
Does anybody have idea on this or suggest the cause of the issue?
How to import custom class?
https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1439321/Script
Thanks,
Kiran
09-05-2021 10:42 PM
@kpatnala You can try below step in python scripts-
At Import/Declartion
sys.path.append(‘/opt/snaplogic/run/lib/custom.jar’)
from com.test.mypack import MyClassName
Inside try -
myClass=new MyClassName()
myClass.myFuc()