while I was working on Glassfish Gem issue 24787
(http://rubyforge.org/tracker/index.php?func=detail&aid=24787&group_id=5450&atid=21080),
I think I've narrowed it down to an issue with changing the load_path
for embedded instances of Jruby.
In the first (working) case, of mongrel + Jruby,
RAILS_ROOT/app/models/subfo ends up in config.load_paths. $LOAD_PATH
ends up having some of the rails stuff (/app, /app/controllers,
/app/models, etc.), but not /app/models/subfo. Nevertheless, when rails
needs to, it loads the file in /app/models/subfo, the directory gets
added to $LOAD_PATH and the file loads (confirmed by outputting
$LOAD_PATH both before and after post.rb is loaded).
In the second (non-working) case, of Glassfish Gem,
RAILS_ROOT/app/models/subfo ends up in config.load_paths, the same as
with mongrel. $LOAD_PATH is slightly different, but it looks like it's
mostly related to not having loaded mongrel. However, when rails needs
to load post.rb, it fails with a NameError rather than loading the file.
I also tried to manually add app/models/subfo to $LOAD_PATH using
$LOAD_PATH << ["#{RAILS_ROOT}/app/models/subfo"]. Though this seemed to
work (showed up in $LOAD_PATH), it still throws the NameError as if
/app/models/subfo wasn't on the load path. That might well be because I
need to be modifying some other underlying variable rather than $LOAD_PATH
The issue, then, seems to come down to an issue with modifying the load
path when Jruby is embedded, rather than when it isn't. However, since
I'm not really familiar with how Jruby does loading (and at some level,
it must work, since rails stuff shows up on the load path and works):
Does this look like a Jruby issue to other people? What else should I
try to confirm/deny/work around this?
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email