Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
I am having problems getting JRuby 9.1.12 to run my Rails project. I was previously on 9.1.2, and that works fine. All I have done is updated JRuby, and now it fails, so my suspicion is a bug in JRuby.
To investigate, I created a test project, first using JRuby 9.1.2:
Location is a table in an existing database, so quicker for testing. I deleted the migration, copied across database.yml from my project, and edited secret.yml so it uses the same key as the tests. Then:
Then I put the .war into Tomcat and it works fine. So then JRuby 9.1.12:
I stop Tomcat, delete the old files, and put this new war in. Now I see this when going to a page in testy:
I have Googled the error, but found nothing. I am using Java 126.96.36.199 (32 bit), Tomcat 8.0.45 (32 bit), Warbler 2.0.4 on Windows 7 Pro.
Here are the gems from gemfile.lock in case something there is awry:
Ok, so basic cause here is that we've got an internal encoding (the default encoding used for symbols and strings in memory) that can't be associated with a Java Charset needed to convert back and forth to Java strings. But instead of reporting the name of the encoding, it's passing a null charset to String.getBytes, which also does no null check and then blows up.
I tried to simulate this with an encoding Java doesn't support, ISO-8859-14, but we get a different error.
# encoding: ISO-8859-14 puts :ø.encoding
This is the same path as in the reported exception, but before it passes the null it gets an error from Java indicating the encoding is not supported. So the path causing the reported issue must be from an encoding that we don't even try to associate with a Charset.
I'm looking into it.
Ok I think the fix is fine but updating jcodings is not a good idea for a 9.1.x release. jcodings has had numerous changes to support Ruby 2.4 features, some of which are slightly incompatible with JRuby 9.1.x's logic. I will instead do the same fix as a workaround in 9.1.13.
This is equivalent to fixes made for #4716 in jcodings 1.0.25, but other changes in that version made it too risky to upgrade in JRuby 9.1.x. The code here wraps jcodings with the appropriate logic rather than updating.
im getting the same issue here
Caused by: java.lang.NullPointerException