-
Notifications
You must be signed in to change notification settings - Fork 207
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
Mockito inline with -XX:+AllowEnhancedClassRedefinition still crashes with JBR 17.0.14 #514
Comments
Thanks for report! Could you please provide a mapped stack trace to better understand the issue? Right now, your stack trace only shows memory addresses without corresponding method names and source file locations. A Linux JBR image should provide a stack trace with debug symbols. Otherwise, without a reproducer, tracking down this issue will be hard—our tests with Mockito are working. It would also be great if you could try JBR21, as it includes a fix for a ClassUnloading-related issue, which might resolve the problem. Let us know if that helps! |
I have uploaded the full error message, just stripped some package names/file paths I also tried JBR21, this gives a different error saying a class cannot be mocked. The class in question isn't final or anything and a spy can be successfully created when not using mockito inline
|
After switching to Mockito's inline MockMaker my integration tests are crashing when using JBR 17.0.14 build1367.22 with -XX:+AllowEnhancedClassRedefinition.
Running tests with an Oracle JDK is successful.
The underlying issue is that Mockito's inline Mock maker redefines "java.lang.Object". When I debug into the Mockito code and manually edit the set of redefined classes (by removing java.lang.Object) it works.
In #259 it is stated that redefining java.lang.Object should be possible now.
Note: Since these tests are integration tests running in an OSGI environment the classloading is pretty complex.
With JBR 17.0.12 test execution will just hang forever in "retransformClasses()". With 17.0.14 I'm getting the following access violation
I haven't yet found a way to create a simple reproducer since this is only happening in our more complex integration tests.
The text was updated successfully, but these errors were encountered: