Frieda
Frieda

Reputation: 163

Jruby - TypeError: illegal access on 'clone'

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.jruby.ext.zlib.RubyZlib to field java.util.zip.CRC32.crc
WARNING: Please consider reporting this to the maintainers of org.jruby.ext.zlib.RubyZlib
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
rails aborted!
TypeError: illegal access on 'clone': class org.jruby.javasupport.JavaMethod cannot access a member of class java.lang.Object (in module java.base) with modifiers "protected native"

I'm suddenly getting this error. Any help would be appreciated.

java -version

openjdk version "1.8.0_151"
OpenJDK Runtime Environment (build 1.8.0_151-8u151-b12-0ubuntu0.16.04.2-b12)
OpenJDK 64-Bit Server VM (build 25.151-b12, mixed mode)

Upvotes: 3

Views: 771

Answers (1)

Gokul P
Gokul P

Reputation: 464

Hi I too faced the same problem with OpenJDK9.

# java --version
openjdk 9.0.4
OpenJDK Runtime Environment (build 9.0.4+12-Debian-4)
OpenJDK 64-Bit Server VM (build 9.0.4+12-Debian-4, mixed mode)

# jruby -v
jruby 9.1.16.0 (2.3.3) 2018-02-21 8f3f95a OpenJDK 64-Bit Server VM 9.0.4+12-Debian-4 on 9.0.4+12-Debian-4 +jit [linux-x86_64]

and

activerecord-jdbc-adapter -v 1.3.24

I just gave the fix in gem level then it's not blocking me to proceed further. Just try this. Go to the driver.rb in the following path:

activerecord-jdbc-adapter-1.3.24/lib/arjdbc/jdbc/driver.rb

Then edit the following line in the connection method

properties = self.properties.clone 

Change this to:

properties = self.properties.dup

Upvotes: 1

Related Questions