-
Notifications
You must be signed in to change notification settings - Fork 586
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
ClassNotFoundException when loading cglib enhanced classes created by Spring #695
Comments
/cc @ramprasadjr |
Thank you for reporting! I'll investigate the issue. |
thekingn0thing
pushed a commit
that referenced
this issue
Sep 11, 2016
thekingn0thing
added a commit
that referenced
this issue
Sep 11, 2016
Thanks! |
Thanks |
was this ever fixed? is there a way to use powermock with spring boot now? |
This was referenced Oct 17, 2019
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Originally raised on the Spring Boot issue tracker we're seeing different class loading behavior when the
MockClassLoader
is used and cglib enhanced are loaded.A minimal project that reproduces the issue using PowerMock v1.6.5 and Spring Framework 4.3.2 can be found here.
Once imported into an IDE, if the following test is modified to directly use the
SpringRunner
then the test passes.If the
PowerMockRunner
is used then the test fails with the following exception:Digging in a little to the differences, it appears that
ClassLoader.findClass(name)
for the regular version returns a non-null result, where as in the failing version it returnsnull
. Adding a conditional breakpoint onClassLoader.loadClass(String name, boolean resolve)
with the following condition should be enough to see the difference:The text was updated successfully, but these errors were encountered: