[jruby] A couple of odd JRuby 1.7.24 issues on Windows - REXML bad encoding and EBADF

Kimpton, C (Chris) Chris.Kimpton at rabobank.com
Thu Jan 28 20:14:26 JST 2016


Hi,

Since switching to 1.7.24 (from 1.7.23), I am seeing a couple of odd issues.

Running on Windows with JDK 1.7.0_80-b15.

ISSUE 1: REXML Bad encoding issue

Getting intermittent (1 out of 10) failures on this line.

xml = REXML::Document.new(req.body)


10:50:58:115|2047-00060:TH21 ERROR: #<ArgumentError: Bad encoding name utf-8>
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/encoding.rb:11:in `encoding='
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/source.rb:55:in `encoding='
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/parsers/baseparser.rb:215:in `pull_event'
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/parsers/baseparser.rb:183:in `pull'
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/parsers/treeparser.rb:22:in `parse'
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/document.rb:249:in `build'
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/rexml/document.rb:43:in `initialize'
C:/rbidev/IonPlatformPostMerge/config/RaboWriter/integration_tests/tests/mock_shareco/mock_shareco_webservice.rb:94:in `handle_bond'
C:/rbidev/IonPlatformPostMerge/config/RaboWriter/integration_tests/tests/mock_shareco/mock_shareco_webservice.rb:20:in `service'
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/webrick/httpserver.rb:138:in `service'
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/webrick/httpserver.rb:94:in `run'
/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/1.9/webrick/server.rb:191:in `start_thread'
...
Bad encoding name utf-8
Line: 1
Position: 40
Last 80 unconsumed characters:

This is the XML sent - largely the same as the other 9 times when it does work ok.

10:50:58:115|0313-00060:TH21 INFO: <?xml version="1.0" encoding="utf-8" ?>
<bond><exchange>186</exchange><isin>XSA3</isin><sequenceNumber>1453978215004</sequenceNumber><ohlc><high>102.03</high><close>102.03</close><recentPrice>102.03</recentPrice><recentPriceDatetime>2016-01-28T12:12:03Z</recentPriceDatetime></ohlc></bond>


ISSUE 2: EBADF Bad file descriptor issue.

On this line - a global constant is defined via the call to a function that returns a string.  There is an identical call to the same method that is done in the parent class (run_integration_tests.rb, line 112)


FIX_MESSAGE_FILE = EmarketsCheckAdaptor::EmarketsFixConfig::fix_data_dictionary_file

If I move the constant into a class, it does not have a problem.  Looks like I am no longer allowed to redefine constants :(.

10:53:38:332|0091-00038:TH3 ERROR: RunIntegrationTests:Errno::EBADF:Bad file descriptor - Bad file descriptor
10:53:38:333|0053-00038:TH3 INFO: org/jruby/RubyIO.java:1411:in `write'
10:53:38:333|0134-00038:TH3 INFO: C:/rbidev/IonPlatformPostMerge/config/RaboWriter/integration_tests/tests/test_emarkets_check_adaptor.rb:23:in `(root)'
10:53:38:333|0059-00038:TH3 INFO: org/jruby/RubyKernel.java:1040:in `require'
10:53:38:333|0196-00038:TH3 INFO: /C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/META-INF/jruby.home/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:54:in `require'
10:53:38:333|0152-00038:TH3 INFO: file:/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/jruby/kernel19/kernel.rb:1:in `(root)'
10:53:38:333|0163-00038:TH3 INFO: file:/C:/Users/kimptonc/.m2/repository/org/jruby/jruby-complete/1.7.24/jruby-complete-1.7.24.jar!/jruby/kernel19/kernel.rb:13:in `require_relative'
10:53:38:333|0053-00038:TH3 INFO: org/jruby/RubyProc.java:281:in `call'
10:53:38:333|0123-00038:TH3 INFO: C:/rbidev/IonPlatformPostMerge/config/RaboWriter/integration_tests/run_integration_tests.rb:113:in `(root)'


_________________________________________________________________________________

This email (including any attachments to it) is confidential, legally privileged, subject to copyright and is sent for the personal attention of the intended recipient only. If you have received this email in error, please advise us immediately and delete it. You are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. Although we have taken reasonable precautions to ensure no viruses are present in this email, we cannot accept responsibility for any loss or damage arising from the viruses in this email or attachments. We exclude any liability for the content of this email, or for the consequences of any actions taken on the basis of the information provided in this email or its attachments, unless that information is subsequently confirmed in writing. 
_________________________________________________________________________________
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ruby-lang.org/pipermail/jruby/attachments/20160128/3a3310be/attachment.html>


More information about the JRuby mailing list