JavaFX-11/macOS: DirectoryChooser crashes 'NSObjectNotAvailableException' - java

I develop a java application using openjfx modules.
I now want to use DirectoryChooser to let the user select several files as an input (code below). Everytime I start the application from the IDE it crashes with the exception below. By crashing I mean totally terminates (not freezing).
I also tried some sample code like this to figure out if there is anything wrong with my implementation but each sample I found gave me the same issue.
I'm unsure if this is a general issue/bug because I saw old bugs, in the oracle bug tracker but they where all marked as fixed.
I would be happy if someone could provide some help on this. I would even be happy with a workaround that just avoids DirectoryChooser if there is any.
Steps to reproduce:
create a small Application with the demo code from here.
run the application
try to open directory chooser
Background information:
OS: macOS 10.15.2 Catalina
IDE: intelliJ IDEA Ultimate 2019.3
Exception
2020-01-30 17:18:31.288 java[49749:1319417] *** Terminating app due to uncaught exception 'NSObjectNotAvailableException', reason: 'GlassOpenPanel is not a supported subclass for sandboxing'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff364ea8ab __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff6c75b805 objc_exception_throw + 48
2 CoreFoundation 0x00007fff364ea701 +[NSException raise:format:] + 189
3 AppKit 0x00007fff33d43aa9 +[NSSavePanel(Instantiation) _crunchyRawUnbonedPanel] + 368
4 libglass.dylib 0x00000001370a2ba6 Java_com_sun_glass_ui_mac_MacCommonDialogs__1showFolderChooser + 358
5 ??? 0x0000000117695950 0x0 + 4687747408
6 ??? 0x000000011768fa00 0x0 + 4687723008
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Solution
As suggested by mipa increasing the OpenJFX version number solved the problem.
At the moment, it seems working for OpenJFX version 14-ea+7 and 15-ea+1 from MavenCentral

Why do you use an outdated Version of JavaFX? The current version is 13 and 14 is coming out shortly. EA releases are already available. You can also use them with Java 11.
I tried two of the examples you mentioned with JavaFX 13 and they worked without problem. This may be due to the fact that a bug has been fixed or due to the fact that I am still using MacOS 10.14.6 Mojave.
Give JavaFX 13 a try and then report back.

Related

SpringBoot openJ9 Kubernetes Crash InterpreterEmulator.cpp:208

I'm randomly getting this crash recently and I'm not sure how to debug this. Can anyone please point me in the right direction.
Tools I have used are,
Spring Boot 2 + Kubernetes + adopt openj9 jdk13
Assertion failed at /home/jenkins/workspace/build-scripts/jobs/jdk13u/jdk13u-linux-x64-openj9/workspace/build/src/build/linux-x86_64-server-release/vm/compiler/../compiler/optimizer/InterpreterEmulator.cpp:208: 0
VMState: 0x000501ff
unexpected bytecode in thunk archetype 0x7f98f6483ee0 at bcIndex 40 JBdload2 (41)
compiling java/lang/invoke/AsTypeHandle.invokeExact_thunkArchetype_X(Ljava/lang/Object;Ljava/lang/Object;)V at level: warm
0:/opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x798015) [0x7f9962316015]
1: /opt/java/openjdk/lib/compressedrefs/libj9jit29.so(+0x7a2dc0) [0x7f9962320dc0]
JVMDUMP039I Processing dump event “abort”, detail “” at 2020/05/12 16:35:10 - please wait.
JVMDUMP032I JVM requested System dump using ‘/home/springboot/core.20200512.163510.1.0001.dmp’ in response to an event
TLDR: This is fixed in the v.0.20.0 release (April 2020) of OpenJ9. The latest release binaries from AdoptOpenJDK for JDK 8, 11 & 14 contain the fix.
The assertion failure is an assertion JIT compiling the MethodHandle (MH) code. A new abstract interpreter was added to give the JIT a better view of the MH "thunkArchetype" code and it missed some of the bytecodes that could occur in MH thunkArchetypes.
See https://github.com/eclipse/openj9/pull/8598 for more details of the fix.

UnsatisfiedLinkError for tomcat7 windowsOS

