[sip-comm-dev] Some ideas on using Java Web Start to launch SIP Communicator


#1

Hi all!

This is a followup to a e-mail discussion which I had with Emil some days
ago. I wrote him that we are using Java Web Start (JWS) for our application
which embeds the SIP part of SIP Communicator. Naturally, Emil asked if this
could be used for the "standard" SIP Communicator. Unfortunately, my
approach is pretty hack-ish, so I don't think it shold be transferred as is
to the SIP Communicator project. Doing it right is pretty difficult, since
SIP Communicator uses the OSGi framework (with felix as implementation) and
its deployment and security mechanisms don't integrate naturally with the
JWS mechanisms.

Our application was using JWS before we integrated SIP Communicator, so I
had to find a way to make it work. This is how I do it:
* felix.jar is added to the JWS JNLP resources section.
* All bundle JAR files are ZIPPED into a single JAR file "sc-bundles.jar".
This file is added to the JNLP resources as well.
* the JNLP is configured to ask the user to grant the application
"all-permissions".* a custom felix launcher (which i could adapt as starting
point for issue 406) does the following:
** Find the location of the sc-bundles.jar (which JWS has downloaded) by
using Class.getResource("/protocol-sip.jar") and construct a JAR url from
it.
** replace the bundle JAR locations in felix.client.run.properties so that
they point to the bundle in sc-bundles.jar.
** set the system Policy to a policy which always gives ALL_PERMISSIONS to
all code, circumventing the felix OSGi security checks.

The drawbacks of this solution are that
* all bundle JARs are downloaded again even if only a single bundle should
change.
* the bundle JARs use twice the disk space, once in the JWS cache and once in
the felix one.
* simply disabling security is not a nice thing.

If we want to make SIP Communicator launchable with JWS, I think the real way
to do it would be to make felix launchable with JWS in general. I guess the
way would be something like this:

