Bug 106292 - XMessageBox#execute() in Java fails to draw a window on macOS Sierra
Summary: XMessageBox#execute() in Java fails to draw a window on macOS Sierra
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
5.3.0.3 release
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-03 09:07 UTC by Adomas Venčkauskas
Modified: 2020-07-27 10:14 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Build output of make MessageBox.run on MacOSX (4.65 KB, text/plain)
2017-03-16 13:24 UTC, Alex Thurgood
Details
Working build output of make MessageBox.run on MacOS Sierra (6.65 KB, text/plain)
2017-03-16 13:41 UTC, Adomas Venčkauskas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adomas Venčkauskas 2017-03-03 09:07:14 UTC
Description:
Running XMessageBox#execute() using UNO fails to draw a window for the XMessageBox. The message box is actually executed and you have to press <ESC> or <Enter> to close it; otherwise LibreOffice appears to be frozen.

Steps to Reproduce:
1. Compile the example code provided in http://api.libreoffice.org/examples/DevelopersGuide/GUI
2. Run `make MessageBox.run`

Actual Results:  
LibreOffice is launched with an empty screen.

Expected Results:
A message box is displayed.


Reproducible: Always

User Profile Reset: No

Additional Info:
Works fine on Linux. Have not tested on Windows.


User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36
Comment 1 Alex Thurgood 2017-03-06 07:15:57 UTC
@Stephan : one for you ?
Comment 2 Alex Thurgood 2017-03-06 07:16:43 UTC
Wasn't something like this being discussed on the dev mailing list last week ?
Comment 3 Adomas Venčkauskas 2017-03-06 13:24:55 UTC
I talked about this on the mailing list, but there hasn't been response for a while, so I decided to create an issue in case it accidentally gets buried.

(and you know, keeping tickets for bugs has all kinds of benefits for future referencing)
Comment 4 Yvan Rose 2017-03-15 13:41:01 UTC
This has been a long-standing bug, which dates back to the earliest versions of LO5, also in combination with some updates on the macOS side of things. It makes LO pretty much useless to Zotero users, who then turn to M$ Office to get around this issue. While not a programmer, I am a solid user of both LO and Zotero, so please feel free to contact me in case you'd like me involved with testing, etc. To sweeten the deal, I'll send a good donation to the Foundation as soon as our favourite productivity software is back on track! Many many thanks for your efforts in the meantime.
Comment 5 Alex Thurgood 2017-03-16 11:40:23 UTC Comment hidden (obsolete)
Comment 6 Alex Thurgood 2017-03-16 11:42:39 UTC Comment hidden (obsolete)
Comment 7 Adomas Venčkauskas 2017-03-16 11:45:08 UTC Comment hidden (obsolete)
Comment 8 Alex Thurgood 2017-03-16 12:15:21 UTC
OK, so after having set up my SDK environment (duh), trying to run :

make MessageBox.run

leads to the following error :



"/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java" -Dcom.sun.star.lib.loader.unopath="/Applications/LibreOffice.app/Contents/MacOS" -jar /users/alex/LibreOffice5.4_SDK/MACOSXexample.out/class/GUIExamples/MessageBox.jar

com.sun.star.lib.loader.Loader::getCustomLoader : exec unoinfo: java.io.IOException: Cannot run program "/Applications/LibreOffice.app/Contents/MacOS/unoinfo": error=2, No such file or directory

Exception thread "main" java.lang.NoClassDefFoundError: com/sun/star/util/CloseVetoException...


1) setsdkenv_unix used Apple's JAVA 1.6 as the default JDK - which is surely bound to fail on recent versions of OSX (as it is no longer included) and despite having a more recent SDK on the system

2) There is effectively no unoinfo file in /LibreOffice.app/Contents/MacOS/
Comment 9 Alex Thurgood 2017-03-16 12:22:15 UTC Comment hidden (obsolete)
Comment 10 Alex Thurgood 2017-03-16 12:28:39 UTC
Sigh 

unoinfo is included in my LibreOfficeDev54 alpha, but not in LibreOffice.app 5303, which is what setsdkenv_unix picked up on...
Comment 11 Alex Thurgood 2017-03-16 12:41:43 UTC Comment hidden (obsolete)
Comment 12 Alex Thurgood 2017-03-16 12:54:59 UTC
Either way, the make MessageBox.run fails to execute for me.
Comment 13 Alex Thurgood 2017-03-16 13:11:51 UTC Comment hidden (obsolete)
Comment 14 Alex Thurgood 2017-03-16 13:23:01 UTC
Tested against

Version: 5.4.0.0.alpha0+
Build ID: 7abb4dda1d2e08a428c768c7706046adbf88c860
CPU threads: 2; OS: Mac OS X 10.12.3; UI render: default; 
Locale: fr-FR (fr_FR.UTF-8); Ca
Comment 15 Alex Thurgood 2017-03-16 13:24:05 UTC
Created attachment 131930 [details]
Build output of make MessageBox.run on MacOSX
Comment 16 Adomas Venčkauskas 2017-03-16 13:29:03 UTC
Ok, I fired up my Mac. Maybe this will help.

