Smart client Java 9

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

Re: Smart client Java 9

Postby lwjwillemsen » Thu Sep 14, 2017 1:19 pm

With the "--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED" on Servoy 7 admin page "servoy.vmClientArgs"

servoy_properties file line:
servoy.vmClientArgs=--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED

I still get the error

Java Web Start 12.0.0.0
Using JRE version 9+181 Java HotSpot(TM) Server VM
JRE expiration date: 03-02-18 00:00
User home directory = C:\Users\Lambert
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
----------------------------------------------------
sep. 14, 2017 1:07:04 P.M. com.servoy.j2db.util.Debug error
SEVERE: Throwable
java.lang.IllegalAccessException: class com.servoy.j2db.LAFManager cannot access class com.sun.java.swing.plaf.windows.WindowsLookAndFeel (in module java.desktop) because module java.desktop does not export com.sun.java.swing.plaf.windows to unnamed module @1acd459
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Unknown Source)
at java.base/jdk.internal.reflect.Reflection.ensureMemberAccess(Unknown Source)
at java.base/java.lang.Class.newInstance(Unknown Source)
at com.servoy.j2db.LAFManager.createInstance(LAFManager.java:113)
at com.servoy.j2db.smart.J2DBClient.putClientProperty(J2DBClient.java:1734)
at com.servoy.j2db.smart.J2DBClient.setLookAndFeel(J2DBClient.java:1565)
at com.servoy.j2db.smart.J2DBClient.startupApplication(J2DBClient.java:782)
at com.servoy.j2db.smart.J2DBClient$4.run(J2DBClient.java:693)
at com.servoy.j2db.smart.J2DBClient.mainImpl(J2DBClient.java:717)
at com.servoy.j2db.smart.J2DBClient.main(J2DBClient.java:680)
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 jdk.javaws@9/com.sun.javaws.Launcher.executeApplication(Unknown Source)
at jdk.javaws@9/com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at jdk.javaws@9/com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at jdk.javaws@9/com.sun.javaws.Launcher.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

Are you sure this should work for Servoy 7 smart client javawebstart?
Is there a way to find out the complete command line that Servoy creates for the javaws.exe startup?
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Smart client Java 9

Postby jcompagner » Thu Sep 14, 2017 1:47 pm

i just tried the same with 7.4.10 and it is working fine
the first time i got that exception
then i added the vm args in and started again (i check the contents of the generated jnlp and it was in there)
and then i didn't get it

So you really should just double check the jnlp file if it really have that stuff now.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Smart client Java 9

Postby lwjwillemsen » Thu Sep 14, 2017 3:26 pm

Solved, after clearing the java cache I got a new jnlp containing the vm args.
Thanks Johan.
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Smart client Java 9

Postby lwjwillemsen » Thu Sep 14, 2017 4:37 pm

Now the next error:

Java Web Start 12.0.0.0
Using JRE version 9+181 Java HotSpot(TM) 64-Bit Server VM
JRE expiration date: 03-02-18 00:00
User home directory = C:\Users\Lambert
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
m: print memory usage
o: trigger logging
p: reload proxy configuration
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
0-5: set trace level to <n>
----------------------------------------------------
sep. 14, 2017 3:52:43 P.M. com.servoy.j2db.util.Debug error
SEVERE: Throwable
java.lang.Error: factory already defined
at java.base/java.net.URL.setURLStreamHandlerFactory(Unknown Source)
at com.servoy.j2db.smart.J2DBClient.initStreamHandlerFactory(J2DBClient.java:828)
at com.servoy.j2db.smart.J2DBClient.applicationInit(J2DBClient.java:1114)
at com.servoy.j2db.smart.J2DBClient.startupApplication(J2DBClient.java:786)
at com.servoy.j2db.smart.J2DBClient$4.run(J2DBClient.java:693)
at com.servoy.j2db.smart.J2DBClient.mainImpl(J2DBClient.java:717)
at com.servoy.j2db.smart.J2DBClient.main(J2DBClient.java:680)
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 jdk.javaws@9/com.sun.javaws.Launcher.executeApplication(Unknown Source)
at jdk.javaws@9/com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at jdk.javaws@9/com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at jdk.javaws@9/com.sun.javaws.Launcher.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)

