About connection error

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

About connection error

Soohong Min
Hello,


I am testing my scipts which is written by python to operate Openoffice 3.2.1.4
After builing Openoffice 3.2.1.4, I cannot connect to Openoffice by
python codes.

>>> 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" )
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
__main__.NoConnectException: Connector : couldn't connect to socket (Success)


I can start Openoffice manually but cannot launch it by python script.

When I tried to run my other scripts, I got error as it runs
connection part (resolver.resolve).

Missing vcl resource.  This indicates that files vital to localization
are missing. You might have a corrupt installation.

How can I fix this problem?
Any help is appreciated.

Thanks,
Min

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: About connection error

Soohong Min
I add my question,
I can start OpenOffice like this command,
./soffice "-accept=socket,host=localhost,port=2002;urp;"

But I user this command in the python code,
ctx = resolver.resolve(
"uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext"
)

I got error.
__main__.NoConnectException: Connector : couldn't connect to socket (Success)

I wonder why I cannot connect to Office application by python code.
Thanks

On Fri, Sep 10, 2010 at 4:59 PM, Soohong Min <[hidden email]> wrote:
> Hello,
>
>
> I am testing my scipts which is written by python to operate Openoffice 3.2.1.4
> After builing Openoffice 3.2.1.4, I cannot connect to Openoffice by
> python codes.
>
>>>>
. 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" )
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> __main__.NoConnectException: Connector : couldn't connect to socket (Success)
>
>
> I can start Openoffice manually but cannot launch it by python script.
>
> When I tried to run my other scripts, I got error as it runs
> connection part (resolver.resolve).
>
> Missing vcl resource.  This indicates that files vital to localization
> are missing. You might have a corrupt installation.
>
> How can I fix this problem?
> Any help is appreciated.
>
> Thanks,
> Min
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]