Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with schema validation under JRuby #862

Closed
exupero opened this issue Mar 13, 2013 · 8 comments
Closed

Error with schema validation under JRuby #862

exupero opened this issue Mar 13, 2013 · 8 comments

Comments

@exupero
Copy link

exupero commented Mar 13, 2013

I'm having a problem with loading this schema under JRuby.

When I try it with MRI, all appears well:

$ rvm use ruby
$ irb
1.9.3p327 :001 > require 'nokogiri'
 => true 
1.9.3p327 :002 > Nokogiri::XML::Schema(IO.read('saml20protocol_schema.xsd'))
 => #<Nokogiri::XML::Schema:0x007fcb41020350> 

Whereas JRuby experiences the following error:

$ rvm use jruby
$ irb
irb(main):001:0> require 'nokogiri'
=> true
irb(main):002:0> Nokogiri::XML::Schema(IO.read('saml20protocol_schema.xsd'))
RuntimeError: Could not parse document: src-resolve: Cannot resolve the name 'ds:Signature' to a(n) 'element declaration' component.
        from nokogiri/XmlSchema.java:143:in `from_document'
        from ~/.rvm/gems/jruby-1.7.0/gems/nokogiri-1.5.6-java/lib/nokogiri/xml/schema.rb:37:in `new'
        from ~/.rvm/gems/jruby-1.7.0/gems/nokogiri-1.5.6-java/lib/nokogiri/xml/schema.rb:8:in `Schema'
        from (irb):2:in `evaluate'
        from org/jruby/RubyKernel.java:1065:in `eval'
        from org/jruby/RubyKernel.java:1390:in `loop'
        from org/jruby/RubyKernel.java:1173:in `catch'
        from org/jruby/RubyKernel.java:1173:in `catch'
        from ~/.rvm/rubies/jruby-1.7.0/bin/irb:13:in `(root)'
@tamersalama
Copy link

I can confirm the issue here too (JRuby 1.7.3, Nokogiri 1.5.9 java, WinXP).

@tamersalama
Copy link

Apparently, the issue might've been resolved in 1.6.0 branch two years ago but not yet released (here and c37d71e)

@tamersalama
Copy link

This issue might be two folds:

  • Schema imports (which might've been fixed with this commit c37d71e)
  • Doctype vs DTD fixed with this commit patcheng@cd9824b

What I had to do is:

  • Download and use the 1.6.0 rc (includes the commit c37d71e)
  • Manually apply the modifications from the commit patcheng@cd9824b and rebuild the lib/nokogiri/nokogiri.jar file

@patcheng
Copy link

patcheng commented Jun 3, 2013

#912 has the same test. And @injekt just merged the pull request. @exupero, maybe this issue can be closed?

@flavorjones
Copy link
Member

Can someone confirm whether this issue can be closed? I saw a lot of activity on a few other threads around this issue.

@exupero
Copy link
Author

exupero commented Jun 5, 2013

Thanks for all the work. I'll look into whether the fix works for me.

@pebrinic
Copy link

pebrinic commented Jun 5, 2013

Would you guys be able to cut a new RC with this change? Thanks for fixing it!

@flavorjones
Copy link
Member

1.5.10 will be released later today with this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants