Problem when running Python Macro in LO7.6.4.1

My system is as follows:

Distributor ID: Ubuntu
Description: Ubuntu 23.10
Release: 23.10
Codename: mantic
LibreOffice LibreOffice 7.6.4.1 60(Build:1)
geany geany 1.38 (built on 2021-10-14 with GTK 3.24.30, GLib 2.68.4)
Python Python 3.11.6

I recently updated to LO7.6.4.1 and now I am getting this message when I run certain python scripts.

Connector : couldn’t connect to socket (Connection refused) at /build/libreoffice/parts/libreoffice/build/io/source/connector/connector.cxx:118

The way to cure this under the last version of LO was by running this script.

soffice --accept="socket,host=localhost,port=2002;urp;

but that does not seem to work any more.

Now when I run it I get this error:

Warning: failed to launch javaldx - java may not function correctly

yodap@yodap-NUC11:~$ java -version
openjdk version “21.0.1” 2023-10-17
OpenJDK Runtime Environment (build 21.0.1+12-Ubuntu-223.10)
OpenJDK 64-Bit Server VM (build 21.0.1+12-Ubuntu-223.10, mixed mode, sharing)

What am I missing?

I solved the problem (ahm! I helped ChatGPT solve the problem :stuck_out_tongue_winking_eye:)…the script was set up to run outside of LO…and I was using it to run inside LO. The problem code was:

def pull_data():

# Connect to LibreOffice and get the current document.
local_context = uno.getComponentContext()
resolver = local_context.ServiceManager.createInstanceWithContext(
    "com.sun.star.bridge.UnoUrlResolver", local_context)

desktop = local_context.ServiceManager.createInstanceWithContext(
    "com.sun.star.frame.Desktop", local_context)
document = desktop.getCurrentComponent()

try:
    context = resolver.resolve(
        "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext")
except Exception as e:
    show_message("Error during resolving the connection:", str(e), document)
    return

kquote

and after a bit of tooing and froing I helped ChatGPT find the correct answer (ahm! :wink:)