I am getting below error on my web app.
java.lang.UnsatisfiedLinkError: Can't obtain updateLastError method for class com.sun.jna.Native
com.sun.jna.Native.initIDs(Native Method)
com.sun.jna.Native.<clinit>(Native.java:139)
com.sun.jna.Pointer.<clinit>(Pointer.java:41)
com.sun.jna.platform.win32.WinNT$HANDLEByReference.<init>(WinNT.java:1114)
com.sun.jna.platform.win32.WinNT$HANDLEByReference.<init>(WinNT.java:1110)
waffle.windows.auth.impl.WindowsAuthProviderImpl.logonDomainUserEx(WindowsAuthProviderImpl.java:193)
waffle.windows.auth.impl.WindowsAuthProviderImpl.logonDomainUser(WindowsAuthProviderImpl.java:181)
waffle.windows.auth.impl.WindowsAuthProviderImpl.logonUser(WindowsAuthProviderImpl.java:212)
waffle.apache.MixedAuthenticator.post(MixedAuthenticator.java:233)
waffle.apache.MixedAuthenticator.authenticate(MixedAuthenticator.java:112)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:577)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
I searched that it may be due to some old version access of jna but removing jna is giving me NoClassDefErrors for com.sun.jna.Pointer. Also tried -Djna.nosys=true but its also not solving the issue.
I also tried -Djava.library.path=
from What is the cause of an UnsatisfiedLinkError? but it is also not working..
Any suggestion is highly appreciated.
I resolved this by deleting an old jnidispatch.dll file from my machine.
I'm using Gradle and Tomcat on Windows 7.
Delete the jnidispatch.dll file in C:\Users\<username>\.gradle\native\jna\win32-amd64
Don't have enough rep to just comment, but this is vaguely similar to a question i asked a couple years ago called UnsatisfiedLinkError, despite setting Djava.library.path variable
Somebody suggested making sure i was using the right architecture type, i.e. using 64 bit jdk with 64 bit Tomcat & 32 with 32. Does that match up?

LibGdx unable to launch app on iOs emulator

