cloning icon indicating copy to clipboard operation
cloning copied to clipboard

Illegal reflective access by com.rits.cloning.Cloner$CloneObjectCloner for Timestamp.nanos

Open johanhaleby opened this issue 2 years ago • 1 comments

Hi!

I run into this problem when running our application:

[ERROR] WARNING: An illegal reflective access operation has occurred
[ERROR] WARNING: Illegal reflective access by com.rits.cloning.Cloner$CloneObjectCloner (file:/root/.m2/repository/io/github/kostaskougios/cloning/1.10.3/cloning-1.10.3.jar) to field java.sql.Timestamp.nanos
[ERROR] WARNING: Please consider reporting this to the maintainers of com.rits.cloning.Cloner$CloneObjectCloner
[ERROR] WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
[ERROR] WARNING: All illegal access operations will be denied in a future release

I'm using Java 17. Is there anything I can/should do from my side?

Regards /Johan

johanhaleby avatar Nov 29 '21 14:11 johanhaleby

Might want to look at https://github.com/kostaskougios/cloning/issues/105

For this type of thing you probably need to implement and register a fast cloner for java.sql.Timestamp which does not rely on reflection (to internals of the object)

There's an example at https://github.com/gocd/gocd/blob/5638a49a35e5a96836f8870deae69a8e9c8f1093/util/src/main/java/com/thoughtworks/go/util/ClonerFactory.java#L42-L68 if you're interested (and test)

chadlwilson avatar Apr 05 '22 23:04 chadlwilson