https://bugs.documentfoundation.org/show_bug.cgi?id=163404

--- Comment #2 from [email protected] ---
Ok I pushed the my changes: https://gerrit.libreoffice.org/c/core/+/174877

I alsoe added comments to the method as follows:

com.sun.star.deployment.thePackageManagerFactory is deprecated.

This method works fine when called after LibreOffice is started;
however, it fails when called during the startup of LibreOffice.

Both ExtensionManager and thePackageManagerFactory have the same issue in this
case.

The error message is:
null process service factory at
./comphelper/source/processfactory/processfactory.cxx:79
args: (null process service factory at
./comphelper/source/processfactory/processfactory.cxx:79,)
typeName: 'com.sun.star.uno.DeploymentException'
value: null process service factory at
./comphelper/source/processfactory/processfactory.cxx:79

see also: https://bugs.documentfoundation.org/show_bug.cgi?id=163404
This was discover when I was working on "ooo-development-tools" (OooDev).
OooDev can also start LibreOffice via the command line and run a script.
If this script calls PythonScriptProvider(ctx, "share:uno_packages") it will
get the error above.
The workaround for OooDev is here:
https://github.com/Amourspirit/python_ooo_dev_tools/blob/main/ooodev/uno_helper/py_script/python_script.py
Notably the big difference is that OooDev used it ctx that was created during
the startup of LibreOffice.
Example usage is can be seen here:
https://github.com/Amourspirit/python_ooo_dev_tools/blob/main/ooodev/uno_helper/importer/importer_shared_script.py

Summary:
  This method works fine when called after LibreOffice is started.
  thePackageManagerFactory is deprecated.
  ExtensionManager works as expected and is the only really change in this
method.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to