JRuby

OSGify jruby.jar in the release jruby distribution

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: JRuby 1.1.3
  • Fix Version/s: JRuby 1.1.4
  • Component/s: None
  • Labels:
    None
  • Environment:
    generic
  • Patch Submitted:
    Yes
  • Number of attachments :
    4

Description

GlassFish v3 is OSGi aware and at runtime needs the jruby runtime as available in installed jruby distributions. Since jruby.jar available at $JRUBY_HOME/lib/jruby.jar it fails to work.

This is critical for us and the only possible solution is to OSGify jruby.jar. I am submitting a patch that uses Bnd utility to wrap the jruby.jar - basically adds correct Export-Package and Import-Package and some other OSGi specific headers.

This patch expects bnd.jar to be available at build_lib. bnd.jar can be obtained from http://www.aqute.biz/repo/biz/aQute/bnd/0.0.249/bnd-0.0.249.jar

  1. build.xml.diff
    02/Jul/08 7:34 PM
    1 kB
    Vivek Pandey
  2. jruby-osgi.patch
    06/Aug/08 7:46 AM
    2 kB
    Hendy Irawan
  3. jruby-osgi-2.patch
    06/Aug/08 8:15 AM
    2 kB
    Hendy Irawan
  4. jruby-osgi-properties.bnd
    02/Jul/08 7:34 PM
    0.2 kB
    Vivek Pandey

Activity

Hide
Charles Oliver Nutter added a comment -

Apply for 1.1.3. Pretty innocuous.

Show
Charles Oliver Nutter added a comment - Apply for 1.1.3. Pretty innocuous.
Hide
Morten Christensen added a comment -

Great!

Show
Morten Christensen added a comment - Great!
Hide
Charles Oliver Nutter added a comment -

Applied in r7188.

Show
Charles Oliver Nutter added a comment - Applied in r7188.
Hide
Charles Oliver Nutter added a comment -

Houston, we have a problem.

After applying the OSGI changes, it appears our spec runs have started to fail. "rake spec:ji" runs a small portion of the main build and then executes JRuby against a bunch of java integraiton specs. However with the OSGI changes, we get a class not found exception looking for MainExitException.

The primary thing I noticed is that the bnd runs every time we do a build, and many (most?) of those times we already have an existing JAR we're updating. Is it possible that repeat bnd against an updated jar could be causing some kind of problems?

I know nothing about bnd and we've got 1.1.3 supposed to go out in a day or two, so unfortunately I'm going to have to revert this. If you can come up with a modification and explanation that allows ant test and rake spec:ji to execute correctly, we can probably get it back in.

Show
Charles Oliver Nutter added a comment - Houston, we have a problem. After applying the OSGI changes, it appears our spec runs have started to fail. "rake spec:ji" runs a small portion of the main build and then executes JRuby against a bunch of java integraiton specs. However with the OSGI changes, we get a class not found exception looking for MainExitException. The primary thing I noticed is that the bnd runs every time we do a build, and many (most?) of those times we already have an existing JAR we're updating. Is it possible that repeat bnd against an updated jar could be causing some kind of problems? I know nothing about bnd and we've got 1.1.3 supposed to go out in a day or two, so unfortunately I'm going to have to revert this. If you can come up with a modification and explanation that allows ant test and rake spec:ji to execute correctly, we can probably get it back in.
Hide
Charles Oliver Nutter added a comment -

Even worse, under soylatte (JDK6 port for OS X) the OSGI changes appear to cause segfaults somewhere in libzip. Double ouch. Might be good to contact us on IM or IRC as soon as possible, or this isn't going to make 1.1.3.

Show
Charles Oliver Nutter added a comment - Even worse, under soylatte (JDK6 port for OS X) the OSGI changes appear to cause segfaults somewhere in libzip. Double ouch. Might be good to contact us on IM or IRC as soon as possible, or this isn't going to make 1.1.3.
Hide
Thomas E Enebo added a comment -

Bump until we can solve the two issues cited above.

Show
Thomas E Enebo added a comment - Bump until we can solve the two issues cited above.
Hide
Hendy Irawan added a comment -

The patch seems to use Bnd to wrap the jar generated by Ant.

There are other alternatives:
1. Use Bnd itself to generate the JAR
2. Use Bnd to generate the MANIFEST.MF first, then use Ant jar task to include that Bnd-generated manifest

The "safest" way for now is option #2, which I think is enough for most purposes... although it's not "clean" i.e. it's not the Bnd intended way of life.

After tests pass again etc. option #1 can be used.

Option #3 is the best actually: Use Maven build system and maven-bundle-plugin

I'll try to help solve this bug.