Caught and handled this exception :
java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
at java.base/java.lang.Integer.parseInt(Unknown Source)
at java.base/java.lang.Integer.parseInt(Unknown Source)
at com.sun.media.imageioimpl.common.ImageUtil.processOnRegistration(ImageUtil.java:1408)
at com.sun.media.imageioimpl.plugins.wbmp.WBMPImageReaderSpi.onRegistration(WBMPImageReaderSpi.java:95)
at java.desktop/javax.imageio.spi.SubRegistry.registerServiceProvider(Unknown Source)
at java.desktop/javax.imageio.spi.ServiceRegistry.registerServiceProvider(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.<init>(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
at java.desktop/javax.imageio.ImageIO.<clinit>(Unknown Source)
at com.servoy.j2db.util.ImageLoader.getSize(ImageLoader.java:562)
at com.servoy.j2db.util.gui.MyImageIcon.<init>(MyImageIcon.java:66)
at com.servoy.j2db.smart.dataui.AbstractScriptLabel.setIconDirect(AbstractScriptLabel.java:636)
at com.servoy.j2db.smart.dataui.AbstractScriptLabel.setIcon(AbstractScriptLabel.java:622)
at com.servoy.j2db.smart.dataui.AbstractScriptLabel.setMediaIcon(AbstractScriptLabel.java:590)
at com.servoy.j2db.component.ComponentFactory.createGraphicalComponent(ComponentFactory.java:1822)
at com.servoy.j2db.component.ComponentFactory.createComponentEx(ComponentFactory.java:349)
at com.servoy.j2db.component.ComponentFactory.createComponent(ComponentFactory.java:257)
at com.servoy.j2db.smart.dataui.DataRendererFactory.placeElements(DataRendererFactory.java:300)
at com.servoy.j2db.smart.dataui.DataRendererFactory.completeRenderers(DataRendererFactory.java:266)
at com.servoy.j2db.FormController.createDataRenderers(FormController.java:449)
at com.servoy.j2db.FormController.init(FormController.java:279)
at com.servoy.j2db.FormManager.leaseFormPanel(FormManager.java:922)
at com.servoy.j2db.FormManager.getFormController(FormManager.java:826)
at com.servoy.j2db.smart.dataui.FormLookupPanel.createFormPanel(FormLookupPanel.java:124)
at com.servoy.j2db.smart.dataui.FormLookupPanel.getFormPanel(FormLookupPanel.java:198)
at com.servoy.j2db.smart.dataui.FormLookupPanel.getDefaultSort(FormLookupPanel.java:177)
at com.servoy.j2db.smart.dataui.SpecialTabPanel.getDefaultSort(SpecialTabPanel.java:378)
at com.servoy.j2db.smart.dataui.SpecialTabPanel.setRecord(SpecialTabPanel.java:243)
at com.servoy.j2db.dataprocessing.DataAdapterList.setRecord(DataAdapterList.java:386)
at com.servoy.j2db.smart.dataui.DataRenderer.getListCellRendererComponent(DataRenderer.java:447)
at com.servoy.j2db.smart.RecordView.syncSliderAndRefresh(RecordView.java:225)
at com.servoy.j2db.smart.RecordView.valueChanged(RecordView.java:334)
at com.servoy.j2db.smart.RecordView.setModelInternal(RecordView.java:103)
at com.servoy.j2db.smart.RecordView.setModel(RecordView.java:309)
at com.servoy.j2db.BasicFormController.notifyVisible(BasicFormController.java:316)
at com.servoy.j2db.FormController.notifyVisible(FormController.java:802)
at com.servoy.j2db.FormManager.showFormInMainPanel(FormManager.java:723)
at com.servoy.j2db.FormManager.showFormInMainPanel(FormManager.java:578)
at com.servoy.j2db.FormManager.makeSolutionSettings(FormManager.java:397)
at com.servoy.j2db.smart.SwingFormManager.makeSolutionSettings(SwingFormManager.java:179)
at com.servoy.j2db.FormManager$1.run(FormManager.java:169)
at java.desktop/java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.desktop/java.awt.EventQueue.access$500(Unknown Source)
at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
at java.desktop/java.awt.EventQueue$3.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.desktop/java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.desktop/java.awt.EventDispatchThread.run(Unknown Source)
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Smart client Java 9

Postby lwjwillemsen » Thu Sep 14, 2017 4:40 pm

And worse: in our application the UI gets scrambled after some navigation...
Attachments
Knipsel.PNG
Knipsel.PNG (130.85 KiB) Viewed 8118 times
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Smart client Java 9

Postby jcompagner » Thu Sep 14, 2017 4:50 pm

lwjwillemsen wrote:java.lang.Error: factory already defined
at java.base/java.net.URL.setURLStreamHandlerFactory(Unknown Source)
at com.servoy.j2db.smart.J2DBClient.initStreamHandlerFactory(J2DBClient.java:828)
at com.servoy.j2db.smart.J2DBClient.applicationInit(J2DBClient.java:1114)
at com.servoy.j2db.smart.J2DBClient.startupApplication(J2DBClient.java:786)
at com.servoy.j2db.smart.J2DBClient$4.run(J2DBClient.java:693)
at com.servoy.j2db.smart.J2DBClient.mainImpl(J2DBClient.java:717)
at com.servoy.j2db.smart.J2DBClient.main(J2DBClient.java:680)
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 jdk.javaws@9/com.sun.javaws.Launcher.executeApplication(Unknown Source)
at jdk.javaws@9/com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at jdk.javaws@9/com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at jdk.javaws@9/com.sun.javaws.Launcher.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)


that is this: https://bugs.openjdk.java.net/browse/JDK-8178799

lwjwillemsen wrote:Caught and handled this exception :
java.lang.NumberFormatException: For input string: ""
at java.base/java.lang.NumberFormatException.forInputString(Unknown Source)
at java.base/java.lang.Integer.parseInt(Unknown Source)
at java.base/java.lang.Integer.parseInt(Unknown Source)
at com.sun.media.imageioimpl.common.ImageUtil.processOnRegistration(ImageUtil.java:1408)
at com.sun.media.imageioimpl.plugins.wbmp.WBMPImageReaderSpi.onRegistration(WBMPImageReaderSpi.java:95)
at java.desktop/javax.imageio.spi.SubRegistry.registerServiceProvider(Unknown Source)
at java.desktop/javax.imageio.spi.ServiceRegistry.registerServiceProvider(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.registerApplicationClasspathSpis(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.<init>(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
at java.desktop/javax.imageio.ImageIO.<clinit>(Unknown Source)
at com.servoy.j2db.util.ImageLoader.getSize(ImageLoader.java:562)
at com.servoy.j2db.util.gui.MyImageIcon.<init>(MyImageIcon.java:66)
at com.servoy.j2db.smart.dataui.AbstractScriptLabel.setIconDirect(AbstractScriptLabel.java:636)
at com.servoy.j2db.smart.dataui.AbstractScriptLabel.setIcon(AbstractScriptLabel.java:622)
at com.servoy.j2db.smart.dataui.AbstractScriptLabel.setMediaIcon(AbstractScriptLabel.java:590)
at com.servoy.j2db.component.ComponentFactory.createGraphicalComponent(ComponentFactory.java:1822)
at com.servoy.j2db.component.ComponentFactory.createComponentEx(ComponentFactory.java:349)
at com.servoy.j2db.component.ComponentFactory.createComponent(ComponentFactory.java:257)
at com.servoy.j2db.smart.dataui.DataRendererFactory.placeElements(DataRendererFactory.java:300)
at com.servoy.j2db.smart.dataui.DataRendererFactory.completeRenderers(DataRendererFactory.java:266)
at com.servoy.j2db.FormController.createDataRenderers(FormController.java:449)
at com.servoy.j2db.FormController.init(FormController.java:279)


yes i have seen that before also, but that is deep into java. We can't do much about that that is ImageIO class init.
Not something we can influence or call differently
Maybe there is some new imageio jar or something that we can ship
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Smart client Java 9

Postby lwjwillemsen » Thu Sep 14, 2017 5:16 pm

yes i have seen that before also, but that is deep into java. We can't do much about that that is ImageIO class init.
Not something we can influence or call differently
Maybe there is some new imageio jar or something that we can ship


Can that explain the messed up UI further on in our application?
Can you please follow up on this?
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Smart client Java 9

Postby jcompagner » Fri Sep 15, 2017 9:28 am

no i don't think so, you can test this
in the plugins dir you images.jar.jnlp
remove these 3 lines from the jnlp:

<jar href="/plugins/images/jai_imageio.jar" download="%%loadmethod%%" part="imageio" version="1.1a"/>
<package name="com.sun.media.*" part="imageio" recursive="true"/>
<package name="jj2000.j2k.*" part="imageio" recursive="true"/>

and i guess flush the cache and restart the server and start a client.
Then that error is gone, but it is possible that some image file types like bmp can't be loaded.

That "m2" field really looks like the Editable field (its a combo i think) that normally should only popup when you start edit a row in the "eenheid" column right?
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Smart client Java 9

Postby lwjwillemsen » Fri Sep 15, 2017 7:27 pm

in the plugins dir you images.jar.jnlp
remove these 3 lines from the jnlp


Your idea (quote) works ok, thanks.

After a lot of tests I added some more --export options and now the UI rendering is fine!

How are you gonna address the imageio issue smart client Java 9 (and older Java versions)?
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Smart client Java 9

Postby jcompagner » Mon Sep 18, 2017 9:44 am

thats a very old lib where sun/oracle don't have anything for anymore.
I think the only problem with above is that there is some problem with BMP images (that one bombs out)

if i read this correctly:

https://docs.oracle.com/javase/7/docs/a ... mmary.html

there is already support for most image formats by default.
So maybe that whole jar is not needed anymore, not sure which one we then loose.
I guess this needs to be investigated
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Smart client Java 9

Postby lwjwillemsen » Mon Sep 18, 2017 8:00 pm

Okay, please do!

Is it possible to link specific lines in a jnlp file to a specific java version?
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands

Re: Smart client Java 9

Postby jcompagner » Tue Sep 19, 2017 11:01 am

i think only for the <j2se line where you can have arguments per java version)

But you don't have control for this in our default generated jnlp, you can use the bootstrapper for that to have full control over the jnlp and how it is configured.

I guess this is kind of needed, that you use the bootstrapper, if you want to support both java8 and java9, because i think java8 will bomb out of you have those -EXPORT arguments (unknown vm property for 8)

make a case for the jai-imageio.jar so that we can have a look, this is not really a problem, because you only get an exception that normally nobody sees,
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8829
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Previous

Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 16 guests

cron