dev@glassfish.java.net

Re: GlassFish gem feature requests/bugs

From: Charles Oliver Nutter <charles.nutter_at_sun.com>
Date: Wed, 12 Sep 2007 19:22:19 -0500

Jerome Dochez wrote:
> Charles
>
> I spent more time debugging this on mac os x and windows and I have to
> say that I am now quite confused about jruby behaviour.
>
> On the mac, jruby seems to do the right thing, consistent with the code
> you proposed below, whereas the parent class loader of gfv3 is a
> JRubyClassLoader with 1 jar file in the classpath :
> glassfish-10.0-SNAPSHOT. The parent class loader of that one is the
> AppClassLoader for jruby which contains all the .jar files in the jruby
> lib directory.
>
> However on windows, the situation is quite different. The parent class
> loader of gfv3 is directly the AppClassLoader for jruby not only
> including the .jar files in the jruby lib directory but also including
> all the .jar located in the glassfish lib installed gem like I described
> below.
>
> This is the exact same gem I installed on mac and windows, I am using
> jruby rev 4201 (1.0.1) on both machines. On Mac OS, this is jdk 5, on
> Windows, this is JDK 6.
>
> Can you shed some light on what may cause this behaviour difference ?

I have no clue. JRuby starts up its own classloader that allows loading
jars at runtime. Under all platforms, it should use that classloader to
load any jars loaded with 'require'. Can you confirm that all the files
from both installations match?

There is one possible issue...the .bat file for starting up JRuby on
Windows could be broken and including not just the files immediately
under /lib, but all jar files found anywhere under lib. I know nothing
about .bat scripting, so we'd need to find someone familiar with it to
investigate that angle.

Either way, it's sounding like a bug. If you can confirm the files are
the same on both platforms, go ahead and report this as a JRuby issue to
be tracked.

http://jira.codehaus.org/browse/JRUBY

- Charlie