* Make the felix jar and the bundle jars downloadable from the web server.
* Create a custom felix launcher JAR which contains the launcher class and a
felix properties file.
** The properties file references the bundle jars by their http addresses on
the web server (possibly with placeholders, so the launcher can set the server
address at runtime).
* Create a JNLP file which references the custom launcher as main class and
the felix jar.
* Somehow handle security gracefully (I'm not sure what that would involve).
* JWS would then download and start felix, and felix would in turn download
the bundle jars and launch SIP communicator.

This is just a recording of my ideas. I won't actually have time to work on
this, but if someone else would like to do it, I'd be happy to help.

Regards
Michael Koch


#2

Hi Michael,

Thanks for sharing your thoughts. Having a webstart installer would
definitely be a great thing and we are bound to put some time on it
during the following several months.

We would also be working on our own Felix launcher and I expect this to
somewhat facilitate the web start deployment issue.

Cheers
Emil

Koch Michael wrote:

···

Hi all!

This is a followup to a e-mail discussion which I had with Emil some days
ago. I wrote him that we are using Java Web Start (JWS) for our application
which embeds the SIP part of SIP Communicator. Naturally, Emil asked if this
could be used for the "standard" SIP Communicator. Unfortunately, my
approach is pretty hack-ish, so I don't think it shold be transferred as is
to the SIP Communicator project. Doing it right is pretty difficult, since
SIP Communicator uses the OSGi framework (with felix as implementation) and
its deployment and security mechanisms don't integrate naturally with the
JWS mechanisms.

Our application was using JWS before we integrated SIP Communicator, so I
had to find a way to make it work. This is how I do it:
* felix.jar is added to the JWS JNLP resources section.
* All bundle JAR files are ZIPPED into a single JAR file "sc-bundles.jar".
This file is added to the JNLP resources as well.
* the JNLP is configured to ask the user to grant the application
"all-permissions".* a custom felix launcher (which i could adapt as starting
point for issue 406) does the following:
** Find the location of the sc-bundles.jar (which JWS has downloaded) by
using Class.getResource("/protocol-sip.jar") and construct a JAR url from
it.
** replace the bundle JAR locations in felix.client.run.properties so that
they point to the bundle in sc-bundles.jar.
** set the system Policy to a policy which always gives ALL_PERMISSIONS to
all code, circumventing the felix OSGi security checks.

The drawbacks of this solution are that
* all bundle JARs are downloaded again even if only a single bundle should
change.
* the bundle JARs use twice the disk space, once in the JWS cache and once in
the felix one.
* simply disabling security is not a nice thing.

If we want to make SIP Communicator launchable with JWS, I think the real way
to do it would be to make felix launchable with JWS in general. I guess the
way would be something like this:

* Make the felix jar and the bundle jars downloadable from the web server.
* Create a custom felix launcher JAR which contains the launcher class and a
felix properties file.
** The properties file references the bundle jars by their http addresses on
the web server (possibly with placeholders, so the launcher can set the server
address at runtime).
* Create a JNLP file which references the custom launcher as main class and
the felix jar.
* Somehow handle security gracefully (I'm not sure what that would involve).
* JWS would then download and start felix, and felix would in turn download
the bundle jars and launch SIP communicator.

This is just a recording of my ideas. I won't actually have time to work on
this, but if someone else would like to do it, I'd be happy to help.

Regards
Michael Koch

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

I think there is some experience in the Felix community with JWS, so someone might have devised a "good" approach.

-> richard

Emil Ivov wrote:

···

Hi Michael,

Thanks for sharing your thoughts. Having a webstart installer would
definitely be a great thing and we are bound to put some time on it
during the following several months.

We would also be working on our own Felix launcher and I expect this to
somewhat facilitate the web start deployment issue.

Cheers
Emil

Koch Michael wrote:
  

Hi all!

This is a followup to a e-mail discussion which I had with Emil some days
ago. I wrote him that we are using Java Web Start (JWS) for our application
which embeds the SIP part of SIP Communicator. Naturally, Emil asked if this
could be used for the "standard" SIP Communicator. Unfortunately, my
approach is pretty hack-ish, so I don't think it shold be transferred as is
to the SIP Communicator project. Doing it right is pretty difficult, since
SIP Communicator uses the OSGi framework (with felix as implementation) and
its deployment and security mechanisms don't integrate naturally with the
JWS mechanisms.

Our application was using JWS before we integrated SIP Communicator, so I
had to find a way to make it work. This is how I do it:
* felix.jar is added to the JWS JNLP resources section.
* All bundle JAR files are ZIPPED into a single JAR file "sc-bundles.jar".
This file is added to the JNLP resources as well.
* the JNLP is configured to ask the user to grant the application
"all-permissions".* a custom felix launcher (which i could adapt as starting
point for issue 406) does the following:
** Find the location of the sc-bundles.jar (which JWS has downloaded) by
using Class.getResource("/protocol-sip.jar") and construct a JAR url from
it.
** replace the bundle JAR locations in felix.client.run.properties so that
they point to the bundle in sc-bundles.jar.
** set the system Policy to a policy which always gives ALL_PERMISSIONS to
all code, circumventing the felix OSGi security checks.

The drawbacks of this solution are that
* all bundle JARs are downloaded again even if only a single bundle should
change.
* the bundle JARs use twice the disk space, once in the JWS cache and once in the felix one.
* simply disabling security is not a nice thing.

If we want to make SIP Communicator launchable with JWS, I think the real way to do it would be to make felix launchable with JWS in general. I guess the way would be something like this:

* Make the felix jar and the bundle jars downloadable from the web server.
* Create a custom felix launcher JAR which contains the launcher class and a felix properties file.
** The properties file references the bundle jars by their http addresses on the web server (possibly with placeholders, so the launcher can set the server address at runtime).
* Create a JNLP file which references the custom launcher as main class and the felix jar.
* Somehow handle security gracefully (I'm not sure what that would involve).
* JWS would then download and start felix, and felix would in turn download the bundle jars and launch SIP communicator.

This is just a recording of my ideas. I won't actually have time to work on this, but if someone else would like to do it, I'd be happy to help.

Regards
Michael Koch
    
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net