UNO error: Binary URP bridge disposed during call

Viewed 1849

I am trying to test Python UNO api with LibreOffice and It is producing a strange error.

Traceback (most recent call last):
  File "<stdin>", line 16, in <module>
__main__.RuntimeException: Binary URP bridge disposed during call

shell returned 1

Below is my Code:

import socket
import uno
localContext = uno.getComponentContext()
resolver = localContext.ServiceManager.createInstanceWithContext(
                                   "com.sun.star.bridge.UnoUrlResolver", localContext )
ctx = resolver.resolve( "uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext" )
smgr = ctx.ServiceManager
desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop",ctx) //this line is generating error
model = desktop.getCurrentComponent()
text = model.Text
cursor = text.createTextCursor()
text.insertString( cursor, "Hello World", 0 )
ctx.ServiceManager                        

As I mentioned in code, this line is generating error smgr.createInstanceWithContext("com.sun.star.frame.Desktop",ctx)

I am trying to build it upon ARCH LINUX with KDE environment using python3.

0 Answers
Related