Hpricot gem can't be used with JRuby 1.1RC1
-------------------------------------------

                 Key: JRUBY-2008
                 URL: http://jira.codehaus.org/browse/JRUBY-2008
             Project: JRuby
          Issue Type: Bug
          Components: Core Classes/Modules
         Environment: Latest JRuby 1.1RC1
            Reporter: Vladimir Sizikov
            Priority: Critical


Latest hpricot-java gem (ver 0.6) can't be used with JRuby 1.1 RC1, due to API 
changes caused by rev. 4588: "Vars have landed.". Basically, 
getInstanceVariable() method has been moved out of IRubyObject to RubyObject, 
and some code in hpricot gem depends on it.

Here's a simple example:

{noformat}
require 'rubygems'
require 'hpricot'
require 'open-uri'
# load the RedHanded home page
doc = Hpricot(open("http://redhanded.hobix.com/index.html";))
{noformat}

Leads to:

Exception in thread "main" java.lang.NoSuchMethodError: 
org.jruby.runtime.builtin.IRubyObject.getIns                                    
 tanceVariable(Ljava/lang/String;)Lorg/jruby/runtime/builtin/IRubyObject;
        at HpricotScanService.hpricot_scan(HpricotScanService.java:931)
        at HpricotScanService.__hpricot_scan(HpricotScanService.java:1324)
        at HpricotScanServiceInvoker$__hpricot_scan_S1.call(Unknown Source)
        at 
org.jruby.runtime.callback.InvocationCallback.execute(InvocationCallback.java:67)
        at 
org.jruby.internal.runtime.methods.FullFunctionCallbackMethod.call(FullFunctionCallbackMe
                                     thod.java:73)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:151)
        at org.jruby.runtime.CallSite$ICBlockCallSite.call(CallSite.java:190)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:658)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at 
org.jruby.evaluator.ASTInterpreter.localAsgnNode(ASTInterpreter.java:1242)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:379)
        at org.jruby.evaluator.ASTInterpreter.blockNode(ASTInterpreter.java:627)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:294)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:175)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:151)
        at org.jruby.runtime.CallSite$ICBlockCallSite.call(CallSite.java:190)
        at 
org.jruby.runtime.CallSite$ArgumentBoxingCallSite.call(CallSite.java:101)
        at 
org.jruby.evaluator.ASTInterpreter.fCallNode(ASTInterpreter.java:1096)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:346)
        at 
org.jruby.evaluator.ASTInterpreter.setupArgs(ASTInterpreter.java:2140)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:645)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:175)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:151)
        at org.jruby.runtime.CallSite$ICBlockCallSite.call(CallSite.java:190)
        at 
org.jruby.runtime.CallSite$ArgumentBoxingCallSite.call(CallSite.java:101)
        at org.jruby.evaluator.ASTInterpreter.callNode(ASTInterpreter.java:653)
        at 
org.jruby.evaluator.ASTInterpreter.evalInternal(ASTInterpreter.java:300)
        at org.jruby.evaluator.ASTInterpreter.eval(ASTInterpreter.java:168)
        at 
org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:175)
        at 
org.jruby.runtime.CallSite$InlineCachingCallSite.cacheAndCall(CallSite.java:151)
        at org.jruby.runtime.CallSite$ICNonBlockCallSite.call(CallSite.java:172)
        at 
org.jruby.runtime.CallSite$ArgumentBoxingCallSite.call(CallSite.java:101)
        at 
ruby.opt.work.samples.hpricot_minus_test_dot_rb.__file__(hpricot-test.rb:6)
        at ruby.opt.work.samples.hpricot_minus_test_dot_rb.load(hpricot-test.rb)
        at org.jruby.Ruby.runScript(Ruby.java:505)
        at org.jruby.Ruby.runNormally(Ruby.java:425)
        at org.jruby.Ruby.runFromMain(Ruby.java:305)
        at org.jruby.Main.run(Main.java:137)
        at org.jruby.Main.run(Main.java:93)
        at org.jruby.Main.main(Main.java:79)

Hpricot is a popular and important gem, explicitly supporting JRuby with 
jruby-specific gem, and it should work with JRuby 1.1.

Also, hpricot is used in rspec spec tests -- all the more reasons to properly 
support hpricot.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to