Smart client Java 9

lwjwillemsen:
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:
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.(Unknown Source)
at java.desktop/javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
at java.desktop/javax.imageio.ImageIO.(Unknown Source)
at com.servoy.j2db.util.ImageLoader.getSize(ImageLoader.java:562)
at com.servoy.j2db.util.gui.MyImageIcon.(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

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?

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:

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?

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)?

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

Okay, please do!

Is it possible to link specific lines in a jnlp file to a specific java version?

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,