Comments (15)
I'm running into this too, any idea of when a fix may be available.
from reflectasm.
I'm not sure, I haven't looked into it. It's not a problem yet though, it's just a warning. It won't be a problem until they disallow what the library needs to function. At that time we either fix it or the library won't work on the latest JVMs. That is the case for a great many libraries.
from reflectasm.
An option might be to create a multi release jar (aka MRJAR) and use a different way for Java 9+ to defineClass
(MethodHandles.Lookup.defineClass).
from reflectasm.
try this:
// suppress "An illegal reflective access operation has occurred" in JDK9+
if (!System.getProperty("java.version").startsWith("1.") && !MethodAccess.class.getModule().isNamed())
Class.class.getModule().addOpens(Class.class.getPackageName(), MethodAccess.class.getModule());
from reflectasm.
In a similar vein to EsotericSoftware/kryo#626, could you support a System property (-Dreflectasm.unsafe=false) or something so that we can stop this error message from appearing (and ideally start to get ready for when illegal access is removed)? 🙏
from reflectasm.
Can ignore or disable the warning.
from reflectasm.
I tried to implement the suggestion of using MethodHandles.lookup().defineClass()
instead of ClassLoader.defineClass()
, but only got as far as robinverduijn/reflectasm@fix-code-warnings...robinverduijn:fix-illegal-reflective-access. It left me with the warning gone but two tests failing. At that point I got stuck, but maybe someone else can figure out how to make it work from there?
from reflectasm.
@NathanSweet For what it's worth, @magro explained how to fix this problem. Simply replace ClassLoader.defineClass
with MethodHandles.Lookup.defineClass
from reflectasm.
Just FYI: still the same warning with java 13
from reflectasm.
Some of my users are also seeing this. See rarcher/couch-potato-server#27 for a discussion.
from reflectasm.
Any update?
from reflectasm.
@NathanSweet Obviously. But can't the underlying problem be fixed?
from reflectasm.
If that works, great! I just haven't had the time or personal need to dig into it.
from reflectasm.
Any news on this?
from reflectasm.
Sorry I'm too busy with other things, but maybe someone could come up with a PR for multi-release jar?
from reflectasm.
Related Issues (20)
- Class versions V1_5 or less must use F_NEW frames. HOT 3
- class loaded by urlclassloader and cannot be cast to com.esotericsoftware.reflectasm.MethodAccess HOT 2
- Warning with Spring Boot 2.1.6, Java 11, and GraphQL HOT 1
- Class cannot be created (the no-arg constructor is private) HOT 1
- why FieldAccess can't get private Field? HOT 1
- Unable to access methods on the Object class HOT 3
- MethodAccess.invoke takes a lot physical memory
- java.lang.UnsupportedOperationException HOT 2
- Message about F_NEW frames when testing against version 9.1 of asm HOT 1
- Failure of test testAutoUnloadClassloaders HOT 2
- Why not support private field at FieldAccess? HOT 1
- how can i get construct with parameter by ConstructorAccess HOT 1
- Scala 3 lazy val implementation breaks FieldAccess reflection
- not work on JDK11+
- Test failures with OpenJDK17: probably ClassLoader evolutions since OpenJDK11 HOT 8
- Is it possible to invoke static method in interface
- ClassLoaderTest.testAutoUnloadClassloaders is flaky HOT 2
- java.lang.UnsupportedOperationException
- If a class has dozens or more properties, reflectasm performance is slower than java native performance HOT 1
- conflct with ASM framwork which is likes Jacoco
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from reflectasm.