[ANN] JRuby 1.1.2 Released

The JRuby community is pleased to announce the release of JRuby 1.1.2!

Homepage: http://www.jruby.org/
Download: http://dist.codehaus.org/jruby/

JRuby 1.1.2 is the second point release of JRuby 1.1. The fixes in this
release are primarily obvious compatibility problems and performance
enhancements. Our goal is to put out point releases more frequently for
the next several months (about 3-4 weeks a release). We want a more
rapid release cycle to better address issues brought up by users of
JRuby.

Highlights:

  • Startup time drastically reduced
  • YAML symbol parsing >100x faster
  • Performance, threading, and stack depth improvements for method calls
  • Fixed several nested backref problems
  • Fixed bad data race (JRUBY-2483)
  • Gazillions of bigdecimal issues fixed (all?)
  • 95 issues resolved since JRuby 1.1.1

JRUBY-672 java.lang.Class representation of Ruby class not
retrievable
JRUBY-1051 Rubinius bignum_spec failures
JRUBY-1163 Doesn’t allow ‘included’ to be protected
JRUBY-1190 Cannot call protected constructors from an abstract base
class
JRUBY-1332 It should be possible to add a jar to the load path and
have it act like a regular directory
JRUBY-1338 Concurrent file uploads in Rails cause OOM errors with
JRuby+Goldspike+Glassfish
JRUBY-1386 instance_eval is a nightmarish can of worms; it needs to
be completely refactored
JRUBY-1387 define_method methods are pushing two frames onto the
stack, among other inefficiencies
JRUBY-1390 Calling super without args does not (always) pass original
args
JRUBY-1395 while loops and other protected constructs may require
synthetic methods in the compiler
JRUBY-1463 Java deserialization through java-integration is broken in
JRuby
JRUBY-1574 Extract into jruby.home from jar: url
JRUBY-1582 Allow heap and stack to be set via environment variables
JRUBY-1688 Problems with multiple arguments to Kernel#exec/system and
Rake’s FileUtils#sh
JRUBY-1725 Gem installs a bad shebang on application scripts (like
rails)
JRUBY-1749 JRuby fails test/externals/bfts/test_time.rb on Japanese
environment
JRUBY-1753 while cases disabled with precompiled tests now runninng;
known lackings in the compiler
JRUBY-1767 JRuby needs a fast JSON library
JRUBY-2041 Calling the attached method after 6 times returns nil
JRUBY-2086 class cast exception randomly appears
JRUBY-2230 Compiler emits exception-handling sections of code that
can be reached through non-exceptional paths.
JRUBY-2247 Object#methods is incorrect in some cases
JRUBY-2265 BigDecimal outputs to_s(“F”) differently than MRI
JRUBY-2267 in `method_missing’: no id given (ArgumentError)
(RubyKernel class)
JRUBY-2318 $~/Regexp.last_match lost when evaluation is inside a block
JRUBY-2347 Race condition in DRb: Socket not always closed in
DRb.stop_service
JRUBY-2348 FasterCSV’s :auto option for row separator doesn’t work in
JRuby
JRUBY-2370 JRuby startup time significantly slower than MRI
JRUBY-2378 Hundreds of new rubyspec fiailures with BigDecimal
JRUBY-2383 File.stat fails confusingly on large files
JRUBY-2392 Problem marshalling time
JRUBY-2418 protected method bug: plugin will_paginate shows symptoms
JRUBY-2423 Avoid double copying data in ChannelDescriptor#read()
JRUBY-2431 Rubygems under JRuby doesn’t install BAT executable files
on Windows
JRUBY-2432 Rubygems under JRuby detects the ruby executable name
incorrectly on Windows
JRUBY-2434 Implement BigDecimal#sqrt
JRUBY-2438 Support SQLite3 using JRuby
JRUBY-2442 Each value of SCRIPT_LINES__ contains two redundant empty
lines
JRUBY-2444 NPE from o.j.r.scope.ManyVarsDynamicScope#getValue
JRUBY-2445 Regression: jirb_swing broken, prints out to the stdin,
not to the GUI
JRUBY-2450 StringIO#gets should set $_ to nil when it runs out of
lines
JRUBY-2451 Cannot compile JRuby (regression of rev: 6565)
JRUBY-2452 Predefined globals $_ and $~ handled incorrectly
JRUBY-2453 Etc.getpwnam crashes JVM on Linux
JRUBY-2458 Move jruby.properties to a proper package
JRUBY-2459 Upgrade rubygems to version 1.1.1
JRUBY-2461 RubyGems are installing with incorrect shebang line
JRUBY-2474 --debug for interpreted mode, --jdb for jdb
JRUBY-2476 Rubygems fails with NameError: StringIO
JRUBY-2477 ClassCastException org.jruby.RubyString cannot be cast to
org.jruby.RubySymbol
JRUBY-2478 InlineCachingCallSite perf degradation due to JRUBY-2477
fix
JRUBY-2479 YAML Parse Error for Array of Hash of Hash
JRUBY-2480 Ruby object passed to Java method impl passed back to Ruby
method impl loses original ruby instance
JRUBY-2482 ClassCastException in RubyThreadGroup.add
JRUBY-2483 PatternCache data race in RubyRegexp#initialize
JRUBY-2485 Regression: Most BAT starter scripts are broken on Windows
JRUBY-2486 rails --version command still broken
JRUBY-2487 Bugs in REXML::Document
JRUBY-2489 Regexp.last_match broken inside Enumerable’s grep block
JRUBY-2490 Initializing structs including Java interfaces crashes
JRuby
JRUBY-2491 File.umask with no argument sets umask to 0
JRUBY-2492 Add --debug option explanation in RubyInstanceConfig
JRUBY-2493 Classpath changes for workspace in eclipse
JRUBY-2494 REXML unusable from multiple threads:
java.lang.ClassCastException: org.jruby.RubyString
JRUBY-2499 Parser bug with :do
JRUBY-2502 Major regression in Array#pack
JRUBY-2503 variance from MRI: Module.new expects zero block params
JRUBY-2509 URI::HTTP.build behave incompatibly with MRI
JRUBY-2510 JRuby crashes with -XstartOnFirstThread on carbon
JRUBY-2511 Dir.pwd with non-ascii chars does not display correctly
JRUBY-2512 YAML 10x slower loading Graticule data
JRUBY-2514 JIT max and JIT threshold should be adjusted for
improvements in JRuby over the past months
JRUBY-2523 Deprecated StringScanner#getbyte is infinitely recursive
JRUBY-2524 File.exists? “file:/” crashes jruby (I believe the actual
cause is the file: prefix)
JRUBY-2527 jruby -e chomp throws AbstractMethodError
JRUBY-2530 Multiply-binding JRubyMethod’s with arity (min:0, max:2)
can’t have block args
JRUBY-2531 IO#seek= with non-fixnum vaule breaks JRuby (and rubyspec
run)
JRUBY-2533 NPE when using a closed Iconv object
JRUBY-2536 Bignum#div should never return non-integer values, even if
arg is Float
JRUBY-2537 Fixnum rubyspec failures for methods with Bignum arguments
JRUBY-2540 Two rubyspec failures for Complex
JRUBY-2547 JRuby 1.1.1 can’t install native gems like Mongrel,
Hpricot, etc
JRUBY-2549 Calling java.lang.Intger#method raises Exception
JRUBY-2551 JavaProxyClassFactory and JavaClass should use
getDeclaredConstructors to get all public/protected constructors
JRUBY-2558 Rational#divmod follows MRI bug behavior
JRUBY-2563 java.lang.NoSuchMethodError:
org.jruby.Ruby.newFixnum(I)Lorg/jruby/RubyFixnum; happens when trying
to access rails application
JRUBY-2568 Float divided by BigDecimal incorrectly coerced to Fixnum
JRUBY-2569 Specs to test method reflection and invocation
JRUBY-2570 BigDecimal#to_f incorrectly handles negative zero
JRUBY-2571 some IO constants not defined
JRUBY-2572 File::FNM_SYSCASE defined incorrectly on non-Windows
systems
JRUBY-2573 Revision 6754 randomly dispatches the wrong method under
multithreaded loads.
JRUBY-2575 Regression on Windows: Can’t execute jruby, with path
constructed out of rbconfig’s CONFIG entries
JRUBY-2579 Yaml ParserException
JRUBY-2580 Regression: yaml tests break JRuby hard


Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: [email protected] , [email protected]


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On May 27, 2008, at 10:02 PM, Thomas E Enebo wrote:

[snip huge list of bug fixes and enhancements]

Great work, everyone! I have started using JRuby recently at work and
so far it has been a real pleasure. Looking forward to improved Java/
Ruby integration in future releases!

cr


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Firstly, congratulations all on JRuby 1.1.2 - it fixed my BigDecimal
problem and seems faster too!

However, it also seems to have introduced a new problem :frowning:

I am accessing MS SQL Server via the Microsoft sqljdbc.jar which
attempts to load a DLL, sqljdbc_auth.dll, to handle Windows Integrated
Authentication.

Under JRuby 1.1.1, this works fine.
Under JRuby 1.1.2, I get the following error:

28/05/2008 15:50:04 com.microsoft.sqlserver.jdbc.AuthenticationJNI

WARNING: Failed to load the sqljdbc_auth.dll

A little searching showed that this typically means the JVM cant
located the DLL. However, the DLL is in my PATH [jruby\bin], and for
good measure I put a copy into \Windows\System32. No go.

I took compared the jruby.bat and _jrubyvars.bat between 1.1.1 and 1.1.2
and while there are changes between the two versions, nothing stands
out.

I tried setting -Djava.library.path="%PATH" as per one bulletin, but
this didn’t help.

As a workaround, I have switched from Windows Integrated Authentication
to user + password authentication and my app works fine. However, if JNI
is broken, someone else might find this to be showstopper.

Kindly,

Neville


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On Wed, May 28, 2008 at 1:11 AM, Neville B.
[email protected] wrote:

Under JRuby 1.1.2, I get the following error:
and while there are changes between the two versions, nothing stands
out.

I tried setting -Djava.library.path=“%PATH” as per one bulletin, but
this didn’t help.

As a workaround, I have switched from Windows Integrated Authentication
to user + password authentication and my app works fine. However, if JNI
is broken, someone else might find this to be showstopper.

Would you mind putting your description in a bug report so we don’t
lose track of it? Perhaps we can figure out a way to narrow down to
the offending revision that caused the regression.
http://jira.codehaus.org/browse/JRUBY

Thanks,
/Nick


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Neville B. wrote:

I am accessing MS SQL Server via the Microsoft sqljdbc.jar which
attempts to load a DLL, sqljdbc_auth.dll, to handle Windows Integrated
Authentication.

Under JRuby 1.1.1, this works fine.
Under JRuby 1.1.2, I get the following error:

28/05/2008 15:50:04 com.microsoft.sqlserver.jdbc.AuthenticationJNI

WARNING: Failed to load the sqljdbc_auth.dll

We were getting that error with jruby 1.1rc1, though it appears to be
fixed in 1.1rc2, 1.1, and (as you said) 1.1.1. I haven’t tried our app
with 1.1.2. In our case, it was due to requiring sqljdbc.jar once in a
parent process and again in a “process” started by rake (e.g. “jruby
script/console” worked, but “jruby -S rake test:units” produced the
error). I assume the problem was something like the jar and its classes
got loaded twice in different classloaders, but the same OS process, and
each sqljdbc jar tried to load the DLL, but the OS returned an error the
second time it tried to load/initialize.

We fixed it by putting sqljdbc.jar in the CLASSPATH instead of doing a
require ‘sqljdbc’. It looks like ‘jruby -J-Djruby.launch.inproc=false -S
rake test:units’ fixes the problem, too.

HTH,
Matt


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Matt B. wrote:

We fixed it by putting sqljdbc.jar in the CLASSPATH instead of doing a
require ‘sqljdbc’. It looks like ‘jruby -J-Djruby.launch.inproc=false -S
rake test:units’ fixes the problem, too.

Ahh yes, multiple loads of a JNI-related library in a single JVM. That
makes sense. Yes, the two workarounds you mention are definitely the two
I’d recommend. Can you add them somewhere on the wiki, perhaps on any
SQL Server page that might exists? This is good information.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

We fixed it by putting sqljdbc.jar in the CLASSPATH instead of doing a
require ‘sqljdbc’.

Hmmm, I had placed the sqljdbc.jar in %JRUBY_HOME%\lib - is that the
wrong approach to provide JARs to JRuby?

I note that the _jrubyvars.bat constructs the -cp via looking at all the
jars in %JRUBY%\lib, so maybe that’s why JRuby is loading the
sqljdbc.jar several times on my system?

I’ve tried moving the sqljdbc.jar into a c:\java\shared\ folder, and
setting CLASSPATH=c:\java\shared\sqljdbc.jar but this is giving me a
java.lang.ClassNotFoundException:
com/microsoft/sqlserver/jdbc/SQLServerDriver - am I missing something
here with setting the CLASSPATH?

Finally, I tried adding require ‘C:\java\shared\sqljdbc.jar’ to my
sqlserver_adapter.rb but still got java.lang.ClassNotFoundException.

Clearing I’m missing something [or mistyping something].

Any pointers to setting a CLASSPATH for JRuby under Windows would be
appreciated [I’ve looked at the wiki],

Kind Regards,

Neville


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks Matt for your detailed efforts!

This all works for me in 1.1.2…

Excellent news!

Kind Regards

Neville


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Neville B. wrote:

We fixed it by putting sqljdbc.jar in the CLASSPATH instead of doing a
require ‘sqljdbc’.

Hmmm, I had placed the sqljdbc.jar in %JRUBY_HOME%\lib - is that the
wrong approach to provide JARs to JRuby?

That should have worked just fine.

I note that the _jrubyvars.bat constructs the -cp via looking at all the
jars in %JRUBY%\lib, so maybe that’s why JRuby is loading the
sqljdbc.jar several times on my system?

I’ve tried moving the sqljdbc.jar into a c:\java\shared\ folder, and
setting CLASSPATH=c:\java\shared\sqljdbc.jar but this is giving me a
java.lang.ClassNotFoundException:
com/microsoft/sqlserver/jdbc/SQLServerDriver - am I missing something
here with setting the CLASSPATH?

I just tried moving sqljdbc.jar around, and was able to get a similar
error, and then I got it to go away, too:

c:\Dev\myapp>jruby -v
ruby 1.8.6 (2008-04-22 rev 6555) [x86-jruby1.1.1]

c:\Dev\myapp>set CLASSPATH
Environment variable CLASSPATH not defined

c:\Dev\myapp>jruby -S rake db:version
(in c:/Dev/myapp)
rake aborted!
The driver encountered an error: cannot load Java class
com.microsoft.sqlserver.jdbc.SQLServerDriver

(See full trace by running task with --trace)

c:\Dev\myapp>set CLASSPATH=c:\jars\sqljdbc.jar

c:\Dev\myapp>jruby -S rake db:version
(in c:/Dev/myapp)
Current version: 159

Finally, I tried adding require ‘C:\java\shared\sqljdbc.jar’ to my
sqlserver_adapter.rb but still got java.lang.ClassNotFoundException.

In the require, try using / instead of .

c:\Dev\myapp>set CLASSPATH=

c:\Dev\myapp>grep sqljdbc config\environment.rb

require ‘c:/jars/sqljdbc.jar’

c:\Dev\myapp>jruby -S rake db:version
(in c:/Dev\myapp)
Current version: 159

Also, jruby will add the .jar for you if you use require to load it:

c:\Dev\myapp>grep sqljdbc config\environment.rb

require ‘…/…/Test/rebates/lib/jars/sqljdbc’

c:\Dev\myapp>jruby -S rake db:version
(in c:/Projects/RDC07015/SCM/Branches/Dev/rebates)
Current version: 159

This all works for me in 1.1.2…

c:\Dev\myapp>…\jruby-1.1.2\bin\jruby -v
ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]

c:\Dev\myapp>…\jruby-1.1.2\bin\jruby -S rake db:version
(in c:/Dev\myapp)
Current version: 159

Clearing I’m missing something [or mistyping something].

Any pointers to setting a CLASSPATH for JRuby under Windows would be
appreciated [I’ve looked at the wiki],

The approaches I’ve used are:

  1. At the command prompt, or in a batch file, “set
    CLASSPATH=c:\jar1.jar;c:\jar2.jar;c:\etc.jar”

  2. Add the jar to jruby’s lib.

  3. Create lib/jars in my application and change
    jruby-x.y.z\bin_jrubyvars.bat to add them to the classpath
    for %%i in (".\lib\jars*.jar") do @call :setcp %%i
    This option works well for our project because warbler bundles up
    everything in lib, so this way we get the jars in dev and in production
    just by putting them in that directory.

  4. Use “require ‘sqljdbc’”. Note that with sqljdbc in a rails app,
    you’ll probably have to add the require line to config\environment.rb.
    It must be loaded before AR tries to connect, and some things (like
    observers) cause AR to try to connect during initialization.

Another thing I noticed while trying to cause sqljdbc problems this
morning is that sqljdbc behaves the same in 1.1RC1 when [a]
sqljdbc_auth.dll is in the PATH and a second jruby runtime in the same
JVM loads the jar or [b] when sqljdbc_auth.dll is not in the PATH. It
looks like >=1.1RC2 don’t have problems with [a].

HTH,
Matt


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Just wanted to put out my thanks for this release too. The start up
time is noticably shorter which is making tests quicker to run :smiley:

On Wed, May 28, 2008 at 1:38 PM, Chuck R. [email protected]
wrote:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Thanks for your update Matt,

I had given up making JRuby 1.1.2 work with sqljdbc via integrated
authentication, but this post has inspired me to try again following
your lead of editing the scripts.

I suspected the changed scripts from day 1, particularly after Charles
said “Ahh yes, multiple loads of a JNI-related library in a single JVM.
That makes sense.”, but I wasn’t able to determine where the multiple
loading [ie classloaders] was being initiated.

I’m guessing that the -Xbootclasspath/a must initiate an additional
classloader. Perhaps Charles can chime in?

Anyway, it looks like the problem is related to the way jruby’s
scripts
pass the classpath to the JVM… in 1.1.1, they’re all passed via -cp.
In 1.1.2, they’re passed using -Xbootclasspath/a. I tweaked our copy
of
the scripts to pass everything via -cp and nothing via
-Xbootclasspath/a, and I was able to get sqljdbc to connect with
integrated auth (if I put sqljdbc in the CLASSPATH or CP vars). I’m
still not able to get it to work with require.


Matt


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Apparently I was wrong… when we tried to replace jruby 1.1.1 with
jruby 1.1.2, we started having the integrated auth problem you
described. I’m not sure why it worked a couple weeks ago and not
today…

Anyway, it looks like the problem is related to the way jruby’s scripts
pass the classpath to the JVM… in 1.1.1, they’re all passed via -cp.
In 1.1.2, they’re passed using -Xbootclasspath/a. I tweaked our copy of
the scripts to pass everything via -cp and nothing via
-Xbootclasspath/a, and I was able to get sqljdbc to connect with
integrated auth (if I put sqljdbc in the CLASSPATH or CP vars). I’m
still not able to get it to work with require.


Matt

Matt B. wrote:

jars in %JRUBY%\lib, so maybe that’s why JRuby is loading the

com.microsoft.sqlserver.jdbc.SQLServerDriver

Finally, I tried adding require ‘C:\java\shared\sqljdbc.jar’ to my
c:\Dev\myapp>jruby -S rake db:version
c:\Dev\myapp>jruby -S rake db:version
(in c:/Dev\myapp)
CLASSPATH=c:\jar1.jar;c:\jar2.jar;c:\etc.jar"

  1. Use “require ‘sqljdbc’”. Note that with sqljdbc in a rails app,

HTH,
Matt


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Neville B. wrote:

I’m guessing that the -Xbootclasspath/a must initiate an additional
classloader. Perhaps Charles can chime in?

Have you confirmed that’s the error you’re getting? Ideally I would only
see the SQLite native stuff getting loaded once, regardless of
bootclasspath or not.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Have you confirmed that’s the error you’re getting? Ideally I would only
see the SQLite native stuff getting loaded once, regardless of
bootclasspath or not.

I played with it some more today. I was starting to get frustrated
because I couldn’t reproduce the JNI problem, but instead got lots of
ClassNotFoundExceptions. Eventually, though I figured out that, in
short,
(1) java -Xbootclasspath/a:jruby.jar;sqljdbc.jar …
doesn’t work with integrated auth (which uses JNI) and
(2) java -Xbootclasspath/a:jruby.jar -classpath sqljdbc.jar …
does work. Dropping sqljdbc.jar (the MS SQL Server JDBC driver) into
JRuby’s lib dir adds it to the bootclasspath, whereas adding it to the
CLASSPATH env var makes it get passed to the JVM via the -classpath
switch. Loading it with “require” seems to work, too. So sqljdbc.jar
should not be placed in jruby’s lib directory.

The ClassNotFoundException seems to happen more often with jruby 1.1.2
than with jruby 1.1.1. For example, if I add sqljdbc.jar to the
CLASSPATH env var and run jruby, the following succeeds in 1.1.1 and
fails with cnfe in 1.1.2:
(3) java.lang.Class.forName
‘com.microsoft.sqlserver.jdbc.SQLServerDriver’

The following succeeds in both versions:
(4) com.microsoft.sqlserver.jdbc.SQLServerDriver
or
(5) eval(‘com.microsoft.sqlserver.jdbc.SQLServerDriver’)
or
(6) include_class ‘com.microsoft.sqlserver.jdbc.SQLServerDriver’

(6) is what AR-jdbc uses, IIRC.

I updated the wiki.
http://wiki.jruby.org/wiki/Troubleshooting#JNI_gotchas


Matt


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Ah, great investigation!

I was worried that someone might suggest that we revert back to
loading jruby.jar
from the classpath, not the boot classpath, thus increasing the
startup time considerably.
And having used to the new/faster startup, that would be really
unfortunate.

Thanks,
–Vladimir

On Mon, Jun 16, 2008 at 6:52 PM, Matt B. [email protected] wrote:

does work.


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

We should modify the startup to only load the jruby jar on bootstrap
classpath and everything else in lib and CLASSPATH as normal
classpath. I think that will probably help since most libraries are
not meant to be loaded via bootstrap cp.

  • Charlie

On Jun 16, 2008, at 13:26, Vladimir S. [email protected] wrote:

–Vladimir

couldn’t reproduce the JNI problem, but instead got lots of
http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email