public class ClassloaderSwitcherInterceptor extends Object implements org.aopalliance.intercept.MethodInterceptor
This interceptor changes the thread context classloader to the class' current classloader.
We need this because of the
org.springframework.ldap.odm.typeconversion.impl.ConversionServiceConverterManager
which was introduced
in spring-security-2.0.0.
This manager uses ClassUtils.getDefaultClassLoader()
which creates
new class instance using thread context classloader which differs from the current classloader of the caller class:
org.apache.activemq.activemq-osgi
WebappClassLoader
ConversionServiceConverterManager
tries to cast clazz.newInstance()
to the
GenericConversionService
it throws ClassCastException
if the context classloader hadn't changed.
That's why we need to proxy all classes which might use the ConversionServiceConverterManager
.
Constructor and Description |
---|
ClassloaderSwitcherInterceptor() |
Modifier and Type | Method and Description |
---|---|
Object |
invoke(org.aopalliance.intercept.MethodInvocation invocation) |
Copyright © 2019 Hitachi Vantara. All rights reserved.