Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WARNING: An illegal reflective access operation has occurred #58

Open
dwing4g opened this issue Jun 16, 2020 · 3 comments
Open

WARNING: An illegal reflective access operation has occurred #58

dwing4g opened this issue Jun 16, 2020 · 3 comments

Comments

@dwing4g
Copy link

dwing4g commented Jun 16, 2020

在OpenJDK 11上启动firenio会提示这些警告, 好像是因为调用了非法的反射操作, 不过可以google到解决办法, 建议处理一下

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.firenio.common.Unsafe (file: firenio-all-1.3.3.jar) to field java.util.concurrent.atomic.AtomicLong.VM_SUPPORTS_LONG_CAS
WARNING: Please consider reporting this to the maintainers of com.firenio.common.Unsafe
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

@wangkaish
Copy link
Member

这段代码是为了做 long update 用的,要求机器必须支持8字节 CAS, 因为很多地方用了 long 的 CAS,虽然不支持这个特性的服务器非常少,但还是判断一下。

@dwing4g
Copy link
Author

dwing4g commented Jun 19, 2020

这段代码是为了做 long update 用的,要求机器必须支持8字节 CAS, 因为很多地方用了 long 的 CAS,虽然不支持这个特性的服务器非常少,但还是判断一下。

我不是质疑CAS的问题, 而是新版JDK对反射限制严格了一些, 最好找到别的途径实现相同的功能, 或者google一下找到屏蔽这个警告的方法.

@wangkaish
Copy link
Member

我不是质疑CAS的问题, 而是新版JDK对反射限制严格了一些, 最好找到别的途径实现相同的功能, 或者google一下找到屏蔽这个警告的方法.

感觉这段检测代码没必要,如果不支持 long CAS, JVM 可能也起不来,后面这段代码拿掉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants