I tried following the pyUno tutorial on this page: http://udk.openoffice.org/python/python-bridge.html
It gives me this problem:
File "oo_helloworld.py", line 11, in ?
ctx = resolver.resolve( "uno:socket, host = localhost, port= 2002; urp; StarOffice.ComponentContext" )
__main__.com.sun.star.connection.NoConnectException: Connector: couldn't connect to socket (WSAECONNREFUSED, Connection Refused)
I pretty much copy-pasted the code from the web site above, so it should work. What might I be doing wrong?
- JM
[Solved] NoConnectException
[Solved] NoConnectException
Last edited by Hagar Delest on Mon Jul 23, 2012 8:28 am, edited 1 time in total.
Reason: tagged [Solved].
Reason: tagged [Solved].
-
QuazzieEvil
- Volunteer
- Posts: 283
- Joined: Tue Dec 04, 2007 6:38 pm
- Location: Houston, TX
Re: NoConnectException
did you start openoffice and set it to accept connections on that port?
something like: c:\Program Files\OpenOffice1.1\program> soffice "-accept=socket,host=localhost,port=2002;urp;" for windows
the command is the same for linux, but you have to find the directory for 'soffice'
if you have not done this, this may be the problem.
something like: c:\Program Files\OpenOffice1.1\program> soffice "-accept=socket,host=localhost,port=2002;urp;" for windows
the command is the same for linux, but you have to find the directory for 'soffice'
if you have not done this, this may be the problem.
Re: NoConnectException
We eventually got it to work. Restarting the computer and installing the most recent version 2.3 seem to have done the trick. Also... you have to open Writer yourself.
Danny's Python modules are good : http://www.oooforum.org/forum/viewtopic.phtml?t=14409 and here is an example using that module. http://www.oooforum.org/forum/viewtopic ... 6037#56037
Danny's Python modules are good : http://www.oooforum.org/forum/viewtopic.phtml?t=14409 and here is an example using that module. http://www.oooforum.org/forum/viewtopic ... 6037#56037
- in Danny's version you listen to port 8100,
you have to open run Python in OpenOffice\Program,
you have to use OpenOffice's version of Python with .\Python
if you import Danny's module you have to put "Danny.Ooo.OOoLib" in front of all the methods
Be sure to change the outpul file name in Danny's example to a folder that actually exists on your computer.
etc
Re: NoConnectException
seems 3.0 has something similar ...
at the top of the script type
import socket
which will lead you to the second problem which is
AttributeError: getCurrentComponent
look to see
http://www.nabble.com/Workarounds-for-p ... #a20006733
at the top of the script type
import socket
which will lead you to the second problem which is
AttributeError: getCurrentComponent
look to see
http://www.nabble.com/Workarounds-for-p ... #a20006733
OOo 3.0.X on Ms Windows XP
Re: NoConnectException
yeah, looks like the same problemsetori88 wrote:seems 3.0 has something similar ...