Smartclient bootstrapper (alternative downloader)

To speed up (especially under windows) the smart clients startup, we created a bootstrapper for webstart

This by passes for the most part webstart, webstart only downloads and verifies the bootstrap.jar that is attached (and referenced in the attached jnlp file)

The downloads will go into [user-home].servoy\libCache[hostname]

if 1 file changes on the server it will delete the cache and downloads it again.

The jnlp file can be fully configured what ever you like (or should be filled in correctly)

{{YOUR_FULL_HOSTNAME_AND_CONTEXT_IF_DEPLOYED_THROUGH_WAR}} : That needs to be filled based what the users sees in the browser (so host name with port and with context if the servoy app server is not deployed at the ROOT)

The rest between the tag can be filled in to what ever you want.

between the tag you can specify any java version (default is only 1.8 added you can add another line that says 1.7)
and this only has a reference to the bootstrap.jar

If you sign your self then you can change anything in that jar (so including the application-name manifest property)
also if you have adjusted the bootstrap.jnlp file (can be renamed also to what ever you like) exactly how you want
Then you can add that jnlp file to the jar file under:

JNLP-INF/APPLICATION_TEMPLATE.JNLP

see: http://docs.oracle.com/javase/7/docs/te … dJNLP.html

and then sign the jar again, this makes the jnlp file also signed so it doesn’t matter at all what kind of things you use/set in it

What should also go between the tag are all the native resources of your beans/plugin.
So you you have a plugin or bean that has in its jnlp file one or more native resource like the browser suite:
https://www.servoyforge.net/projects/br … e.jar.jnlp

Then you need to copy those over so the tags with “os” and/or “arch” needs to be in the bootstrap.jnlp file

The last thing are the arguments:

{{SOLUTION_NAME}}

the first argument should always be the solution name that you want to load (so if you want to load directly a specific solution)

You can also not specific it then the select solution dialog is shown.

You can also make profiles (that is what servoy profiles basically is, pushing arguments to the client)
Then you can add multiply arguments to the client by adding more, like adding:

system.property.SocketFactory.tunnelConnectionMode:http

as the second argument (the first should then always be a soluton or just “servoy_client”)

If you add that argument then the tunnel will be forced in http mode (if the server is configured in "http&Socket)

This wya you can push any system.property to servoy that you want.
(You can also add those through the java-vm-args as -Dxxxx=y)

bootstrap.jar and bootstrap.jnlp should be copied into the ROOT of the context
So that is in a default servoy installation: \application_server\server\webapps\ROOT
in a war file it should be in the root of the war file

Then you can access it through:

http://hostname:port/bootstrap.jnlp

(and the above code base should be then http://hostname:port)

bootstrap.zip (19 KB)

As I was able to test this in an early stage, I can confirm Johan did a great job here.

A big thank you for all his patience during testing and debugging, as he had to work with us ‘non Java’ developers :-)

May I ask how much faster it is compared to webstart?

Bernd.N:
May I ask how much faster it is compared to webstart?

It is still using webstart, but the thing that is making webstart perform poorly is checking each jar-file.
In this case it will only handle the bootstrap.jar (and maybe native resources as Johan mentioned).
The remainder of the jar-files is handled by the bootstrap.jar and will create its own cache in the .servoy folder.

So it’s hard to say what the exact win will be.
But just try it, it won’t hurt existing installs and current users won’t know about it (and use it) unless you make them start the solution via bootstrap.
In like 15 minutes you should have finished the setup and you can see for yourself what the win will be.

Does this work also in older Servoy versions?

Hi Nicola,

I think this should work, but give it a try.
It’s just 2 files and changing the codebase url in the jnlp file…

Tnx Marc, I’ll try

Wow!
Just tried this on a solution I was trying to clear lots of security warnings from and it works great!
Does seem faster after first launch.
I think this has helped me a great deal, thanks!
[Solution in version 7, using Java 8]

it should work on most old releases (i think even 3.5, but didn’t test it)
it is quite a generic solution, i could even make it more generic and use it on all java webstart applications (but now it knows servoy)

This seems to speed up the launch significantly (using Servoy 6.1). However, the warning dialog shows on every launch, and there is no option to check a box to always accept. Server and Client both on Java 8. Maybe missing this in the manifest?
Application-Library-Allowable-Codebase: *

[attachment=0]Capture.PNG[/attachment]

Update: I can confirm that adding the below to the manifest file fixes the permission issue and the user only gets the warning dialog 1 time on first launch, instead of every launch.

Application-Library-Allowable-Codebase: *

Also, for Mac users, below is an example adjustment to the JNLP so it uses the standard Mac menubar instead of the menubar in the java window.

<application-desc main-class="com.servoy.bootstrapper.Bootstrap">
   <argument>servoy_client</argument>
   <argument>system.property.apple.laf.useScreenMenuBar:true</argument>
</application-desc>

i will add but that is very weird

http://docs.oracle.com/javase/7/docs/te … ifest.html

“The Application-Library-Allowable-Codebase attribute identifies the locations where your signed RIA is expected to be found. This attribute is used to determine what is listed in the Location field for the security prompt that is shown to users when the JAR file for your RIA is in a different location than the JNLP file or HTML page that starts your RIA”

and

“This attribute is not needed if the JAR file for the RIA is in the same location as the JNLP file or HTML page that starts the RIA.”

and that is the case for us, the jar and jnp file all have the same location…

I updated the zip file attached to the first post to have a bit better manifest
(so including the option talked above, i also changed the name to be a bit nicer)

i updated the zip file again, there was a bug in the change detection when javafx was enabled

The files in the zip file are still dated 2016-05-04 ?

that could be because i just dropped the jar in the existing zip.

If you look inside the jar you do see new class files from 29-4

I am testing with the bootstrap.jar.
In Servoy we catch the startup parameters with application.getStartupArguments().

In Windows shortcut ```
"C:\ProgramData\Oracle\Java\javapath\javaws.exe http://ig-visiontest7:8080/bootstrap.jnlp?argument=owner_id:4B584706-68AE-44AE-A8D9-D7984BA418C8

the argument owner_id is not returned by application.getStartupArguments().

I also tested with <argument></argument> in the bootstrap.jnlp but with no result.

Is it possible to pass arguments to the Servoy client via the bootstrap.jar and if yes how?

Regards,

Hi Lambert,

Interesting question.
didn’t try yet, but according to this https://stackoverflow.com/questions/137 … s-via-jnlp it should be possible.

Hope that helps.

no this is not possible, you need a bootstrap.jnlp jar per argument and add those arguments you want to pickup in the jnlp itself
By default we already have a few arguments in it under the section:
it should be something like this:

argument:ownerid:xxxxx

only those arguments can be get inside the client. So if you need special arguments like and owner_id then you need a bootstrap.jnlp file per owner…

bootstrap.jnlp is just a file on disk in the app server, it is not generated everytime you request it.

Thanks, Johan!

I was looking for that “**argument:**ownerid:xxxxx” notation.
That works fine.