Page 1 of 1

application.showURL Mac issue Smart Client Servoy 2022.03.03

PostPosted: Tue Jan 10, 2023 1:28 pm
by LXS
Hi,

we use Smart Client with Servoy 2022.3.3 and have a Mac issue with application.showURL().
Further more we use Java 11 with the Servoy Bootstrapper and buildt a native Mac app - no Java Webstart.

When we call application.showURL() on Mac no browser window opens.
Instead there's a message in the status bar:

"If running in client this url is shown in browser: <url...>, the url is pasted on your clipboard"

On Windows it works fine as expected.

Mac OS: 12.6 (macOS Monterey)

What we can do to get the (old) Windows behavior?

Thanks a lot!

Alex

Re: application.showURL Mac issue Smart Client Servoy 2022.0

PostPosted: Tue Jan 10, 2023 1:49 pm
by jcompagner
i guess we need to see what exception are generated
so if you use the bootstrapper, so not sure if you can start it through the console with "java" and then see the console output
but something is going wrong there with the BrowserLauncher 3rd party lib that we use.

but what you can try todo is use the new Desktop api:

var desktop = Packages.java.awt.Desktop.getDesktop();
desktop.browse(new Packages.java.net.URI("https://nu.nl"));

Re: application.showURL Mac issue Smart Client Servoy 2022.0

PostPosted: Tue Jan 10, 2023 2:44 pm
by LXS
Hi Johan,

thanks for the quick reply!

Now i've started the Smart Client via Terminal java -jar bootstrapper.jar

The exception when executing application.showURL() is the following:

Code: Select all
java.io.IOException: java.lang.ClassNotFoundException: com.apple.mrj.MRJFileUtils
   at com.servoy.j2db.util.BrowserLauncher.openURL(BrowserLauncher.java:60)
   at com.servoy.j2db.smart.StandAloneRemoteChecker.showURL(StandAloneRemoteChecker.java:119)
   at com.servoy.j2db.smart.J2DBClient.showURL(J2DBClient.java:4278)
   at com.servoy.j2db.scripting.JSApplication.js_showURL(JSApplication.java:2048)
   at com.servoy.j2db.scripting.JSApplication.js_showURL(JSApplication.java:1983)
   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.base/java.lang.reflect.Method.invoke(Unknown Source)
   at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:166)
   at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:292)
   at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)


Seems that the class com.apple.mrj.MRJFileUtils could not be found.
Do you know this class?

Thanks for the workaround with the Desktop API. I also will try this.

Alex

Re: application.showURL Mac issue Smart Client Servoy 2022.0

PostPosted: Thu Jan 19, 2023 8:53 am
by LXS
Hi Johan,

any news?

Thanks
Alex

Re: application.showURL Mac issue Smart Client Servoy 2022.0

PostPosted: Thu Jan 19, 2023 10:26 am
by jcompagner
yes that you need to use that desktop api for now.
those classes are removed by apple because they don't supply the jdk