I'm writing an application in Java that uses Hadoop and is tested
with JTestr. Hadoop uses some classpath magic to find config files it
needs. I can verify that my classpath is correct, because if I make a
minimal JUnit test, everything works fine. However, when I try to do
the same thing in JTestr, I get weird exceptions, which I've tracked
down to the fact that the config files aren't being located.
Does JRuby and/or JTestR interact strangely with the classloader such
that it would interfere with finding resources on the classpath?
-Bryan
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
on 15.05.2008 20:03
on 15.05.2008 20:39
On 5/15/08, Bryan Duxbury <bryan@rapleaf.com> wrote: > I'm writing an application in Java that uses Hadoop and is tested with > JTestr. Hadoop uses some classpath magic to find config files it needs. I > can verify that my classpath is correct, because if I make a minimal JUnit > test, everything works fine. However, when I try to do the same thing in > JTestr, I get weird exceptions, which I've tracked down to the fact that the > config files aren't being located. > > Does JRuby and/or JTestR interact strangely with the classloader such that > it would interfere with finding resources on the classpath? > I'm guessing a bit here, but I have had classpath problems in JRuby when Spring tried to use the Thread's context class loader. You might try this in your before block and see if it fixes your problem: java.lang.Thread.current_thread.context_class_loader = JRuby.runtime.getJRubyClassLoader --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
on 15.05.2008 22:00
I get "uninitialized cconstant JRuby" if I try that. -Bryan
on 15.05.2008 22:09
You need: require 'jruby' Thanks, --Vladimir On Thu, May 15, 2008 at 10:00 PM, Bryan Duxbury <bryan@rapleaf.com> wrote: > I get "uninitialized cconstant JRuby" if I try that. > -Bryan > On May 15, 2008, at 11:38 AM, Tyler Jennings wrote: > > java.lang.Thread.current_thread.context_class_loader = > > JRuby.runtime.getJRubyClassLoader > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
on 15.05.2008 22:10
require 'java' first. Sorry, I skipped right over that. On 5/15/08, Bryan Duxbury <bryan@rapleaf.com> wrote: > JRuby.runtime.getJRubyClassLoader > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
on 15.05.2008 22:13
Holy crap! That makes it work. (Well, not my test, just the infrastructure parts :). Thanks to everyone who contributed. -Bryan On May 15, 2008, at 1:08 PM, Vladimir Sizikov wrote: >> On May 15, 2008, at 11:38 AM, Tyler Jennings wrote: > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email