On Sun, 20 Jun 2004, Steve Drach defenestrated me: > > > > Well one way is to create a 'java_alias' ala: > > > >java_alias :JFile, :File > > > > then use 'JFile.new "/etc/blah"' > > Ok, I think I understand. It's because the constant File was already > defined to be the org.jruby.RubyFile class. Is that correct? And > java_alias just deals with Java constants? Is that why alias wouldn't > work, since it would have aliased the RubyFile to JFile? It's all > a little subtle for me. yep. I was not the designer of the java integration so I can only make an educated guess, but I think a decision was made to lazily load classes from an imported package when they are actually used. It implements this via const_missing. Obviously, for File, const_missing is never fired, so I think they made java_alias as a way around this problem. I sent some more thoughts on this to jruby-dev last night. Any continued conversation about this should probably continue there. > In any case, it seems to work, and both File and SAXBuilder are > the correctly scoped type (symbol?) now. However it now fails > mysteriously, not telling me which method is missing: In the current CVS tree I think this problem is fixed (along with many others). I tried running your script (using another xml file) and I did not get your error (no news is good news? :)). A problem was corrected where it was not properly finding the correct overloaded method in a java class. SaxBuiler.build has a about thousand versions, so I am guessing it has tripped over that bug. -Tom PS- Could you send any other jruby questions to jruby-user or jruby-dev (hosted by sourceforge)? It will make jruby not look so dead :) -- + http://www.tc.umn.edu/~enebo +---- mailto:enebo / acm.org ----+ | Thomas E Enebo, Protagonist | "A word is worth a thousand | | | pictures" -Bruce Tognazzini |