mybatis / ibatis-2

iBATIS 2.x
Apache License 2.0
98 stars 110 forks source link

Illegal reflective access by com.ibatis.common.beans.ClassInfo #54

Closed cgamache closed 4 years ago

cgamache commented 4 years ago

Java 11 using --illegal-access=debug VM parameter

WARNING: Illegal reflective access by com.ibatis.common.beans.ClassInfo to method java.lang.Object.finalize() at com.ibatis.common.beans.ClassInfo.addUniqueMethods(ClassInfo.java:288) at com.ibatis.common.beans.ClassInfo.getClassMethods(ClassInfo.java:261) at com.ibatis.common.beans.ClassInfo.addGetMethods(ClassInfo.java:124) at com.ibatis.common.beans.ClassInfo.(ClassInfo.java:97) at com.ibatis.common.beans.ClassInfo.getInstance(ClassInfo.java:532) at com.ibatis.common.resources.Resources.instantiate(Resources.java:340) at com.ibatis.common.resources.Resources.instantiate(Resources.java:324) at com.ibatis.common.jdbc.SimpleDataSource.initialize(SimpleDataSource.java:177) at com.ibatis.common.jdbc.SimpleDataSource.(SimpleDataSource.java:107) ...

Warnings can be suppressed, and illegal reflective access can be permitted with command line parameters, but the warnings indicate this type of reflective access will eventually be completely eliminated.

harawata commented 4 years ago

Hello @cgamache ,

iBATIS 2 is not maintained anymore. Please upgrade to MyBatis 3 before it stops working.

hazendaz commented 4 years ago

Hi @cgamache, To add to what @harawata noted, this is a warning and is extremely unlikely to be addressed. Additionally, you can run both ibatis-2 and mybatis-3 in same code base to ease transition to mybatis-3. The legacy ibatis-2 line hasn't had any official support in years and only has had enough patches to keep it alive to assist those transitioning to mybatis-3.

cgamache commented 4 years ago

It was worth a shot. Transaction and batch handling in MyBatis 3 is substantially different (and opinionated). If it were possible to patch it would be far more economical to do that instead of modifying the mountain of application code written for 2.

hazendaz commented 4 years ago

@cgamache

From a build standpoint, we are now building up through ~jdk15~ even though that is most likely just 14 with a new name. Thus your concern can live for quite some time. Because no pull request exists for this to solve it and I highly doubt any of the maintainers (including myself) cares to work on a fix, I'm closing this. I am however releasing a new cut but forcing it up to jdk 7 to run with as that was the only way for me to properly confirm it works through what is jdk 15 now. I've further ran it through modernization as well so lots of old bad code usage has been fixed so it should at least better use memory in some areas now. I am completely open for pull requests and will release all the same. I like others just don't want to spend a lot of time here on my own as the value benefit is extremely low.

One other thing I think needs mentioned. At least in my day job and I assume in many others, most no one knows there was ever a mybatis-2 cut of ibatis. And many unfortuantely keep coding away with ibatis 2.3.4 or older not even knowing they can mix the two or even that they are related :( While I push all to 2.3.7 as last release, the lack of understanding is the bigger pain point. So at best, this push I'm doing on release to have 2.3.8 out within a day or two if not tonight is mearly I feel for myself to justify getting legacy code bases at least a bit more compliant.

Again, if you can raise some form of pull request that deals overall with the warning concerns, I'd be happy to release it. As it stands, I'm pushing for a release for the first time in 3 years...

hazendaz commented 4 years ago

@cgamache I'm making the release 2.4.0 given how many modernization changes I've made (ie via modernization-maven-plugin). I'm running it now. It will be out in next few hours if all goes well and you may want to check to see if that makes any difference at all with what you see (probably not but worth base-lining :)

hazendaz commented 4 years ago

ok - javadocs gave a real fit...released as 2.4.3. Should be in central by tomorrow :)