Cannot retrieve cause from RaiseException


I have some JRuby code that is calling a Java class which is throwing a
subclass of RuntimeException. This exception is getting wrapped by
JRuby into a RaiseException which should be wrapping my runtime
exception. However when I catch the RaiseException and examine the
cause, the cause is null. When I examine the variables through a
debugger during runtime, the cause of the RaiseException is itself.
(java.lang.Throwable returns null on getCause if the the cause is

This is happening with JRuby 1.4.0 within Sinatra application that is
embedded in Tomcat using JRuby-Rack 0.9.7.

However, when I write some very simple code to try and reproduce the
bug, I can’t reproduce it (see attached).

Perhaps the RaiseException isn’t getting constructed correctly? Or am I
doing something wrong?


Note: I haven’t been able to use JRuby 1.5.2 because of some issues of
discovering symbol.rb on the classpath of the jruby-complete-1.5.2.jar.
I checked the bug database for 1.4 to see if there was an issue with
RaiseException but there doesn’t seem to be.