Show
Hendy Irawan added a comment - The patch seems to use Bnd to wrap the jar generated by Ant. There are other alternatives: 1. Use Bnd itself to generate the JAR 2. Use Bnd to generate the MANIFEST.MF first, then use Ant jar task to include that Bnd-generated manifest The "safest" way for now is option #2, which I think is enough for most purposes... although it's not "clean" i.e. it's not the Bnd intended way of life. After tests pass again etc. option #1 can be used. Option #3 is the best actually: Use Maven build system and maven-bundle-plugin I'll try to help solve this bug.
Hide
Charles Oliver Nutter added a comment -

Thanks in advance for your help Hendy. Hopefully we can get this back in for JRuby 1.1.4 in the next couple weeks.

Show
Charles Oliver Nutter added a comment - Thanks in advance for your help Hendy. Hopefully we can get this back in for JRuby 1.1.4 in the next couple weeks.
Hide
Hendy Irawan added a comment -

Thanks Charles.

This is a(nother) patch to JRuby trunk to OSGi-fy it.

This patch is very similar to previous patch, I simply reorders it and tweak the manifest a bit.

Apart from the patch, it also needs http://www.aqute.biz/repo/biz/aQute/bnd/0.0.249/bnd-0.0.249.jar downloaded into "build_lib"

In my system all JRuby tests still pass (ant test) and I also made sure that it actually works inside OSGi by creating a test project here:

https://scm.ops4j.org/repos/ops4j/laboratory/users/ceefour/jruby-test/

(login as anonymous)

To use my jruby-test, after checking out the project run "mvn install pax:provision"
(you need to have Maven installed)

Show
Hendy Irawan added a comment - Thanks Charles. This is a(nother) patch to JRuby trunk to OSGi-fy it. This patch is very similar to previous patch, I simply reorders it and tweak the manifest a bit. Apart from the patch, it also needs http://www.aqute.biz/repo/biz/aQute/bnd/0.0.249/bnd-0.0.249.jar downloaded into "build_lib" In my system all JRuby tests still pass (ant test) and I also made sure that it actually works inside OSGi by creating a test project here: https://scm.ops4j.org/repos/ops4j/laboratory/users/ceefour/jruby-test/ (login as anonymous) To use my jruby-test, after checking out the project run "mvn install pax:provision" (you need to have Maven installed)
Hide
Hendy Irawan added a comment -

This is an updated patch which also exports org.jruby.internal

Previously I didn't export this, but I also want to modify the jruby engine at JSR223, and the JRuby JSR223 engine uses org.jruby.internal package so I have to export it too. Besides it might be useful for other people.

Show
Hendy Irawan added a comment - This is an updated patch which also exports org.jruby.internal Previously I didn't export this, but I also want to modify the jruby engine at JSR223, and the JRuby JSR223 engine uses org.jruby.internal package so I have to export it too. Besides it might be useful for other people.
Hide
Thomas E Enebo added a comment -

We have a new patch and people want this.

Show
Thomas E Enebo added a comment - We have a new patch and people want this.
Hide
Hendy Irawan added a comment -
Show
Hendy Irawan added a comment - Parallel work at JSR223: https://scripting.dev.java.net/issues/show_bug.cgi?id=37
Hide
Hendy Irawan added a comment -

Another test is available to demonstrate jruby and jsr223-jruby in OSGi working properly.

The JSR223 for JRuby is already updated in JSR223 CVS (see https://scripting.dev.java.net/issues/show_bug.cgi?id=37 ), however we'll need to wait JSR223 team to release the updated JARs.

Test project available at (SVN):

https://scm.ops4j.org/repos/ops4j/laboratory/users/ceefour/jruby-jsr223-test

To test:

mvn install pax:provision

The required dependencies (jsr223-jruby, jruby) must be available in your local Maven repo.

Show
Hendy Irawan added a comment - Another test is available to demonstrate jruby and jsr223-jruby in OSGi working properly. The JSR223 for JRuby is already updated in JSR223 CVS (see https://scripting.dev.java.net/issues/show_bug.cgi?id=37 ), however we'll need to wait JSR223 team to release the updated JARs. Test project available at (SVN): https://scm.ops4j.org/repos/ops4j/laboratory/users/ceefour/jruby-jsr223-test To test: mvn install pax:provision The required dependencies (jsr223-jruby, jruby) must be available in your local Maven repo.
Hide
Thomas E Enebo added a comment -

Fixed in commit 7437. I applied the latest patch and it seems to work after being bundled via 'ant dist'. I also updated our poms to reflect bnd as a build dependency. I did not test this, but as I have some other heinious maven work before 1.1.4 release I will deal with any mistakes then.

Show
Thomas E Enebo added a comment - Fixed in commit 7437. I applied the latest patch and it seems to work after being bundled via 'ant dist'. I also updated our poms to reflect bnd as a build dependency. I did not test this, but as I have some other heinious maven work before 1.1.4 release I will deal with any mistakes then.

People

Vote (1)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: