Re: [udk-dev] [PyUNO] NumberingRules replace
Hi, The problem that I have recently encountered is one that is mentioned on your FAQ, namely Why can't I do a replace on the 'NumberingRules' object ?. The workaround that you mention on the page (uno.invoke() + uno.Any()) doesn't seem to work so I was wondering if there was a way to get the replacing on the NumberingRules working? I am using Python 2.5.2 and OpenOffice.org 2.4 but I have also tried it with OpenOffice.org 3.1 (and the bundled version of Python) with the same result (IllegalArgumentException). the code in the FAQ still works for me with OOo3.1 with the bundled python on windows. Did you try this code, or do you have problems with your self written code ? In the latter case, strip your problem down to some minimal lines of code and create an issue for it. Bye, Joerg - To unsubscribe, e-mail: dev-unsubscr...@udk.openoffice.org For additional commands, e-mail: dev-h...@udk.openoffice.org
Re: [udk-dev] Workarounds for pyuno problems in OOo3.0.0
Hi, [C:\] C:\Program Files\OpenOffice.org 3\program\swriter.exe -accept=socket,host=localhost,port=2002;urp [C:\] set URE_BOOTSTRAP=vnd.sun.star.pathname:C:\Program Files\OpenOffice.org 3\program\fun hmm, with my cmd shell, I need to quote the slashes like this set URE_BOOTSTRAP=vnd.sun.star.pathname:C:\\Program Files\\OpenOffice.org 3\\program\\fundamental.ini to get it to work. Bye, Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] Workarounds for pyuno problems in OOo3.0.0
Hi, there are now workarounds for all mentioned problems. I have documented this on http://udk.openoffice.org/python/python-bridge.html. @Stehpan: Thx a lot for your help. What would be the correct fix for http://www.openoffice.org/issues/show_bug.cgi?id=94993 ? Is the workaround the correct fix ? Or are there other solutions (I think, there are the same problems for other libraries, aren't they ) ? Bye, Joerg -- Joerg Budischewski wrote: Hi, There are some problems with pyuno in OOo3.0.0 (in particular with the python executable). Here the known problems and the workarounds for the moment. Bye, Joerg - 1)( unix only), you need to set LD_LIBRARY_PATH correctly before starting the python executable, eg. export set LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../openoffice.org/ure/lib:../../openoffice.org/basis3.0/program ./python 2) (windows only) The python scripting framework (scripts within openoffice via Extras/Macro/) does not work (at least for me). The cause is unknown and under investigation. 3) (windows only) When you try to connect to a running office process, you get __main__.com.sun.star.connection.NoConnectException: Connector couldn't connect to socket (WSANOTINITIALISED, WSAStartup() has not been called) You can workaround this, by placing a import socket at the top of your script. 4) (windows only) The python program crashes or you get an attribute error AttributeError: getCurrentComponent (or some other attribute) This is because the types could not be loaded due to changes in the uno bootstrapping mechanism. You can work around it for now by setting the variable set URE_BOOTSTRAP=fundamental.ini and running python from the path/to/office/OpenOffice.org 3/programdirectory. 5) (windows only) Interactive mode in python does not work correctly When you start the python executable without parameters, the interactive session runs somewhat fuzzy (at least on my machine). When you get the prompt , everything you type will be interpreted as a shell command. When you then just press return, you are prompted with your current working directory, here you can place a python command. Both input modes alternate. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[udk-dev] Workarounds for pyuno problems in OOo3.0.0
Hi, There are some problems with pyuno in OOo3.0.0 (in particular with the python executable). Here the known problems and the workarounds for the moment. Bye, Joerg - 1)( unix only), you need to set LD_LIBRARY_PATH correctly before starting the python executable, eg. export set LD_LIBRARY_PATH=$LD_LIBRARY_PATH:../../openoffice.org/ure/lib:../../openoffice.org/basis3.0/program ./python 2) (windows only) The python scripting framework (scripts within openoffice via Extras/Macro/) does not work (at least for me). The cause is unknown and under investigation. 3) (windows only) When you try to connect to a running office process, you get __main__.com.sun.star.connection.NoConnectException: Connector couldn't connect to socket (WSANOTINITIALISED, WSAStartup() has not been called) You can workaround this, by placing a import socket at the top of your script. 4) (windows only) The python program crashes or you get an attribute error AttributeError: getCurrentComponent (or some other attribute) This is because the types could not be loaded due to changes in the uno bootstrapping mechanism. You can work around it for now by setting the variable set URE_BOOTSTRAP=fundamental.ini and running python from the path/to/office/OpenOffice.org 3/programdirectory. 5) (windows only) Interactive mode in python does not work correctly When you start the python executable without parameters, the interactive session runs somewhat fuzzy (at least on my machine). When you get the prompt , everything you type will be interpreted as a shell command. When you then just press return, you are prompted with your current working directory, here you can place a python command. Both input modes alternate. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] pythonpath functionnality
Hi, the sample file is now available (use Save target as ... in your browser). I hope this helps, otherwise place your question with more details ... Bye, Joerg gerard wrote: Hi, The link http://udk.openoffice.org/python/python-bridge.html#calc-addin leads to an error or the save the target address download an oxt file that is not a zipped file so I can't fully understand how the pythonpath works. Shall I define a createInstance function in every componant where I want to use a method of another componant that must be in the pythonpath.zip file or pythonpath directory ? Thanks for answers. -- Gérard - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[udk-dev] New pyuno features in OOo-2.4.0
Hi, with OOo-2.4.0 and later (cws pyunofixes4), pyuno components and scripts within uno extensions can now add arbitrary files to PYTHONPATH. This now makes it possible to implement scripts/components within multiple source files and also allows usage of unohelper.Base with self defined idl types. See http://udk.openoffice.org/python/python-bridge.html#multiple_source_files for a little more explanation and a sample calc addin. Additionally, exceptions will now have better stacktraces (absolute path to python file now appears in stacktraces instead of ). Python components and scripts can now have both unix and windows linefeeds (formerly only unix linefeeds were allowed) Unfortunately, the changes introduced bug http://qa.openoffice.org/issues/show_bug.cgi?id=86251 which will hit you, when there are non-ascii characters in the path of your home directory and/or in the office installation path. A simple patch for this problem is attached to the issue. Bye, Joerg Fixed issues: i54513 unohelper.inspect() seems to report nonsense when a uno.Type is passed i54760 Incorrect line in pythonloader.py i56236 Python macros does not work on Linux (gentoo) when PYTHONPATH is set. i57589 installation of python component in windows format i63482 PyUNO components block at 2nd time i76281 Add import functionality to python components i77780 Python unohelper.py - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] Spellcheck service and Python
Hi, the crash is a bug in the pyuno bridge, see (http://qa.openoffice.org/issues/show_bug.cgi?id=82156). Anyway, you code is still errornous, you have to replacce locale = uno.getClass(com.sun.star.lang.Locale) with locale = uno.getClass(com.sun.star.lang.Locale)() . And even nicer, you should write import uno from com.sun.star.lang import Locale def main(): currentContext = XSCRIPTCONTEXT.getComponentContext() smgr = currentContext.ServiceManager spellchecker = \ smgr.createInstanceWithContext(com.sun.star.linguistic2.SpellChecker,\ currentContext) spellcheckResult = spellchecker.isValid( \ word, Locale(da,DK,),()) print spellcheckResult Bye, Joerg Finn Gruwier Larsen wrote: Thanks, Bernard, for correcting my syntax. I have tried different syntaxes, but now I at least know what the syntax *should* look like :-) Anyway - OOo crashes when I run this code: import uno def main(): currentContext = XSCRIPTCONTEXT.getComponentContext() smgr = currentContext.ServiceManager spellchecker = smgr.createInstanceWithContext(com.sun.star.linguistic2.SpellChecker, currentContext) locale = uno.getClass(com.sun.star.lang.Locale) locale.Language = da locale.Country = DK spellcheckResult = spellchecker.isValid(word, locale) Finn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] Spellcheck service and Python
Hi, please create an issue and assign it to me (jbu), attach your final minimal sample code. It is one of the very rare cases, where typedefs have been used in the ( here ::com::sun::star::beans::PropertyValues), maybe there is a workaround. There are no optional parameters in uno, you have to pass all parameters of a method signature eplicitly. Bye, Joerg Finn Gruwier Larsen wrote: Bernard Marcelly skrev: Message de Finn Gruwier Larsen date 2007-10-01 09:15 : Thanks, Bernard, for correcting my syntax. This was not syntax errors but misunderstanding of the API and of the Python bridge routines. For what you are doing you need a lot of knowledge in both. True. Anyway - OOo crashes when I run this code: ( ...) spellcheckResult = spellchecker.isValid(word, locale) When I run the equivalent code in Basic I get an exception, not a crash. The exception says the number of arguments is incorrect (Arguments len differ!). I have implemented this macro in Basic already, and it works perfectly. Just wanted to give Python a try... Read again in the SDK the IDL description of .isValid() method : there is a third argument. In the general case it is an empty array. This should work better: spellcheckResult = spellchecker.isValid(word, locale, ()) I know there are three arguments. In the Basic equivalent I wrote something likes this: Dim emptyArgs(0) As New com.sun.star.beans.PropertyValue result = speller.isValid(word, locale, emptyArgs()) But I didn't know how to do that in Python, so I just guessed that the third argument was optional (which would be reasonable, since it usually contains no information). I think we can conclude that the third argument is not optional - anyway, giving a wrong number of arguments should not make OOo crash. Using () as a third argument doesn't change this - OOo still crashes. My conclusion is that Python in OOo is still premature and unstable, so I'll probably have to stick with Basic for a while. Or maybe I'll give Java a try - at least, there's a lot of documentation there. Finn - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] RE:PyUNO and OpenOffice installaed with Ubuntu distro
Hi, you can build ooo with --system-python switch, but the result will only run on this system. Some distros do so. Main problems are - incompatible gcc versions - incompatible python switches (with or without --enable-shared or --with-ucs-4 ). So this is no option for the official OOo built, which is aimed to run on any system. Bye, Joerg Alexandro Colorado wrote: yes ubuntu did a merge of the system python with the openoffice.org python. I would like to know if we can ask the ubuntu guys how they did it and maybe be able to have a pyuno.so without having to compile the whole python. This would be great because it would give us additional toolkits like Tkenter and get around the VCL and still use UNO services and components. On Fri, 21 Sep 2007 17:58:18 +0200, Joachim Dahl [EMAIL PROTECTED] wrote: It uses the default python2.5 installed install in /usr/lib/python2.5 On 9/21/07, ashok _ [EMAIL PROTECTED] wrote: On 9/21/07, Joachim Dahl [EMAIL PROTECTED] wrote: I've used it on Ubuntu 7.04 and 7.10 for a spreadsheet plugin: http://abel.ee.ucla.edu/cvxopt/applications/openoffice-org-spreadsheet-plugin/ and it has always worked perfectly for me. -joachim Which system python were you using 2.4 or 2.5 ? I noticed that packaged OOo in Ubuntu is stripped of the python intrepeter.and uses the system python... - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] C++ - command line tool to convert VC project files to Makefile
Hi, this can have several reasons, difficult to diagnose from here. Please check your PYTHONPATH environment variable, pyuno.dll must be found within pythonpath. You should start a python process within the ms debugger to check whether the pyuno.dll is actually loaded (dll loading is somewhere logged). When pyuno.dll gets loaded, try to put a breakpoint in initpyuno() in pyuno/source/modules/pyuno_module.cxx. Bye, Joerg Liyuan(Internet) wrote: Hi Joerg, hi all, I have rebuilt and delivered the pyuno module. In the process there is no error. The pyuno.dll is updated. but pyuno still can't be imported to . Liyuan - Original Message - From: Joerg Budischewski [EMAIL PROTECTED] To: dev@udk.openoffice.org Sent: Saturday, December 02, 2006 4:19 PM Subject: Re: [udk-dev] C++ - command line tool to convert VC project files to Makefile Hi, try to rebuild and deliver the pyuno module before. The pyuno.dll is built there. Bye, Joerg Liyuan(Internet) wrote: Hi Joerg, hi all, Thanks for your replying! I have converted VC project files(.dsp) to Makefile for the Python-2.5 Source. I have rewrote the patch file (Python-2.5.patch), and compilied successfully. but when I run the testtools,errors appear as below: // [e:\ooo_src680_m172_src\testtools\source\bridgetest\pyuno]dmake runtest dmake: Executing shell macro: +echo %_cwd dmake: Executing shell macro: +echo %_4ver starttestwithdmakeruntest - dmake: Executing shell macro: echo import os;print os.getcwd() | $(PYTHON) cd ..\..\..\wntmsci10.pro\bin set FOO=file:///E:/ooo_SRC680_m172_src/test s/source/bridgetest/pyuno/../../../wntmsci10.pro/bin set TYPES=pyuno_regcomp.rdb set UNO_SERVICES=pyuno_regcomp.rdb python main Traceback (most recent call last): File main.py, line 35, in module import uno File e:\ooo_SRC680_m172_src\solver\680\wntmsci10.pro\bin\pyuno\uno.py, l 37, in module import pyuno ImportError: No module named pyuno dmake: Error code 129, while making 'runtest' '---*tg_merge.mk*---' // Any idea of how to get rid of the problem? Thanks Liyuan. Hi, indeed microsoft removed support for exporting makefiles in VC2003 and later. I have yet no good idea, how to do a python build now, I saw that support for vc6 is still there (which can generate makefiles), but I don't know, if everything works with it ... (and you would need to adapt them to the new compiler). Bye, Joerg Liyuan wrote: hi all Does anyone know of a Windows compatible command line tool that capable of parsing Microsoft's VC++ workspace/project (e.g., .dsw, .dsp, .sln, ..vcproj, etc.) files and generating an nmake-compatible Makefile. Thanks. Liyuan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] C++ - command line tool to convert VC project files to Makefile
Hi, try to rebuild and deliver the pyuno module before. The pyuno.dll is built there. Bye, Joerg Liyuan(Internet) wrote: Hi Joerg, hi all, Thanks for your replying! I have converted VC project files(.dsp) to Makefile for the Python-2.5 Source. I have rewrote the patch file (Python-2.5.patch), and compilied successfully. but when I run the testtools,errors appear as below: // [e:\ooo_src680_m172_src\testtools\source\bridgetest\pyuno]dmake runtest dmake: Executing shell macro: +echo %_cwd dmake: Executing shell macro: +echo %_4ver starttestwithdmakeruntest - dmake: Executing shell macro: echo import os;print os.getcwd() | $(PYTHON) cd ..\..\..\wntmsci10.pro\bin set FOO=file:///E:/ooo_SRC680_m172_src/test s/source/bridgetest/pyuno/../../../wntmsci10.pro/bin set TYPES=pyuno_regcomp.rdb set UNO_SERVICES=pyuno_regcomp.rdb python main Traceback (most recent call last): File main.py, line 35, in module import uno File e:\ooo_SRC680_m172_src\solver\680\wntmsci10.pro\bin\pyuno\uno.py, l 37, in module import pyuno ImportError: No module named pyuno dmake: Error code 129, while making 'runtest' '---*tg_merge.mk*---' // Any idea of how to get rid of the problem? Thanks Liyuan. Hi, indeed microsoft removed support for exporting makefiles in VC2003 and later. I have yet no good idea, how to do a python build now, I saw that support for vc6 is still there (which can generate makefiles), but I don't know, if everything works with it ... (and you would need to adapt them to the new compiler). Bye, Joerg Liyuan wrote: hi all Does anyone know of a Windows compatible command line tool that capable of parsing Microsoft's VC++ workspace/project (e.g., .dsw, .dsp, .sln, ..vcproj, etc.) files and generating an nmake-compatible Makefile. Thanks. Liyuan - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] Problems in running openoffice.org 2.0 with xvfb-run and oood
Hi, When I got you correctly, the processes die before any connect is tried ? Please try to start ooo on command line as oood would do, e.g. soffice -env:UserInstallation=file:///home/joergl/OpenOffice.org1.1.0_instance-0 -headless -norestore -invisible -accept=pipe,name=oood-instance-0;urp; and adapt the UserInstallation path. (or cut and paste it from ps -ef output as long as the soffice process lives ...) Set coredumpsize to unlimited and lets see, what happens. Bye, Joerg Marco Bizzarri wrote: I took a very quick look at your project, but I think it does not address my problem: my problem is not in the interaction with OOo running in server mode, at the moment, but in starting OOo in server mode. Just to be clear, if I start my environment, after a few seconds, here is what I get from ps axf: 7646 pts/3S+ 0:00 \_ /bin/sh /usr/local/bin/xvfb-run -e /tmp/error.log /usr/local/bin/python /usr/local/oood/o 7653 pts/3S+ 0:03 \_ Xvfb :99 -screen 0 640x480x8 -nolisten tcp 7655 pts/3Sl+0:00 \_ /usr/local/bin/python /usr/local/oood/oood.py -c /usr/local/oood/oood-config.xml run 7659 pts/3Z+ 0:00 \_ [soffice] defunct 7660 pts/3Z+ 0:00 \_ [soffice] defunct (I hope it will still be readable...) Regards Marco - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] pyUNO bridge status ?
Hi, yes, I am still there and will do bugfixes in general, currently there is one serious bug and a few minor bugs, which I am going to fix sometime in future ... However, I currently can't give you much hope for future extensions, e.g. - python 2.5 - uno components that can be implemented with multiple python files . Therefor it would be good to have someone else working on pyuno ... Bye, Joerg Laurent Godard wrote: Hi all What is the python bridge status ? Does someone still maintain it ? Joerg ? Do you think a call for help would be needed for keeping pyUNO usable on a long run ? Laurent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] JVM crash after connection to OpenOffice
Hi, your information was in such a way helpful, as my initial thought is not the problem. Try to get a corefile. E.g. start a bash shell, type ulimit -c unlimited and let your program run. After the crash, you should get a [core dumped] output and a file named core or similar with a current timestamp should be somewhere. Then start again the gdb and replace the pid with the filename of the core file and type where (info shared output is not needed anymore). Sadly, gdb often has problems with complex multithreaded programs but the core file analysis should work. Bye, Joerg Morten Omholt Alver wrote: Joerg, thank you for your answer! I'm afraid I'm not proficient with gdb, but maybe I can provide more data with some help. when you set the coredumpsize to unlimited in your shell, you should get a core dump. Attach with the gdb to it ( gdb /path/to/java-executable /path/to/core-file). I tried starting my application and then attaching gdb with the command gdb java PID, and got the following output: (gdb) where #0 0xa7f30c01 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib/tls/libpthread.so.0 #1 0xa7f3122f in [EMAIL PROTECTED] () from /lib/tls/libpthread.so.0 #2 0xa78dacee in os::Linux::safe_cond_wait () from /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/client/libjvm.so #3 0xa78c6e34 in Monitor::wait () from /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/client/libjvm.so #4 0xa7948a0d in Threads::destroy_vm () from /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/client/libjvm.so #5 0xa77f496e in jni_DestroyJavaVM () from /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/client/libjvm.so #6 0x0804960d in ?? () #7 0xa79c8e80 in jni_NativeInterface () from /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/client/libjvm.so #8 0x0805e840 in ?? () #9 0x0816f78a in ?? () #10 0x0805e830 in ?? () #11 0xafa2f854 in ?? () #12 0x0fff in ?? () #13 0x08059008 in ?? () #14 0x in ?? () (gdb) info shared FromTo Syms Read Shared Object Library 0xa7f2d310 0xa7f351d4 Yes /lib/tls/libpthread.so.0 0xa7f24c10 0xa7f25964 Yes /lib/tls/libdl.so.2 0xa7e06cb0 0xa7efcbdf Yes /lib/tls/libc.so.6 0xa7f52790 0xa7f632bf Yes /lib/ld-linux.so.2 0xa767a440 0xa798d000 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/client/libjvm.so 0xa762e360 0xa7649bc4 Yes /lib/tls/libm.so.6 0xa7f49250 0xa7f4ce10 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/native_threads/libhpi.so 0xa7603570 0xa7610644 Yes /lib/tls/libnsl.so.1 0xa7f3f110 0xa7f44274 Yes /lib/tls/libnss_compat.so.2 0xa75f7c40 0xa75fd7b4 Yes /lib/tls/libnss_nis.so.2 0xa75ecb80 0xa75f3514 Yes /lib/tls/libnss_files.so.2 0xa76190d0 0xa761fc90 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/libverify.so 0xa75d1190 0xa75e58e0 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/libjava.so 0xa75b8ca0 0xa75c38c0 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/libzip.so 0xa1843d40 0xa188d8c0 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/libawt.so 0xa1769b00 0xa1822c10 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/libmlib_image.so 0xa1741960 0xa1762da0 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/xawt/libmawt.so 0xa1716660 0xa1720174 Yes /usr/lib/libXext.so.6 0xa165f240 0xa16ccd44 Yes /usr/lib/libX11.so.6 0xa164ba00 0xa164c604 Yes /usr/lib/libXau.so.6 0xa1646f00 0xa1648ae4 Yes /usr/lib/libXdmcp.so.6 0xa15d6d10 0xa162e980 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/libfontmanager.so 0xa17346b0 0xa1735564 Yes /usr/lib/X11/locale/common/xlcDef.so.2 0xa172d2a0 0xa1732404 Yes /usr/lib/libXcursor.so.1 0xa17243e0 0xa1729a54 Yes /usr/lib/libXrender.so.1 0xa1537f30 0xa153a1b4 Yes /usr/lib/libXfixes.so.3 0xa1542060 0xa154eb10 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/libnet.so 0xa11897a0 0xa118c650 Yes /usr/lib/jvm/java-1.5.0-sun-1.5.0.08/jre/lib/i386/libnio.so 0xa116f190 0xa1183d14 Yes /usr/lib/X11/locale/common/ximcp.so.2 0xa1162480 0xa1162e54 Yes /usr/lib/gconv/ISO8859-1.so 0xa153c9a0 0xa153d1c4 Yes /usr/lib/openoffice/program/libjpipe.so 0xa0de0d20 0xa0e090c4 Yes /usr/lib/openoffice/program/libuno_sal.so.3 0xa0d2a800 0xa0da60f4 Yes /usr/lib/libstdc++.so.6 0xa11438a0 0xa114abf4 Yes /lib/libgcc_s.so.1 0xa113b3e0 0xa113f714 Yes /lib/libpam.so.0 0xa110c840 0xa110fa84 Yes /lib/tls/libcrypt.so.1 This is after I connect to OpenOffice, but before I shut the application down (and crash). Can I do something to get information after the crash? I just tried using the continue command in gdb, and my application shuts down with: (gdb) continue Continuing. [New Thread -1588892752 (LWP 5267)] Cannot get thread event message: debugger service failed Did the java and OpenOffice come with your
Re: [udk-dev] JVM crash after connection to OpenOffice
Hi, when you set the coredumpsize to unlimited in your shell, you should get a core dump. Attach with the gdb to it ( gdb /path/to/java-executable /path/to/core-file). Type 'where' in the gdb to get a native stacktrace and afterwards type 'info shared' to get the full list of shared libs in your process (the output from the java vm seesm to lack some libs). A callstack for all threads in the process might also be interesting in order to understand how far the shutdown process already is (has a native exit() already been called?). Did the java and OpenOffice come with your distribution ? Both (OOo and java) should have been compiled with the same gcc version, otherwise exception handling might fail (Probably the native implementation tries to throw a native c++ exception which leads to the crash). But this won't be an explanation for the crash on windows, so there still maybe a bug in ooo code, which hits you during shutdown. These are typically very difficult and timeconsuming to debug .. Bye, Joerg Morten Omholt Alver wrote: Hi, I am developing an interface to OpenOffice from the bibliography manager JabRef, to insert citations and format the bibliography in OpenOffice Writer, but I'm facing a tricky issue. I am connecting using the bootstrap method: XComponentContext xContext = com.sun.star.comp.helper.Bootstrap.bootstrap(); The connection works, and everything is stable and working perfectly until the point where I shut down JabRef. Then I get a JVM crash with a following error log file (copied at the bottom of this mail). OpenOffice seems unaffected, and I can restart JabRef and connect again without problems. The crash happens nearly every time, and the log file always shows similar information. It occurs both with Sun Java 1.5.0_08 and a 1.6.0 beta version on Linux, and with 1.5.0 on Windows. The crash does NOT occur if I shut down OpenOffice before shutting down JabRef. If I run my interfacing code without everything else JabRef does, the crash does not occur. Therefore it seems to be a conflict with some other part of the program. I've tried to disable various parts of the code without any success. For instance, I changed the shutdown procedure so only a simple System.exit(0) is called when the app window is closed. I realize that I'm not giving enough information about the JabRef code to be able to expect an answer (I don't know where to start), but I am hoping that someone is able to give me a hint based on the JVM crash log file (it does indicate at what point in the UNO code the crash originates). It may be relevant to mention that if I try to connect in the old way, by making OOo listen to a port, there is no JVM crash, but I get a normal Java exception on shutdown: java.lang.IllegalStateException: zip file closed at java.util.zip.ZipFile.ensureOpen(ZipFile.java:399) at java.util.zip.ZipFile.getEntry(ZipFile.java:144) at java.util.jar.JarFile.getEntry(JarFile.java:198) at java.util.jar.JarFile.getJarEntry(JarFile.java:185) at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:671) at sun.misc.URLClassPath.getResource(URLClassPath.java:160) at java.net.URLClassLoader$1.run(URLClassLoader.java:191) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at java.lang.ClassLoader.loadClass(ClassLoader.java:282) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.notifyListeners(java_remote_bridge.java) at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.dispose(java_remote_bridge.java) at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.access$12(java_remote_bridge.java) at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.invoke(java_remote_bridge.java) at com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.run(java_remote_bridge.java) Regards, Morten Alver Crash log follows: # # An unexpected error has been detected by HotSpot Virtual Machine: # # SIGSEGV (0xb) at pc=0xa15b4b81, pid=13607, tid=2706566064 # # Java VM: Java HotSpot(TM) Client VM (1.5.0_08-b03 mixed mode, sharing) # Problematic frame: # C 0xa15b4b81 # --- T H R E A D --- Current thread (0x08390cd0): JavaThread Thread-4 daemon [_thread_in_native, id=13668] siginfo:si_signo=11, si_errno=0, si_code=1, si_addr=0xa15b4b81 Registers: EAX=0xa15b4b81, EBX=0x7ce56400, ECX=0x08317400, EDX=0x7ce56f60 ESP=0xa152dd30, EBP=0xa152dd5c, ESI=0x7ce563f8, EDI=0x08390cd0 EIP=0xa15b4b81, CR2=0xa15b4b81, EFLAGS=0x00210217 Top of Stack: (sp=0xa152dd30) 0xa152dd30: a26ae4db
Re: [udk-dev] ooextract.py python script
Hi, what is your environment (which version, is it an official binary build or did you build on your system, do you use the system python or the python coming with the office)? Bye, Joerg Michele Petrazzo wrote: Hi list, I'm trying the ooextract.py script find on python-bridge page. It work well, but when an exception is raised (for example that say that OOo aren't listening), I receive a python error: michele:~$ python tmp/test_uno.py --pdf test.sxw Traceback (most recent call last): sys.stderr.write( Error (+repr(e.__class__)+) : + e.Message + \n ) UnicodeEncodeError: 'ascii' codec can't encode characters in position 83-106: ordinal not in range(128) michele:~$ Why this happen? OOo pass an illegal string to python? I solve this with: e.Message.encode('ascii', 'replace') and receive a more or less human-readable python exception: Error (class __main__.com.sun.star.connection.NoConnectException at 0x4028214c) :Q??)??P Is there a solution for make this exception readable? Thanks a lot, Michele - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] PyUNO development
Hi, Main reason for not supporting this attributes is actually my lack of knowledge of these python internas. Which attributes should be supported from your point of view ? IMO, every UNO object exported in Python should have every method and property explicitely exported and visible as attributes. That's what my current hack is doing in Python. Not sure if it worth doing this at C level. Maybe a solution like the one I have done would be sufficient (but need to be done cleanly. I am thinking to a quite elegant solution using metaclasses). it should be done at the C level, and I think, it shouldn't be too difficult once one knows, which properties to support to achieve this. I'll think a little depper about this. For now, what I have done is to declare every method (through the interface's definition decalred by the objet) and properties (idem) in a fake wrapper class. Similar things hold for structs and exception (see pyuno/source/module/pyuno_except.cxx). I have already run my eyes over the C++ code, but not very deeply. I'll try to investigate the issue you mention (47270) as soon as I have solved my issues with pythonscript.py . I already have a fix for this issue, just wanted to let you know ... Bye, Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] PyUNO development
Hi, now trying to answer some questions ... Note that on Linux, Tk works OK in OOo (as explained earlier, I do use the Idle Tkinter.Text colorization mecanism for editing my python scripts in OOo). For now, the Tk mainloop freeze the OOo window. I'll try to investigate on how can the 2 event loops cooperate. this support is by accident and depends on the libraries available on the machine the official OOo installation set is built on. This may break with any release. To correctly support it, the libs must be introduced into OOo built environment and shipped with OOo, this work has not been done yet. One more question: is it possible to compile the pyuno module with the SDK environment (and not from the OOo sources, as it is a pain to compile the whole OOo tree)? I guess it should be possible, since pyuno uses the C++ bridge which is available in the SDK. Am I right? the pyuno bridge only uses libraries which are part of the SDK. It should built and run with the SDK (but I don't know the current sdk's build env, so you may need to rewrite makefiles). Bye, Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] PyUNO development
Hi, - One thing that I find disappointing is the fact that the UNO introspection capabilities are not (as far as I understand, but again, I am very new in this code) very well reflected in the pyuno module (at least the python way). - Is there a technical reason (but the lack of dev time) why UNO types, classes, services and interfaces are not exported in Python as types and classes (rather than instances of an obscure class like it is the case for now)? the python proxy for UNO objects currently does not support the __members__, __dict__, etc. (see pyuno/source/module/pyuno.cxx PyUNO_getattr), this is the place, where improvement should take place. Note that the __members__ attribute currently is even buggy implemented, using it will lead to a crash (see http://qa.openoffice.org/issues/show_bug.cgi?id=47270). Main reason for not supporting this attributes is actually my lack of knowledge of these python internas. Which attributes should be supported from your point of view ? Similar things hold for structs and exception (see pyuno/source/module/pyuno_except.cxx). Bye, Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] State of OOo Multi Threading
Hi, hmm, getting a 404 when trying to access the document. Bye, Joerg Kay Ramme - Sun Germany - Hamburg wrote: Hi guys, some of you might be interested in OOo multi threading. We prepared a first document, mainly listing what we think the issues are. You can find it here: http://udk.openoffice.org/files/documents/23/3029/OOo_multi_threading__status_0_3.odt Agreeing on these issues is just the first step. So, please give feedback of things missing / being wrong etc. Thanks Kai and Kay P.S.: Follow up on dev@udk.openoffice.org - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] Re: [api-dev] crash and PyUNO
Hi, [...] Is that all right? yes. The reason for your crash can be anywhere (either somewhere in pyuno code or somewhere in the office code. Ideally, you try to make it reproducable and create an issue attaching your sample code to it. You should also try to get a native stacktrace (e.g. output of the crashguard), this will help to find out about the reason. Bye, joerg By the way, I've read about crash resulting from python exceptions, but you must understand that the components are run a couple of times and crash happens while doing routine things like editing or closing, some time after the action of any component. And during development, when my component rose exceptions, they seemed to be very well treated by Basic (the only user of my components so far). In a word: while they had (grosser) errors, the didn't crash OOo ;o) Cheers, Jorge. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] pyUNO addon
Hi, there is no clean way to do this currently. You can extend pythonpath by hand, have a look at pythonloader.uno.ini in program directory, but as u can't guess the addons place in filesystem, this is not much of a help. Components are currently not loaded into the global module table. Bye, Joerg Laurent Godard wrote: Hi all it seems tha(t it is not possible to put multiple .py files in an addon It fails on registering the addon because of dependancies not found (at import level) Is there any workaround ? an IZ entry Not putting all the stuff in on only file ? Where should i look in the sources to analyze this ? (won't have time util november though) Thanks in advance Laurent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[udk-dev] Re: [api-dev] Python equivalent to com.sun.star.comp.helper.Bootstrap.bootstrap()?
Hi, sorry to warm this topic up again ... While disagreeing to have such a bootstrap() function in cppuhelper (this function simply can't work in SDK without office, how should cppuhelper know, that it is running in an office environment), as it exists, it should be made usable in pyuno. Christian Junker provided a first patch for bootstrapping with this function in pyuno (Thank you !, see http://www.openoffice.org/issues/show_bug.cgi?id=54532 ), but this is not an ideal solution. When I use the office context for pyuno bridge, pyuno will get a performance penalty, because I use e.g. components like TypeConverter during bridging calls, which will end in multiple overhead remote calls per pyuno call and pyuno doesn't work anymore when the office is down. So I need the local context used in bootstrap, but this is unreachable lost in the cppuhelper bootstrap() function. So the only chance I have currently is to bootstrap a second context, this is not nice at all and has other side effects. Any thoughts ? Bye, Joerg Kay Ramme - Sun Germany - Hamburg wrote: Hi Joerg, Joerg Budischewski wrote: I am actually also not sure, whether this belongs in a core api. This function is a nice helper for starting to program with the office but it hides too much away imho ( if the office process cannot be reached, the function loops endlessly, it always an office process even when an office is running, etc.) to be used in a professional application. that bootstrap currently starts an office process is an implementation detail only. Actually we chose the wrong name for it, when we implemented it. The right name would have been something like ReferenceXComponentContext getComponentContext(); The semantics are, that this function returns the systems (which could be a process, a user, a host, a LAN, a WAN, ...) component context. The height of the abstraction allows us, to basically implement / optimize everything behind the scenes, while providing a compelling and simple to use interface for developers. In my understanding, especially professional developers want to mostly deal with the customers problem, and less with nasty API details. Bye, Joerg Kay - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] [pyUNO]Unexpected connection closure
Hi, the general reason for this issue is that the server process has crashed, please check this. You might consider using http://udk.openoffice.org/python/oood/index.html, which at least ensures, that you can continue after a crash. bye, Joerg Laurent Godard wrote: Hi all OOo1.9.122 I use pyUNO but do not know if it is only python related i created a massive document converter (as OOoConv) using xml-RPC and some nice features I convert the documents by remotely (localhost though) scripting an OOo instance (1 to 3 running simultaneously) though pyUNO Using OOo1.1.4, all seems to run correcttly, no problem Using OOo1.9.122, lead to some messages, randomely after 20 to 200 conversions uno.com.sun.star.lang.DisposedException, URP_Bridge : disposed\n(tid=6) Unexpected connection closure i tried in the code to kill and restart OOo and connection, but that's the same Are there any know issue woith OOo2 regarding Unexpected connection closure ? Feel free to ask for more details Laurent - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] PyUNO 2.0 storeToURL bug ?
Hi, please check, what sourceDoc is e.g. with print sourceDoc unohelper.inspect( sourceDoc ) and whether it supports the desired interface. I think you get this message, when sourceDoc is None. Bye, Joerg Laurent Godard wrote: Hi all i simply try to load/export a file using PyUNO in OOo2 (m118) (code at the end) i end with this error Traceback (most recent call last): File ./testMe.py, line 23, in ? sourceDoc.storeToURL(url,args) AttributeError: storeToURL while all is ok with 1.1.4 the same code (or nearly) as macro works I tried alot of source files, target format (PDF, MS, nothoing ..) same result ... same also with a storeAsURL Is it a known issue ? Am I to tired ? Thanks in advance laurent ' import uno, unohelper from com.sun.star.beans import PropertyValue theSourceFile=/home/lgodard/Chronique.sxw theTargetFile=/home/lgodard/tmp/toto.pdf localContext = uno.getComponentContext() resolver = localContext.ServiceManager.createInstanceWithContext('com.sun.star.bridge.UnoUrlResolver', localContext ) ctx = resolver.resolve('uno:socket,host=%s,port=%s;urp;StarOffice.ComponentContext' % ('localhost', '2002')) smgr = ctx.ServiceManager desktop = smgr.createInstanceWithContext('com.sun.star.frame.Desktop',ctx) args = (PropertyValue('Hidden', 0, False, 0),) url = unohelper.systemPathToFileUrl(theSourceFile) sourceDoc = desktop.loadComponentFromURL(url, '_blank', 0, args) url = unohelper.systemPathToFileUrl(theTargetFile) args = (PropertyValue('FilterName', 0, 'writer_pdf_Export', 0),) sourceDoc.storeToURL(url,args) sourceDoc.close(True) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] Question concerning bridges/source/remote/urp code
Hi, Arnulf Wiedemann wrote: Hi, in module urp_job.cxx in method ServerMultiJob::execute there is a call to pSJE-m_pRemoteI-pDispatcher, which in turn calls Uno2RemoteStub::thisDispatch in static/stub.cxx. Within that method there is a call to p-m_pUnoI-pDispatcher. I was not able to figure out which dispatcher from which module is called over that function pointer. this depends on how your target object is implemented. In case it is a c++ object, that code should be found in bridges/source/cpp_uno/platform/uno2cpp.cxx , have a look at cppu_unoInterfaceProxy_dispatch. (e.g. platform=msvc_win32_intel for windows ) Bye, Jörg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] URP and the Current Context
Hi, Stephan Bergmann wrote: What does happen, when you don't give this option ? In case, a current context is transported you probably get disastrous results (the additional release calls for the current context trigger this problem, bit I don't remember the exact circumstances anymore). As most people don't use tcpdelay right now, introducing this feature will create some noise, I think (depending on how much currenct contexts are use currently). One just needs to keep this in mind. It's a little sad, that the standard connection string needs to be extended by this option, but I don't see another solution here. For the testtools/bridgetest measurements, tcpnodelay=0/1 actually made no difference. (The reason probably is that both the binary UNO and the Java URP bridge implementations try to avoid asynchronous data packets; I improved the behaviour of the Java URP bridge implementation in this regard on CWS sb23. The tcpnodelay=0/1 difference was noticable, however, with the new testtools/perftest tests, before I did those Java improvements.) the Nagle algorithm is sensible for strict request/response protocols. It can have quite disastrous effects, when when you leave this pattern. (typically when one side writes on a socket and flushes it and afterwards it writes a second message. When the remote counterpart does not react on the first message (e.g. because it is a oneway call), the second message will reach the remote counterpart only after 100ms). I learned this from debugging a situation, where it lead to a 10 calls per second (compared to a 500 calls per secoond with this option) call frequency. This was a callback situation where a parameter was passed, that was not used. I'll try to recode this. I would have thought, that this situation may occur more often with a dummy parameter passed always, but let's wait for my example to discuss this. Also, the Nagle algorithm is there for a reason, so disabling it by default might be debatable. IMHO the connection services should create a default socket, as they can be used independently of the urp bridge, so it doesn't make sense to optimize them for one application imho. No more other concerns, except that it needs to be said, that this change will be incompatible (meaning that a 2.0.0 Office won't be able to talk to 2.0.1 office), won't it ? No, this is fully backward compatible. (There is a new URP protocol property CurrentContext that is automatically negotiated when connecting two bridge endpoints. I will update the URP specification in time before the changes on CWS sb23 hit the master.) Ok, nice :-). BTW, do you know whether PyUNO and the bridge between PyUNO and binary UNO already support the current context? It seems, that I have overlooked this. How about other scripting languages (ole, basic) ? I can add very simple native runtime functions to pyuno to allow the access (wrappers arrount get/setCurrentContext() functions). Could it be another option to add a CurrentContextHolder property to the component context ? The property would be an uno object with just one property (currentContext), which simply delegates to the C++ get/setCurrentContext() runtime functions. Such a functionality could be used by all scripting languages. But errors in script code (not layering the context correctly) can easily generate very strange and difficult to debug side effects, so I am not 100% sure, that this a gread idea. Bye, Joerg - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[udk-dev] FYI: Integration of python-scripts in Tools/Macro dialog available since OOo 1.9.m79
Hi, since the above mentioned version, pyuno supports the office scripting framework in the upcoming OOo-2.0 release. The support is limited to the 'core' framework, meaning that execution and assigning of macros works fine, but editing and debugging macros is not integrated in OpenOffice.org's UI (simply because of the lack of development resources). Thus, this feature is targeted at more advanced script developers. Details about the integration can be found at http://udk.openoffice.org/python/scriptingframework/index.html In case you don't know pyuno, have a look at http://udk.openoffice.org/python/python-bridge.html Bye, Joerg Budischewski - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [udk-dev] Testing if PyUno is installed from BASIC
Hi, Ian Laurenson wrote: I am trying to write a download and install addons and templates routine for OOo. I would like to test if PyUno has been installed. I think that I can test if Java has been installed with: oJava = CreateUnoService(com.sun.star.java.JavaVirtualMachine) fnJavaAvailable = oJava.isVMEnabled Any suggestions for how to test if PyUno is installed? the following script tries to load python into the office and checks, whether this was successful. Bye, Joerg Sub Main if hasPythonLoader() then msgbox Python is installed else msgbox Python is not useable in office end if End sub function hasPythonLoader() as Boolean on error goto myErrorHandler ret = createUnoService(com.sun.star.loader.Python ) hasPythonLoader() = not isnull( ret ) exit function myErrorHandler: resume next End function - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]