Virgo 3.7.0.M3 - KernelBundleClassLoader Concurrency during service startup [message #1752024] |
Wed, 18 January 2017 02:41 |
Junior Sousa Messages: 15 Registered: September 2016 |
Junior Member |
|
|
Hi,
I have a scenario where I have multiples services at same plan file and during startup of some of them, depending of machine performance when spring framework invoke a method getDefaultClassLoader from JVM and it get the current thread in order to invoke a service from bundle that is starting I noticed that the object KernelBundleClassLoader is populated with other bundle. As consequency, do not load the required libraries specified in manifest file.
Did you see something like this before?
Example PLAN
- service a
- service b
- service c
...
When 'service c' is going to be started, Instead of code below load class loader as 'service c' it is loading 'service b' to classloader.
The exception in log is 'JobRepository is not visible from class loader', this happen because 'service b' does not have declared in its manifest this dependency, ok - why we have this concorrency, any idea?
public static ClassLoader getDefaultClassLoader() {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClassLoader();
}
catch (Throwable ex) {
// Cannot access thread context ClassLoader - falling back...
}
if (cl == null) {
// No thread context class loader -> use class loader of this class.
cl = ClassUtils.class.getClassLoader();
if (cl == null) {
// getClassLoader() returning null indicates the bootstrap ClassLoader
try {
cl = ClassLoader.getSystemClassLoader();
}
catch (Throwable ex) {
// Cannot access system ClassLoader - oh well, maybe the caller can live with null...
}
}
}
return cl;
}
Thanks,
Junior Sousa
[Updated on: Wed, 18 January 2017 21:39] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03572 seconds