ruby-rdf / rdf-rdfxml

Ruby RDF/XML reader/writer for RDF.rb.
http://rubygems.org/gems/rdf-rdfxml
The Unlicense
17 stars 7 forks source link

0.3.5 fails in JRuby 1.5.2 #10

Closed andyw8 closed 10 years ago

andyw8 commented 12 years ago

0.3.4 is fine but 0.3.5 fails to install:

$ gem install rdf-rdfxml -v '0.3.5' System.java:-2:in arraycopy': java.lang.ArrayIndexOutOfBoundsException from DefaultResolver.java:111:inmakeTime' from DefaultResolver.java:277:in create' from DefaultResolver.java:317:inhandleScalar' from DefaultResolver.java:435:in orgHandler' from DefaultResolver.java:455:innode_import' from org/yecht/ruby/DefaultResolver$s_method_1_0$RUBYINVOKER$node_import.gen:65535:in call' from CachingCallSite.java:146:incall' from RubyLoadHandler.java:40:in handle' from Parser.java:300:inaddNode' from DefaultYAMLParser.java:676:in yyparse' from Parser.java:290:inyechtparse' from Parser.java:284:in parse' from YParser.java:152:inload' from org/yecht/ruby/YParser$s_method_0_1$RUBYINVOKER$load.gen:65535:in call' from JavaMethod.java:630:incall' from DynamicMethod.java:186:in call' from CachingCallSite.java:309:incacheAndCall' from CachingCallSite.java:148:in call' from CallOneArgNode.java:57:ininterpret' from LocalAsgnNode.java:123:in interpret' from NewlineNode.java:104:ininterpret' from InterpretedMethod.java:180:in call' from DefaultMethod.java:172:incall' from CachingCallSite.java:309:in cacheAndCall' from CachingCallSite.java:148:incall' from CallOneArgNode.java:57:in interpret' from LocalAsgnNode.java:123:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from InterpretedMethod.java:180:in call' from DefaultMethod.java:172:incall' from CachingCallSite.java:309:in cacheAndCall' from CachingCallSite.java:148:incall' from CallOneArgNode.java:57:in interpret' from NewlineNode.java:104:ininterpret' from RescueNode.java:199:in executeBody' from RescueNode.java:118:ininterpretWithJavaExceptions' from RescueNode.java:110:in interpret' from InterpretedMethod.java:180:incall' from DefaultMethod.java:172:in call' from CachingCallSite.java:309:incacheAndCall' from CachingCallSite.java:148:in call' from FCallOneArgNode.java:36:ininterpret' from InstAsgnNode.java:95:in interpret' from NewlineNode.java:104:ininterpret' from BlockNode.java:71:in interpret' from EnsureNode.java:96:ininterpret' from BeginNode.java:83:in interpret' from NewlineNode.java:104:ininterpret' from WhenOneArgNode.java:36:in whenSlowTest' from WhenOneArgNode.java:46:inwhen' from CaseNode.java:133:in interpret' from NewlineNode.java:104:ininterpret' from InterpretedBlock.java:373:in evalBlockBody' from InterpretedBlock.java:346:inyield' from InterpretedBlock.java:303:in yield' from Block.java:194:inyield' from YieldNode.java:112:in interpret' from NewlineNode.java:104:ininterpret' from BlockNode.java:71:in interpret' from InterpretedBlock.java:373:inevalBlockBody' from InterpretedBlock.java:346:in yield' from InterpretedBlock.java:303:inyield' from Block.java:194:in yield' from RubyKernel.java:1251:inloop_1_9' from org/jruby/RubyKernel$s_method_0_0$RUBYFRAMEDINVOKER$loop_1_9.gen:65535:in call' from CachingCallSite.java:299:incacheAndCall' from CachingCallSite.java:117:in callBlock' from CachingCallSite.java:132:incallIter' from FCallNoArgBlockNode.java:32:in interpret' from NewlineNode.java:104:ininterpret' from InterpretedMethod.java:160:in call' from DefaultMethod.java:164:incall' from CachingCallSite.java:299:in cacheAndCall' from CachingCallSite.java:117:incallBlock' from CachingCallSite.java:122:in call' from CallNoArgBlockNode.java:64:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from InterpretedMethod.java:242:in call' from DefaultMethod.java:196:incall' from CachingCallSite.java:339:in cacheAndCall' from CachingCallSite.java:197:incallBlock' from CachingCallSite.java:202:in call' from RubyClass.java:815:incall' from DynamicMethod.java:194:in call' from WrapperMethod.java:62:incall' from CachingCallSite.java:329:in cacheAndCall' from CachingCallSite.java:188:incall' from FCallTwoArgNode.java:38:in interpret' from LocalAsgnNode.java:123:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from EnsureNode.java:96:in interpret' from InterpretedMethod.java:242:incall' from DefaultMethod.java:196:in call' from CachingCallSite.java:339:incacheAndCall' from CachingCallSite.java:197:in callBlock' from CachingCallSite.java:202:incall' from CallTwoArgBlockPassNode.java:62:in interpret' from NewlineNode.java:104:ininterpret' from BlockNode.java:71:in interpret' from InterpretedMethod.java:283:incall' from DefaultMethod.java:212:in call' from CachingCallSite.java:359:incacheAndCall' from CachingCallSite.java:237:in callBlock' from CachingCallSite.java:252:incallIter' from CallThreeArgBlockNode.java:64:in interpret' from NewlineNode.java:104:ininterpret' from BlockNode.java:71:in interpret' from InterpretedMethod.java:262:incall' from DefaultMethod.java:204:in call' from CachingCallSite.java:349:incacheAndCall' from CachingCallSite.java:228:in call' from FCallThreeArgNode.java:40:ininterpret' from NewlineNode.java:104:in interpret' from InterpretedBlock.java:373:inevalBlockBody' from InterpretedBlock.java:346:in yield' from InterpretedBlock.java:303:inyield' from Block.java:194:in yield' from RubyIO.java:1104:inopen' from RubyKernel.java:283:in open' from org/jruby/RubyKernel$s_method_0_2$RUBYFRAMEDINVOKER$open.gen:65535:incall' from DynamicMethod.java:198:in call' from CachingCallSite.java:339:incacheAndCall' from CachingCallSite.java:197:in callBlock' from CachingCallSite.java:212:incallIter' from FCallTwoArgBlockNode.java:34:in interpret' from NewlineNode.java:104:ininterpret' from IfNode.java:119:in interpret' from IfNode.java:119:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from InterpretedMethod.java:221:in call' from DefaultMethod.java:188:incall' from CachingCallSite.java:329:in cacheAndCall' from CachingCallSite.java:188:incall' from CallTwoArgNode.java:59:in interpret' from InstAsgnNode.java:95:ininterpret' from NewlineNode.java:104:in interpret' from RescueNode.java:199:inexecuteBody' from RescueNode.java:118:in interpretWithJavaExceptions' from RescueNode.java:110:ininterpret' from BeginNode.java:83:in interpret' from NewlineNode.java:104:ininterpret' from BlockNode.java:71:in interpret' from InterpretedMethod.java:242:incall' from DefaultMethod.java:196:in call' from CachingCallSite.java:339:incacheAndCall' from CachingCallSite.java:197:in callBlock' from CachingCallSite.java:202:incall' from RubyClass.java:815:in call' from DynamicMethod.java:194:incall' from CachingCallSite.java:329:in cacheAndCall' from CachingCallSite.java:188:incall' from CallTwoArgNode.java:59:in interpret' from DAsgnNode.java:110:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from InterpretedBlock.java:373:in evalBlockBody' from InterpretedBlock.java:346:inyield' from InterpretedBlock.java:303:in yield' from Block.java:194:inyield' from RubyArray.java:1630:in eachCommon' from RubyArray.java:1637:ineach' from org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen:65535:in call' from CachingCallSite.java:299:incacheAndCall' from CachingCallSite.java:117:in callBlock' from CachingCallSite.java:122:incall' from CallNoArgBlockNode.java:64:in interpret' from NewlineNode.java:104:ininterpret' from BlockNode.java:71:in interpret' from InterpretedMethod.java:221:incall' from DefaultMethod.java:188:in call' from CachingCallSite.java:329:incacheAndCall' from CachingCallSite.java:188:in call' from CallTwoArgNode.java:59:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from RescueNode.java:199:in executeBody' from RescueNode.java:118:ininterpretWithJavaExceptions' from RescueNode.java:110:in interpret' from BeginNode.java:83:ininterpret' from NewlineNode.java:104:in interpret' from InterpretedBlock.java:373:inevalBlockBody' from InterpretedBlock.java:346:in yield' from InterpretedBlock.java:303:inyield' from Block.java:194:in yield' from RubyArray.java:1630:ineachCommon' from RubyArray.java:1637:in each' from org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$each.gen:65535:incall' from CachingCallSite.java:299:in cacheAndCall' from CachingCallSite.java:117:incallBlock' from CachingCallSite.java:122:in call' from CallNoArgBlockNode.java:64:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from InterpretedMethod.java:139:in call' from DefaultMethod.java:156:incall' from CachingCallSite.java:289:in cacheAndCall' from CachingCallSite.java:108:incall' from VCallNode.java:85:in interpret' from NewlineNode.java:104:ininterpret' from IfNode.java:119:in interpret' from IfNode.java:119:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from InterpretedMethod.java:262:in call' from DefaultMethod.java:204:incall' from CachingCallSite.java:349:in cacheAndCall' from CachingCallSite.java:228:incall' from CallSpecialArgNode.java:71:in interpret' from NewlineNode.java:104:ininterpret' from BlockNode.java:71:in interpret' from CaseNode.java:138:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from InterpretedMethod.java:180:in call' from DefaultMethod.java:172:incall' from CachingCallSite.java:309:in cacheAndCall' from CachingCallSite.java:148:incall' from FCallOneArgNode.java:36:in interpret' from NewlineNode.java:104:ininterpret' from RescueNode.java:199:in executeBody' from RescueNode.java:118:ininterpretWithJavaExceptions' from RescueNode.java:110:in interpret' from InterpretedMethod.java:180:incall' from DefaultMethod.java:172:in call' from CachingCallSite.java:309:incacheAndCall' from CachingCallSite.java:148:in call' from CallOneArgNode.java:57:ininterpret' from NewlineNode.java:104:in interpret' from BlockNode.java:71:ininterpret' from InterpretedMethod.java:180:in call' from DefaultMethod.java:172:incall' from CachingCallSite.java:309:in cacheAndCall' from CachingCallSite.java:148:incall' from gem:25:in rescue_1$RUBY$__rescue___0' from gem:24:infile' from gem:-1:in load' from Ruby.java:685:inrunScript' from Ruby.java:568:in runNormally' from Ruby.java:414:inrunFromMain' from Main.java:286:in run' from Main.java:128:inrun' from Main.java:97:in `main'

