Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Virgo 3.7.0.M3 - KernelBundleClassLoader Concurrency during service startup(Multiples bundles loading simultaneously cause class loader issue)
Virgo 3.7.0.M3 - KernelBundleClassLoader Concurrency during service startup [message #1752024] Wed, 18 January 2017 02:41
Junior Sousa is currently offline Junior SousaFriend
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

Previous Topic:Virgo 3.7.0.M03 - Class loader management
Next Topic:Virgo 3.7.0.M04 has been shipped
Goto Forum:
  


Current Time: Tue Apr 23 09:07:16 GMT 2024

Powered by FUDForum. Page generated in 0.06279 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top