The output of setsdkenv_unix:

`
 ************************************************************************
 *
 * SDK environment is prepared for MacOSX
 *
 * SDK = /Users/adomas/LibreOffice5.3_SDK
 * Office = /Users/adomas/lode/dev/core/instdir/LibreOfficeDev.app
 * Make = /Users/adomas/lode/opt/bin
 * Zip = /usr/bin
 * cat = /bin
 * sed = /usr/bin
 * C++ Compiler = /usr/bin
 * Java = /System/Library/Frameworks/JavaVM.framework/Versions/A
 * SDK Output directory = ./LibreOffice5.3_SDK
 * Auto deployment = YES
 *
 ************************************************************************
`

It picked all of this up by itself by default. I.e. my local build of LibreOffice (along with the version of Make that was installed as part of LO build process). The version of Java is 1.8.0_121.

The output of `make MessageBox.run` is 

`
"/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java"  -Dcom.sun.star.lib.loader.unopath="/Users/adomas/zotero/lode/dev/core/instdir/LibreOfficeDev.app/Contents/MacOS" -jar LibreOffice5.3_SDK/MACOSXexample.out/class/GUIExamples/MessageBox.jar
CE> warn:configmgr:13915:1:configmgr/source/xcuparser.cxx:166: bad set node <prop> member in "file:///Users/adomas/zotero/lode/dev/core/instdir/LibreOfficeDev.app/Contents/Resources/../Resources/../user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu27929i3c2d.tmp/Addons_AOO4.xcu"
CE> warn:configmgr:13915:1:configmgr/source/xcuparser.cxx:911: ignoring modify of unknown set member node "ToolBarItems" in "file:///Users/adomas/zotero/lode/dev/core/instdir/LibreOfficeDev.app/Contents/Resources/../Resources/../user/uno_packages/cache/registry/com.sun.star.comp.deployment.configuration.PackageRegistryBackend/lu27929i3c2d.tmp/Addons_AOO4.xcu"
Connected to a running office ...
CE> warn:legacy.tools:13915:7:toolkit/source/helper/unowrapper.cxx:176: UnoWrapper::SetWindowInterface: there already *is* a WindowInterface for this window!
CE> warn:legacy.tools:13915:7:toolkit/source/awt/vclxtoolkit.cxx:1301: VCLXToolkit::createWindow: did #133706# resurge?
`
Comment 17 Adomas Venčkauskas 2017-03-16 13:41:42 UTC
Created attachment 131933 [details]
Working build output of make MessageBox.run on MacOS Sierra

This is the terminal output of `make MessageBox.run` on a system with correctly set up environment (no compilation or runtime exceptions/errors).
Comment 18 Stephan Bergmann 2017-03-16 16:11:35 UTC
(In reply to Alex Thurgood from comment #10)
> unoinfo is included in my LibreOfficeDev54 alpha, but not in LibreOffice.app
> 5303, which is what setsdkenv_unix picked up on...

That's a bug, fixed now with <https://cgit.freedesktop.org/libreoffice/core/commit/?id=3e5aa33ef4ea8f5839e358dd62acdc09fe64dda8> "Revert 'Don't package unoinfo in case of Mac OS X like app structure'".

(It's unfortunate that you're going off topic in this bug with issues of running the SDK.  Better file separate bugs in such cases.)
Comment 19 Alex Thurgood 2017-03-16 17:04:38 UTC
(In reply to Stephan Bergmann from comment #18)


> 
> (It's unfortunate that you're going off topic in this bug with issues of
> running the SDK.  Better file separate bugs in such cases.)

Agreed, but I have never tried running the examples in the SDK...
Comment 20 Adomas Venčkauskas 2017-07-22 13:02:38 UTC
We have now built a workaround for this bug by falling back to AppleScript dialogs on MacOS. For future bug visitors, this is the workaround code: https://github.com/zotero/zotero-libreoffice-integration/commit/73c3639fac65a416dddc44af2118628144b1aaaa
Comment 21 QA Administrators 2018-07-23 02:32:29 UTC Comment hidden (obsolete)
Comment 22 QA Administrators 2020-07-23 03:55:37 UTC Comment hidden (obsolete)
Comment 23 Yvan Rose 2020-07-23 12:09:42 UTC
As far as I can tell, the bug has been resolved. Everything is working fine on my system. However, I can't test on Sierra because I have since upgraded to Catalina.
Comment 24 Adomas Venčkauskas 2020-07-27 10:14:46 UTC
Works fine with current version:

Version: 6.4.5.2
Build ID: a726b36747cf2001e06b58ad5db1aa3a9a1872d6
CPU threads: 4; OS: Mac OS X 10.15.4; UI render: default; VCL: osx; 
Locale: en-US (en_LT.UTF-8); UI-Language: en-US
Calc: threaded