application.showURL Mac issue Smart Client Servoy 2022.03.03

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

application.showURL Mac issue Smart Client Servoy 2022.03.03

Postby LXS » Tue Jan 10, 2023 1:28 pm

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
Attachments
application-showurl-mac-issue.png
application-showurl-mac-issue.png (31.16 KiB) Viewed 2251 times
Alexander Stefan
Dr. Maison & Partner GmbH
www.servoy-plugins.de
www.maison-partner.de
LXS
 
Posts: 151
Joined: Thu Mar 01, 2007 12:00 am

Re: application.showURL Mac issue Smart Client Servoy 2022.0

Postby jcompagner » Tue Jan 10, 2023 1:49 pm

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"));
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: application.showURL Mac issue Smart Client Servoy 2022.0

Postby LXS » Tue Jan 10, 2023 2:44 pm

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
Alexander Stefan
Dr. Maison & Partner GmbH
www.servoy-plugins.de
www.maison-partner.de
LXS
 
Posts: 151
Joined: Thu Mar 01, 2007 12:00 am

Re: application.showURL Mac issue Smart Client Servoy 2022.0

Postby LXS » Thu Jan 19, 2023 8:53 am

Hi Johan,

any news?

Thanks
Alex
Alexander Stefan
Dr. Maison & Partner GmbH
www.servoy-plugins.de
www.maison-partner.de
LXS
 
Posts: 151
Joined: Thu Mar 01, 2007 12:00 am

Re: application.showURL Mac issue Smart Client Servoy 2022.0

Postby jcompagner » Thu Jan 19, 2023 10:26 am

yes that you need to use that desktop api for now.
those classes are removed by apple because they don't supply the jdk
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet


Return to Programming with Servoy

Who is online

Users browsing this forum: alasdairs and 14 guests