Java Web Start launch alternative

Forum for developers

Java Web Start launch alternative

Beitragvon luc » Fr Feb 26, 2016 10:44 am

Hello, I would personally find it great to have a Java Web Start link (JNLP) on yacy.net website as an alternative to OS dependent installers (here is a good example on JOSM project website : http://josm.openstreetmap.de/)
I think it could be helpful for some newcomers who don't want to "install" something but want to try a local YaCy peer, and may be afraid by github and ant compile.
At least a link to http://latest.yacy.net:81/update/ last stable release would be a good thing.
But a Java Web Start link is easier (only one click needed) and truly cross-platform.

First step to make it possible is to produce a runnable jar. Not a big deal with an ant task, but some other modifications are likely to be needed : for example, at first startup yacy assume default config files are in a local 'defaults' directory rather than in classpath. I have already started to experiment, but as more work is needed, I am wondering what you think of this idea... Have you already tried? Would you support this and eventually add an third deployment link on yacy.net website?
luc
 
Beiträge: 232
Registriert: Mi Aug 26, 2015 1:04 am

Re: Java Web Start launch alternative

Beitragvon luc » Do Mär 03, 2016 1:26 pm

Hi, I continue experimenting with this idea. htroot and defaults folders not being regular classpath resources really doesn't help... But I managed to start a peer without errors based on such a all-in-one runnable jar! Still have to solve some Jetty related issues, but I am confident.
I finally used Maven Shade plugin which is better to package an single runnable jar. It is really helpful for example to merge name conflicting SPI services contained in lucene jars.
For the future, I also believe it would really be a good idea to move htroot and defaults to a regular classpath folder such as src/main/resources/net/yacy thus following maven default archetype...
luc
 
Beiträge: 232
Registriert: Mi Aug 26, 2015 1:04 am

Re: Java Web Start launch alternative

Beitragvon luc » Mi Mär 23, 2016 7:01 pm

I finally managed to build fully functional YaCy runnable jar, and it can also be launched using Java Web Start!

You can have a try on this page : http://luccioman.github.io/yacy_search_server/

There are still more non regressions tests to run, but all major use cases worked for me on Debian Jessie or Windows 7, with Oracle JVM 7 or 8 (it currently won't work with IcedTea Web).
Any feedback is welcome.
luc
 
Beiträge: 232
Registriert: Mi Aug 26, 2015 1:04 am

Re: Java Web Start launch alternative

Beitragvon Orbiter » Mi Mär 30, 2016 9:06 am

Hey luc,
I just tried this and it is working fine! Thats a good thing!
We should integrate this into the main branch. I had a look into your commits: that was a lot of work and you changed quite a bit. I must take some time to read all the changes. I believe you fixed a lot of path issues to make this possible?
Orbiter
 
Beiträge: 5769
Registriert: Di Jun 26, 2007 10:58 pm
Wohnort: Frankfurt am Main

Re: Java Web Start launch alternative

Beitragvon luc » Mi Mär 30, 2016 5:31 pm

Hello, thank you very much for reviewing, that's encouraging!

Yes the only purpose of all changes I made on my branch was to allow launching through a single runnable jar and then through Java Web Start. My ultimate goal would eventually to allow launching YaCy as a browser embedded applet.
Most of the work is only refactoring on resources loading : the idea is to load necessary resources as classpath resources URLs instead of relative or absolute file paths.
I also modified icon tray enabled/disabled conditions for linux because user also need feedback on this OS when YaCy is not launched as a service.

Before merging to main branch there are still non regressions tests to run with classical ditribution and OS dependant installers. I think some modifications are still to be done at least in pom.xml (htroot, defaults, lang, and other resources should only be included in the new all-in-one runnable jar, and kept out of yacycore.jar as currently done in main distribution).

I will try to finalize these tests as soon as possible. If you have some other questions don't hesitate!
luc
 
Beiträge: 232
Registriert: Mi Aug 26, 2015 1:04 am

Re: Java Web Start launch alternative

Beitragvon luc » Do Mär 31, 2016 6:16 am

I was initially thinking that embedding htroot resources in yacycore jar could be a performance issue when running YaCy from tar.gz distribution but my last tests seem to show it is not a problem.
So I pushed on my git branch some fixes and changes to make ant compiling and maven tgz distribution packaging consistent with new all-in-one runnable jar package.

Now last remaining points to check are other ant tasks ("copyMain4Dist", "installonlinux"...), OS specific installers packaging and running, and merging last changes from main branch. Personally I am only sure to have time to do this from next Monday, but of course you can already do it on your own.
luc
 
Beiträge: 232
Registriert: Mi Aug 26, 2015 1:04 am

Re: Java Web Start launch alternative

Beitragvon Orbiter » Do Mär 31, 2016 2:52 pm

Two questions - because I am completely unfamiliar with the jnlp process:
- where does the yacy.jnlp stores DATA?
- how does it come that execution of yacy.jnlp creates a YaCy.app and where is the code?
Orbiter
 
Beiträge: 5769
Registriert: Di Jun 26, 2007 10:58 pm
Wohnort: Frankfurt am Main

Re: Java Web Start launch alternative

Beitragvon luc » Do Mär 31, 2016 6:04 pm

- the jar file downloaded with jnlp is stored in a temporary folder. For example on linux : /home/username/.java/deployment/cache. You can configure this with jre/bin/jcontrol program in General tab, button "Parameters...". YaCy DATA folder may be created here at first launch, but I also experienced DATA folder re-created directly on desktop when launching from desktop shortcut. That's why I chose to specify a DATA parent folder as a yacy class main parameter (see https://github.com/luccioman/yacy_searc ... y.jnlp#L29). Thus now DATA should be in [userHome]/yacy-1.83-data.

- JNLP allow to specify if you want a desktop and a menu bar shortcuts to be created with :
Code: Alles auswählen
<shortcut>
     <desktop/>
     <menu/>
</shortcut>

I chose that but this is not mandatory and you may prefer to consider JNLP launch as only a way to try YaCy and not to "install" it.

Applications and resources can be removed using again jre/bin/jcontrol program : Paremeters... > Delete files or Visualize > Cross button

JNLP syntax reference for Java 7 is here : https://docs.oracle.com/javase/7/docs/t ... yntax.html
luc
 
Beiträge: 232
Registriert: Mi Aug 26, 2015 1:04 am

Re: Java Web Start launch alternative

Beitragvon luc » Do Mär 31, 2016 6:17 pm

I just want to add another key point is permissions.

As default Java applets or Java Web Start applications are "Sandboxed" : they do not have access to file system resources for example. YaCy needs to write files, to open a port and to connect to multiple peers. So "all-permissions" element in JNLP is needed, and jar must be signed with a certificate validated by a recognized Certificate Authority (I created a Certum "Open Source Developer" certificate) or a security warning will be displayed or application may even be blocked (users can still add security exceptions using jcontrol program but it is a little bit annoying).
Note also that on latest Mac OS X even with a valid certificate Mac now block applets and jnlp as default and user will have to add a security exception in mac preferences.
luc
 
Beiträge: 232
Registriert: Mi Aug 26, 2015 1:04 am

Re: Java Web Start launch alternative

Beitragvon luc » Fr Apr 08, 2016 3:05 am

Hi, if you are interested my branch (https://github.com/luccioman/yacy_searc ... deployment) is ready to merge.

I tested with Java Web Start and all previously existing deployment options on these platforms : Linux Debian 8 64 bits, Windows 7 64 bits and Mac OS X Mavericks 64 bits.
Please also note that now it is possible to launch in Eclipse IDE directly yacy main class without the need for ant.

My non-regression test cases were simple :
- launch without errors
- run some text and images searches
- open all Administration menus
- launch a simple crawl
- change language

I will now run some more extended tests and fix any eventual found regression on this same branch.
luc
 
Beiträge: 232
Registriert: Mi Aug 26, 2015 1:04 am

Re: Java Web Start launch alternative

Beitragvon luc » Sa Apr 09, 2016 12:27 pm

So for now deeper testings with more advanced features did not reveal new bugs on my modified peers.
I only noticed some non blocking points specific to Java Web Start running mode that may be improved :
- restart button only triggers shutdown but does not actually restart
- on /Performance_p.html : when modifying max memory value it correctly saved, but not actually used (this parameter is controlled in JNLP file : "max-heap-size" parameter)
- ConfigUpdate_p.html page doesn't make sense in this mode as it is the role of Java Web Start system to check and eventually download latest packaged version before running.
luc
 
Beiträge: 232
Registriert: Mi Aug 26, 2015 1:04 am


Zurück zu YaCy Coding & Architecture

Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast

cron