Python script running locally in Capella, but not in client server

  1. I tried exporting excel reports from capella, using Python4Capella. While running the code, the code is running continuously and when terminating the code it is showing an error.
    When I’m trying in my local pc the excel sheet is successfully generated, but when accessing through the Cloudflare remote desktop(Client server) it shows the below error code:

py4j.Py4JException: Error while sending a command.
at py4j.CallbackClient.sendCommand(CallbackClient.java:397)
at py4j.CallbackClient.sendCommand(CallbackClient.java:356)
at py4j.reflection.PythonProxyHandler.invoke(PythonProxyHandler.java:106)
at jdk.proxy11/jdk.proxy11.$Proxy24.executeScript(Unknown Source)
at org.eclipse.ease.lang.python.py4j.internal.Py4jScriptEngine.internalExecute(Py4jScriptEngine.java:240)
at org.eclipse.ease.lang.python.py4j.internal.Py4jScriptEngine.execute(Py4jScriptEngine.java:227)
at org.eclipse.ease.AbstractScriptEngine.inject(AbstractScriptEngine.java:189)
at org.eclipse.ease.AbstractScriptEngine.run(AbstractScriptEngine.java:242)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: py4j.Py4JNetworkException: Error while sending a command: c
p0
executeScript
s’‘’\nThis script allows to extract the list of Functional Exchanges defined between 2 components (LogicalComponents in this case)\n\nIt will create a folder result in the selected Capella project with the resulting xlsx file.\n’‘’\n# To run it:\n# - enable Developer capabilities if not already done (see documentation in the help menu)\n# - you can run this script by launching the contextual menu “Run As / EASE Script…” \n# on this script. \n# - By default, the model selected is IFE sample (aird path of the model written below)\n\n# - you can also run this script according to a configuration (script selected, arguments) \n# and modify the configuration by launching the contextual menu “Run As / Run configurations…” \n# on this script. \n# - create a new “EASE Script” configuration\n# - define the name of the configuration: “Export_list_of_functional_exchanges_to_xlsx.py” (for instance)\n# - define the Script Source path: “workspace://Python4Capella/sample_scripts/Export_list_of_functional_exchanges_to_xlsx.py”\n#\n\n# include needed for the Capella modeller API\ninclude(‘workspace://Python4Capella/simplified_api/capella.py’)\nif False:\n from simplified_api.capella import *\n \n# include needed for utilities\ninclude(‘workspace://Python4Capella/utilities/CapellaPlatform.py’)\nif False:\n from utilities.CapellaPlatform import *\n \n# include needed to read/write xlsx files\nfrom openpyxl import *\n\n# change this path to execute the script on your model (here is the IFE sample). \n# comment it if you want to use the “Run configuration” instead\naird_path = ‘/IFE_samplemodel.zip_expanded/In-Flight Entertainment System/In-Flight Entertainment System.aird’\n\n’‘’\n#Here is the “Run Configuration” part to uncomment if you want to use this functionality :\n\n#check parameter numbers\nif len(argv) != 1:\n # use IFE default values\n aird_path = “/In-Flight Entertainment System/In-Flight Entertainment System.aird”\nelse:\n # Load the Capella model from the first argument of the script\n aird_path = argv[0]\n’‘’\n\n\nmodel = CapellaModel()\nmodel.open(aird_path)\n\n# gets the SystemEngineering and print its name\nse = model.get_system_engineering()\nprint('starting export of model ’ + se.get_name())\n\n# preparing excel file export\nproject_name = aird_path[0:(aird_path.index(“/”, 1) + 1)]\nproject = CapellaPlatform.getProject(project_name)\nfolder = CapellaPlatform.getFolder(project, ‘results’)\nxlsx_file_name = CapellaPlatform.getAbsolutePath(folder) + ‘/’ + ‘Export_list_of_functional_exchanges_to_xlsx.xlsx’\n# create a workbook\nworkbook = Workbook()\n\n# writing excel file header\nworksheet = workbook.active\nworksheet.title = ‘Interfaces export’\nworksheet[“A1”] = ‘LC 1’\nworksheet[“B1”] = ‘LC 2’\nworksheet[“C1”] = ‘FE name’\n\ni=2\n\n# retrieving elements from the model\nall_LC = se.get_all_contents_by_type(LogicalComponent)\nall_FE = se.get_all_contents_by_type(FunctionalExchange)\n\nfor LC1 in all_LC:\n for LC2 in all_LC:\n #: :type LC1: LogicalComponent\n #: :type LC2: LogicalComponent\n worksheet[“A” + str(i)] = LC1.get_name()\n worksheet[“B” + str(i)] = LC2.get_name()\n list_FE = \n for fe in all_FE:\n #: :type LC1: FunctionalExchange\n if (fe.get_source_function() is not None and fe.get_source_function().get_allocating_component() == LC1):\n if (fe.get_target_function() is not None and fe.get_target_function().get_allocating_component() == LC2):\n list_FE.append(fe.get_name())\n worksheet[“C” + str(i)] = ', '.join(list_FE)\n i = i +1\n \n# Save the xlsx file\nworkbook.save(xlsx_file_name)\n\nprint(‘saving excel file’)\n\n# refresh \nCapellaPlatform.refresh(folder)\n
sworkspace://Python4Capella/sample_scripts/Export_list_of_functional_exchanges_to_xlsx .py
e

at py4j.ClientServerConnection.sendCommand(ClientServerConnection.java:253)
at py4j.CallbackClient.sendCommand(CallbackClient.java:384)
... 8 more

Caused by: java.net.SocketException: Connection reset
at java.base/sun.nio.ch.NioSocketImpl.implRead(NioSocketImpl.java:323)
at java.base/sun.nio.ch.NioSocketImpl.read(NioSocketImpl.java:350)
at java.base/sun.nio.ch.NioSocketImpl$1.read(NioSocketImpl.java:803)
at java.base/java.net.Socket$SocketInputStream.read(Socket.java:966)
at java.base/sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:270)
at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:313)
at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:188)
at java.base/java.io.InputStreamReader.read(InputStreamReader.java:177)
at java.base/java.io.BufferedReader.fill(BufferedReader.java:162)
at java.base/java.io.BufferedReader.readLine(BufferedReader.java:329)
at java.base/java.io.BufferedReader.readLine(BufferedReader.java:396)
at py4j.ClientServerConnection.readBlockingResponse(ClientServerConnection.java:313)
at py4j.ClientServerConnection.sendCommand(ClientServerConnection.java:229)
… 9 more
c

Can somebody kindly help with this issue.