first of all sorry if this is a duplicate question, I didn't find anything about my problem.
So, I bought a MaC Mini and I want to figure out how can I run my libgdx app on the iOs emulator.
I downloaded all the sofware and updated it : last version of Eclipse, downloaded the RoboVM fork from MobiDevelop (since the official Robo VM plugin no longer exists) and imported my project into Eclipse. I also have got the last Xcode version.
I figured out how to successfully build the iOs project but the problem is that when the app needs to start, I get an error which I'm not able to understand :
2016-10-31 14:56:27.786 simlauncher[1727:91648] +[SimDeviceSet defaultSet]: unrecognized selector sent to class 0x1111a1118
2016-10-31 14:56:27.798 simlauncher[1727:91648] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[SimDeviceSet defaultSet]: unrecognized selector sent to class 0x1111a1118'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff878336fb __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff9c03aa2a objc_exception_throw + 48
2 CoreFoundation 0x00007fff878b3c04 +[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff877a6f03 ___forwarding___ + 1059
4 CoreFoundation 0x00007fff877a6a58 _CF_forwarding_prep_0 + 120
5 simlauncher 0x000000010deeb21d getSimDevice + 53
6 simlauncher 0x000000010deeadbb moe_main + 569
7 simlauncher 0x000000010deeab5c main + 275
8 libdyld.dylib 0x00007fff9c917255 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I think the problem is that robovm doesn't find the emulator that is opened while trying to start the app.
I had the same problem. Couple weeks ago everything was fine, but yesterday I tried to run simulator and I had the same exception as you... What I remember is that I upgraded my XCode to 8.1 version. So I deleted my current XCode 8.1 and then I installed XCode 8. After that simulator works fine. I don't know if this is 8.1 version issue - maybe simple reinstall is sufficient. How to downgrade XCode?
Uninstall your actual XCode - right click on the XCode icon in Applications and click "Move to trash"
Go to https://developer.apple.com/download/index.html site, login, go to bottom of the site and click "See more downloaods".
Select XCode 8 from the list, download and install.
Reboot system

Gradle aapt error: syntax ")" not found on Android Studio 1.5.1 Linux

Unburden
First of all, I would like to unburden: Android Studio completely sucks and it is by far the worst big IDE I've used all my life long! I got stuck on errors just for opening that thing! And when I have hardly fixed one, seventeen new ones come rightly from the hell to my screen! I am (trying) to use that piece of [you know] for 4 days now, and till now I was not able to code one single line of code! What does an IDE is supposed to be useful for again?
-- Edit1: I just installed the full 1.4.1 version right now and first thing it showed me was: WizardException: Ignoring unknown package filter 'source-25' and others errors.
-- Edit2: I did a new FRESH Mint 18 install in a completely clean partition, installed only Java 7 (Oracle) and tried to run the AS-1.5.1 but... the same error on install and a subtle different log of error messages (please, see the log here) when gradleing.
The problem
Ok, the last problem (1.5.1) is that now I am trying to make gradle to build the "project" (it is just an empty activity created by the wizard, default code untouched) and I get this error:
~/AndroidStudioProjects/MyApplication $ gradle clean build --stacktrace
Incremental java compilation is an incubating feature.
:clean UP-TO-DATE
:app:clean
//...[other succesfull msgs here]...
:app:mergeDebugResourcesAAPT err(Facade for 16120822): /home/sidney/Android/Sdk/build-tools/25.0.0/aapt: 3: /home/sidney/Android/Sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
AAPT err(Facade for 22545775): /home/sidney/Android/Sdk/build-tools/25.0.0/aapt: 3: /home/sidney/Android/Sdk/build-tools/25.0.0/aapt: Syntax error: Unterminated quoted string
//...[other repeated errors here]...
Exception in thread "png-cruncher_8" java.lang.RuntimeException: Timed out while waiting for slave aapt process, make sure the aapt execute at /home/sidney/Android/Sdk/build-tools/25.0.0/aapt can run successfully (some anti-virus may block it) or try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 60 seconds
at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:108)
at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:110)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:203)
at java.lang.Thread.run(Thread.java:745)
//...[other repeated errors here]...
--- UPDATE: Please, see this other log of the external terminal used to run AS ---
What I've tried to solve that:
Install aapt system-wide;
Switch from Java 8 to Java 7;
Change gradle to off-line;
Change JDK configs to switch from the AS one to the system one;
Set SLAVE_AAPT_TIMEOUT to 30 (I changed back as you can see in the log link)
Set ANDROID_EMULATOR_FORCE_32BIT to true;
Install via ubuntu-make and also via ppa;
And so many others things I could find over Internet.
Environment specs
Linux Mint 18 (32 bits)
AS 1.5.1 (now (trying to use) 2.1.0)
Java Oracle 8 (Already tried the 7)
Why don't I just switch to Eclipse with plug-in
I have a course in mind (in Udacity) and they use that "thing" and it is a prerequisite. I've sent 3 e-mails to them questioning about the possibility of use other IDEs but without answer after 4 days, unfortunately.
Thank you so much for any help!
That error looks like your build tools aren't properly installed/set up. The aapt distributed with the build tools is versioned/linked with the tools, so studio probably isn't going to grab the random system level one. Have you attempted to install them, or did the older Studio version fail to prompt you to do so?
Beyond that, I'm afraid that Studio 1.4 is very deprecated and was missing many, many fixes that are in the newer versions, so it's somewhat likely that you would run into random errors with that version :-( What errors were you encountering with 2.2.1? It would be easier for the Studio team to help address those versus anything you find in 1.4.
My solution? Buy a 64 bits laptop! No installation error, no gradle error, no java error, no error anymore.

Jfugue 5 on Mac

Anyone know how to get JFugue to work on MacOS X 10.10 / JDK 8, talking to a default synthesiser? Even trivial examples which work fine on Windows give results like this, indicating a failure to find a default synth:
Exception in thread "main" java.lang.NullPointerException
at javax.sound.midi.MidiSystem.getFirstDevice(MidiSystem.java:1355)
at javax.sound.midi.MidiSystem.getFirstDevice(MidiSystem.java:1411)
at javax.sound.midi.MidiSystem.getFirstDevice(MidiSystem.java:1378)
at javax.sound.midi.MidiSystem.getDefaultDevice(MidiSystem.java:1165)
at javax.sound.midi.MidiSystem.getDefaultDeviceWrapper(MidiSystem.java:1115)
at javax.sound.midi.MidiSystem.getSynthesizer(MidiSystem.java:351)
at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:458)
at javax.sound.midi.MidiSystem.getSequencer(MidiSystem.java:392)
at org.jfugue.player.SequencerManager.getDefaultSequencer(SequencerManager.java:55)
at org.jfugue.player.SequencerManager.<init>(SequencerManager.java:50)
at org.jfugue.player.SequencerManager.getInstance(SequencerManager.java:41)
at org.jfugue.player.ManagedPlayer.<init>(ManagedPlayer.java:47)
at org.jfugue.player.Player.<init>(Player.java:46)
at FirstJFugueApp.main(FirstJFugueApp.java:11)
Fixed it!
I had an old file plumstoneserv.jar in my path which was stopping things working.

Categories

Resources