Run locally success but Run failed on cloud about calling python API from Java action

0
Hi experts, 3 weeks ago I asked the question: “Is it possible to call Python API function in Mendix Studio Pro”, now it is solved. I can run locally successful, with the search function I will get patent info from the server in patent company with Python API, and show the info in Mendix GUI normally, thanks to everybody for the help ! But if I run on cloud, the search function will be no useful, get nothing but show no error info. The search function is to call a microflow which calling java action, in the java I call the Python API which Patent company supplied,  get patent info and show it to the GUI with java code, everything is normal if I run locally, but it fails if I run on cloud, in fact, I can not find anything of error log . Could you please help to check it, thanks a lot! Below is the java code to call python : String s1 = "python"; String s2 = System.getProperty("user.dir") + "\\SmartSearchKeyWords.py"; String s3 = "Keywords"; String[] arguments = new String[] {s1, s2, s3}; Process process = Runtime.getRuntime().exec(arguments);  
asked
2 answers
0

Hi Zhaohong – the first thing I would check is the python environment on the server. Locally, you will have all the libraries installed that you need, you probably did this when you got the python API from the Patent company. My guess is that there are functions and libraries referenced in the SmartSearchKeyWords.py script that are simply not available?

I also note there is no activity on this thread for some time – but I do hope this helps you?

answered
0

You are using windows directory separator \. Mendix cloud runs linux. Use / instead or use File.Separator for Portability https://stackoverflow.com/questions/5971964/when-should-i-use-file-separator-and-when-file-pathseparator

answered