JRuby

new samples/jnlp dir: includes both unsigned and signed examples that work in Java 1.5 and 1.6

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1
  • Fix Version/s: JRuby 1.2
  • Component/s: Miscellaneous
  • Labels:
    None
  • Number of attachments :
    2

Description

I've attached a tar.gz to this issue which when extracted in samples/ adds s both unsigned and signed examples that work in Java 1.5 and 1.6.

[~/dev/jruby_trunk/jruby/samples]$ ls -l jnlp
total 48
-rw-r--r--   1 stephen  stephen  1117 Jan 25 10:57 README
-rw-r--r--   1 stephen  stephen   773 Jan 25 10:44 build.xml
-rw-r--r--   1 stephen  stephen   869 Jan 25 10:09 jirb.jnlp
-rw-r--r--   1 stephen  stephen  1269 Jan 25 10:20 jnlp-sample-keystore
lrwxr-xr-x   1 stephen  stephen     9 Jan 25 10:05 lib -> ../../lib
drwxr-xr-x   2 stephen  stephen    68 Jan 25 10:59 signed-jars
-rw-r--r--   1 stephen  stephen   828 Jan 25 10:52 signed-jirb.jnlp

This is what is contained in the README:

There are two sample Java Web Start jnlp files in this directory for starting JRuby and displaying an IRB Console.

1. jirb.jnlp

jirb.jnlp uses an unsigned version of the jruby-complete.jar and is run with the standard minimal security permissions that Java Web Start assigns to an untrusted Web Start application. For example while running this version you won't be able to read or write to local directories.

Running jirb.jnlp:

  javaws jirb.jnlp

2. signed-jirb.jnlp uses a signed version of the jruby-complete.jar and includes this declaration in the jnlp:

  <security>
    <all-permissions/>
  </security>
  
This signed version of jirb.jnlp should be able to do almost anything on your local computer.

Before running signed-jirb.jnlp sign and copy jruby-complete.jar with this ant task:

  ant sign-jar
  
Running signed-jirb.jnlp:

  javaws signed-jirb.jnlp


The keystore and certificate used for signing jruby-complete.jar wer created like this:

  keytool -genkey -keystore jnlp-sample-keystore -alias jnlp-sample-keystore
  keytool -selfcert -alias jnlp-sample-keystore -keystore jnlp-sample-keystore

Activity

Hide
Stephen Bannasch added a comment -

I don't have a Windows system and the attached patch uses a symbolic link to create a local directory reference in the new jnlp dir to $JRUBY_HOME/lib. I'm not sure what is the best strategy for accomplishing this on Windows.

Show
Stephen Bannasch added a comment - I don't have a Windows system and the attached patch uses a symbolic link to create a local directory reference in the new jnlp dir to $JRUBY_HOME/lib. I'm not sure what is the best strategy for accomplishing this on Windows.
Hide
Charles Oliver Nutter added a comment -

Update samples for RC2.

Show
Charles Oliver Nutter added a comment - Update samples for RC2.
Hide
Charles Oliver Nutter added a comment -

Punting issues from 1.1 RC2 to 1.1 final.

Show
Charles Oliver Nutter added a comment - Punting issues from 1.1 RC2 to 1.1 final.
Hide
Thomas E Enebo added a comment -

Stephen, I am resolving this but not because we do not want the samples. Here is the idea. You create a wiki entry for working with JNLP with the samples attached. If our wiki is incapable or attachments then we can add them to our of our file areas on our website (we can coordinate this on channel). As far as having an example in the distro samples/jirb.jnp already exists (which is basically half you attachment); So we have something in the distro too.

Feel free to reopen if this resolution sucks.

Show
Thomas E Enebo added a comment - Stephen, I am resolving this but not because we do not want the samples. Here is the idea. You create a wiki entry for working with JNLP with the samples attached. If our wiki is incapable or attachments then we can add them to our of our file areas on our website (we can coordinate this on channel). As far as having an example in the distro samples/jirb.jnp already exists (which is basically half you attachment); So we have something in the distro too. Feel free to reopen if this resolution sucks.
Hide
Stephen Bannasch added a comment -

The sample included with the distribution now does not work in Java 1.5 because relative paths don't work with javaws in Java 1.5.

If my extended sample was in the distribution I think more people would try it and I'd like more people trying to use web start and JRuby – because they'd help me find and fix more bugs.

That being said – it's not a big problem for me to put this on the wiki – I can reference the existing the JIRA attachment from the wiki page.

Show
Stephen Bannasch added a comment - The sample included with the distribution now does not work in Java 1.5 because relative paths don't work with javaws in Java 1.5. If my extended sample was in the distribution I think more people would try it and I'd like more people trying to use web start and JRuby – because they'd help me find and fix more bugs. That being said – it's not a big problem for me to put this on the wiki – I can reference the existing the JIRA attachment from the wiki page.
Hide
Thomas E Enebo added a comment -

Ok. I think we should at least fix up the current samples if not include both now....but punting until we can get resolution on how to replace the symlink since that will not work on Windows.

Show
Thomas E Enebo added a comment - Ok. I think we should at least fix up the current samples if not include both now....but punting until we can get resolution on how to replace the symlink since that will not work on Windows.
Hide
Stephen Bannasch added a comment -

Updated archive of unsigned and signed jnlp samples. This dir is meant to be committed into samples/

I removed the symbolic link to ../../lib/

Show
Stephen Bannasch added a comment - Updated archive of unsigned and signed jnlp samples. This dir is meant to be committed into samples/ I removed the symbolic link to ../../lib/
Hide
Stephen Bannasch added a comment -

I cleaned up and simplified the earlier work. There is a new attachment: jnlp.tar.gz. I deleted the older attachment.

However in testing this I found a new JRuby Java Web Start bug when running an unsigned web start app. Reported here: JRUBY-2291.

Show
Stephen Bannasch added a comment - I cleaned up and simplified the earlier work. There is a new attachment: jnlp.tar.gz. I deleted the older attachment. However in testing this I found a new JRuby Java Web Start bug when running an unsigned web start app. Reported here: JRUBY-2291.
Hide
Stephen Bannasch added a comment -

Are you interested in including these samples?

I haven't tested it with recent releases. If you are interested I'll take a look at updating it.

I'm sure there are many bits that could be improved.

Show
Stephen Bannasch added a comment - Are you interested in including these samples? I haven't tested it with recent releases. If you are interested I'll take a look at updating it. I'm sure there are many bits that could be improved.
Hide
Charles Oliver Nutter added a comment -

Yes!

Show
Charles Oliver Nutter added a comment - Yes!
Hide
Stephen Bannasch added a comment -

simplified patch for adding jnlp dir to samples

tested with

  • jruby svn rev: 8463
  • MacOS X 10.5.6
  • Java 1.5.0_16
Show
Stephen Bannasch added a comment - simplified patch for adding jnlp dir to samples tested with
  • jruby svn rev: 8463
  • MacOS X 10.5.6
  • Java 1.5.0_16
Hide
Stephen Bannasch added a comment -

added missing sentence fragment in README

Show
Stephen Bannasch added a comment - added missing sentence fragment in README
Hide
Charles Oliver Nutter added a comment -

Awesome Stephen, thank you very much! Applied in 8486.

Show
Charles Oliver Nutter added a comment - Awesome Stephen, thank you very much! Applied in 8486.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: