Issue Details (XML | Word | Printable)

Key: JRUBY-2741
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Thomas E Enebo
Reporter: Vivek Pandey
Votes: 1
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
JRuby

OSGify jruby.jar in the release jruby distribution

Created: 02/Jul/08 07:34 PM   Updated: 10/Sep/08 06:44 PM   Resolved: 11/Aug/08 04:04 PM
Return to search
Component/s: None
Affects Version/s: JRuby 1.1.3
Fix Version/s: JRuby 1.1.4

Time Tracking:
Not Specified

File Attachments: 1. File build.xml.diff (1 kB)
2. Text File jruby-osgi-2.patch (2 kB)
3. File jruby-osgi-properties.bnd (0.2 kB)
4. Text File jruby-osgi.patch (2 kB)

Environment: generic

Patch Submitted: Yes


 Description  « Hide

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



Charles Oliver Nutter added a comment - 02/Jul/08 07:57 PM

Apply for 1.1.3. Pretty innocuous.


Morten Christensen added a comment - 03/Jul/08 05:56 PM

Great!


Charles Oliver Nutter added a comment - 16/Jul/08 03:07 AM

Applied in r7188.


Charles Oliver Nutter made changes - 16/Jul/08 03:07 AM
Field Original Value New Value
Assignee Thomas E Enebo [ enebo ] Charles Oliver Nutter [ headius ]
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Charles Oliver Nutter added a comment - 17/Jul/08 04:04 AM

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.


Charles Oliver Nutter made changes - 17/Jul/08 04:04 AM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Charles Oliver Nutter added a comment - 17/Jul/08 04:28 AM

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.


Thomas E Enebo added a comment - 17/Jul/08 09:08 PM

Bump until we can solve the two issues cited above.


Thomas E Enebo made changes - 17/Jul/08 09:08 PM
Fix Version/s JRuby 1.1.3 [ 14342 ]
Fix Version/s JRuby 1.1+ [ 13421 ]
Hendy Irawan added a comment - 03/Aug/08 08:21 PM

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.


Charles Oliver Nutter added a comment - 04/Aug/08 12:43 AM

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


Hendy Irawan added a comment - 06/Aug/08 07:46 AM

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)


Hendy Irawan made changes - 06/Aug/08 07:46 AM
Attachment jruby-osgi.patch [ 36351 ]
Hendy Irawan added a comment - 06/Aug/08 08:15 AM

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.


Hendy Irawan made changes - 06/Aug/08 08:15 AM
Attachment jruby-osgi-2.patch [ 36352 ]
Thomas E Enebo added a comment - 06/Aug/08 10:21 AM

We have a new patch and people want this.


Thomas E Enebo made changes - 06/Aug/08 10:21 AM
Fix Version/s JRuby 1.1+ [ 13421 ]
Fix Version/s JRuby 1.1.4 [ 14457 ]
Hendy Irawan added a comment - 06/Aug/08 03:17 PM

Hendy Irawan added a comment - 06/Aug/08 03:43 PM

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.


Thomas E Enebo added a comment - 11/Aug/08 04:04 PM

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.


Thomas E Enebo made changes - 11/Aug/08 04:04 PM
Assignee Charles Oliver Nutter [ headius ] Thomas E Enebo [ enebo ]
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]
Charles Oliver Nutter made changes - 10/Sep/08 06:44 PM
Status Resolved [ 5 ] Closed [ 6 ]