gkellogg commented 12 years ago

I can't reproduce this particular problem using an RVM install of jruby, but I have noticed some issues with RDF.rb, rdf-rdfxml and rdf-rdfa when running specs. I'll look into those and try to get out updates to address.

I don't really see how the gem itself could cause an install problem. It would be useful to know your configuration: OS, JRuby version, etc. You might try to do clean installs of RDF gems by removing them first. Then, install rdf followed by rdf-rdfxml.

andyw8 commented 12 years ago

I tried with a clean gemset and got the same problem.

I can see the problem both in my local machine and our build server.

My local machine is Snow Leopard 10.6.8 with:

rvm 1.6.32 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/] jruby 1.5.2 (ruby 1.8.7 patchlevel 249) (2010-08-20 1c5e29d) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [x86_64-java]

gkellogg commented 12 years ago

Hmm. I'm running rvm 1.8.2 and jruby 1.6.4 on Lion. Could you try updating the versions of rvm and jruby to see if the problem persists? Like I said, they installed with no problems for me. However, I will have updates to this and some other gems (those dependent on Nokogiri) due to jruby issues, but I don't think the relate to the problem your seeing.

andyw8 commented 12 years ago

Yes it works in 1.6.4 for me too. I realise JRuby 1.5.2 is quite old, but it's used on our organisation's shared build server so upgrading it not straightforward. We can stick to 0.3.4 but perhaps a minimum JVM version check in the gem would be helpful for others who may run into this issue.

gkellogg commented 12 years ago

Investigating the gem further, it really doesn't work at all on jRuby (at least 1.6.4), so the fact that it's failing must be incidental to your application install; this is the case for RDFa and Microdata as well. Nokogiri operates substantially differently on the Java runtime, and this is creating issues that are nontrivial.

If you do depend on the gem, my only suggestion is to lock to version 0.3.4. If you can deal with a newer jRuby version, I will probably push out a version that corrects most of the reader issues, but the writer is not going to work without major surgery.

Making the readers and writers more independent of underlying XML/HTML libraries remains a long term goal, and I may have something in the relatively near term. I'll probably leverage the Haml-based writer from RDFa for RDF/XML.

gkellogg commented 12 years ago

The problem is, the gem has never been validated on jRuby, and in fact, doesn't really work. I could spend some time on it, but I haven't heard a lot of requests for jRuby support, probably because Jena is directly useable.

I'm happy to spend the time on this, and other gems, if there's interest in the user community. But otherwise, I'm more inclined to work on pure-ruby solutions, which won't be as performant, but are more likely to work across every platform.

gkellogg commented 10 years ago

Sorry for the long delay; I finally got around to re-writing the RDF/XML Writer using Nokogiri, based on the RDFa Writer; it now works across all Ruby engines.