Should I be able to access compiled Groovy classes from JRuby?

Nevermind the perversity of the question. Shouldn’t it be possible?

If Groovy compiles to bytecode, why can’t I use the class from JRuby?
In
the jar I’ve included, I can access all of the Java classes, but none of
the
Groovy classes. When I try in JIRB, it says:

NameError: cannot link Java class com.greymatter.SoapInvoker
from C:/sw/jruby/lib/ruby/1.8/irb/ruby-token.rb:102:in
method_missing' from (irb):15:in binding’
from C:/sw/jruby/lib/ruby/1.8/irb/workspace.rb:53:in eval' from C:/sw/jruby/lib/ruby/1.8/irb/workspace.rb:81:in evaluate’
from C:/sw/jruby/lib/ruby/1.8/irb/context.rb:219:in evaluate' from C:/sw/jruby/lib/ruby/1.8/irb.rb:150:in eval_input’
from C:/sw/jruby/lib/ruby/1.8/irb.rb:259:in signal_status' from C:/sw/jruby/lib/ruby/1.8/irb.rb:147:in eval_input’
from C:/sw/jruby/lib/ruby/1.8/irb/ruby-lex.rb:244:in
each_top_level_statement' from C:/sw/jruby/lib/ruby/1.8/irb/ruby-lex.rb:230:in loop’
from C:/sw/jruby/lib/ruby/1.8/irb/ruby-lex.rb:230:in
each_top_level_statement' from C:/sw/jruby/lib/ruby/1.8/irb/ruby-lex.rb:229:in catch’
from C:/sw/jruby/lib/ruby/1.8/irb/ruby-lex.rb:229:in
each_top_level_statement' from C:/sw/jruby/lib/ruby/1.8/irb.rb:146:in eval_input’
from C:/sw/jruby/lib/ruby/1.8/irb.rb:70:in start' from C:/sw/jruby/lib/ruby/1.8/irb.rb:69:in catch’
from C:/sw/jruby/lib/ruby/1.8/irb.rb:69:in `start’
from c:\sw\jruby\bin\jirb_swing:60Maybe IRB bug!!
irb(main):015:0>

(In case you’re wondering, I’m doing this because I can’t seem to get
soap4r
to work, while it all works easily from Groovy. If whytheluckystiff
used
SOAP, I’m sure we’d have a great solution for calling SOAP from Ruby –
with
great documentation!)

Thanks,
Lee

View this message in context:
http://www.nabble.com/Should-I-be-able-to-access-compiled-Groovy-classes-from-JRuby--tp19673748p19673748.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

If Groovy compiles to bytecode, why can’t I use the class from JRuby? In
the jar I’ve included, I can access all of the Java classes, but none of the
Groovy classes. When I try in JIRB, it says:

NameError: cannot link Java class com.greymatter.SoapInvoker

have you double checked that you’re requiring all the jar’s
dependencies?

i ask because just a few days ago i was experimenting with
stringtemplate in groovy but had problems in jruby. the issue was that
groovy already had stringtemplate’s antlr.jar dependency as part of its
runtime and i “forgot” to require antlr.jar when i experimented from
jruby. i got a NameError…your situation sounds a bit too familiar…


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thank you, Jon! You were right. All I had to do was require all the
jars in
~/.groovy/lib, and it all worked as expected.

Thanks for your great advice!

BTW, that’s a terribly weak error message. There really ought to be
more
information than that. At least what name caused the NameError.

–Lee

Jon M wrote:

have you double checked that you’re requiring all the jar’s dependencies?

i ask because just a few days ago i was experimenting with stringtemplate
in groovy but had problems in jruby. the issue was that groovy already
had stringtemplate’s antlr.jar dependency as part of its runtime and i
“forgot” to require antlr.jar when i experimented from jruby. i got a
NameError…your situation sounds a bit too familiar…


View this message in context:
http://www.nabble.com/Should-I-be-able-to-access-compiled-Groovy-classes-from-JRuby--tp19673748p19689290.html
Sent from the JRuby - User mailing list archive at Nabble.com.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email