[Design of POJO Server] - Re: Classloader problem with NamingRestartUnitTestCase
by kabir.khan@jboss.com
Looking at
[url]
http://viewvc.jboss.org/cgi-bin/viewvc.cgi/jbossas/projects/microcontaine...
| if (result != null)
| 220 {
| 221 // Has this classloader been undeployed?
| 222 ClassLoader otherClassLoader = getClassLoader(result);
| 223 if (otherClassLoader != null && otherClassLoader != this && otherClassLoader instanceof RealClassLoader)
| 224 {
| 225 RealClassLoader rcl = (RealClassLoader) otherClassLoader;
| 226 // Ignore when undeployed
| 227 if (rcl.isValid() == false)
| 228 {
| 229 if (trace)
| 230 log.trace(this + " ignoring already loaded class from undeployed classloader " + ClassLoaderUtils.classToString(result));
| 231 result = null;
| 232 }
| 233 }
| 234 }
|
The call on 227 ends up in BaseClassLoader
| public boolean isValid()
| {
| BaseClassLoaderPolicy basePolicy = policy;
| return basePolicy.getClassLoader() != null;
| }
|
which in turn ends up in BaseClassLoaderPolicy
| synchronized BaseClassLoader getClassLoader()
| {
| if (classLoader == null)
| throw new IllegalStateException("No classloader associated with policy therefore it is no longer registered " + toLongString());
| return classLoader;
| }
|
So the isValid() check will throw an IllegalStateException rather than return false
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4126953#4126953
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4126953
18 years, 2 months