dev@glassfish.java.net

Re: GlassFish gem feature requests/bugs

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Thu, 13 Sep 2007 11:22:38 -0700

Charles Oliver Nutter wrote:
> 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.

good guess...

you do a for /r which cause the entire tree of directory to be parsed

if you replace

for /r "%JRUBY_HOME%\lib" %%i in (*.jar) do @call "%~dp0_jrubysetcp" %%i
with
for %%i in ("%JRUBY_HOME%\lib"\*.jar) do @call "%~dp0_jrubysetcp" %%i

in _jrubyvars.bat

it works as expected...

I will file a bug and provide my 2c solution.

jerome
>
> 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
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>