private final static Log log = LogFactory.getLog(Kernel.class);
private final BundleContext bundleContext;
- private final ThreadGroup threadGroup = new ThreadGroup("Argeo CMS Kernel");
+ // private final ThreadGroup threadGroup = new
+ // ThreadGroup("Argeo CMS Kernel");
private JackrabbitNode node;
private RepositoryFactory repositoryFactory;
}
void init() {
- new Thread(threadGroup, "init") {
- @Override
- public void run() {
- // CMS bundle classloader used during initialisation
- Thread.currentThread().setContextClassLoader(
- Kernel.class.getClassLoader());
- doInit();
- }
- }.start();
+ // new Thread(threadGroup, "init") {
+ // @Override
+ // public void run() {
+ // // CMS bundle classloader used during initialisation
+ // Thread.currentThread().setContextClassLoader(
+ // Kernel.class.getClassLoader());
+ doInit();
+ // }
+ // }.start();
}
- /** Run asynchronously */
protected void doInit() {
+ ClassLoader currentContextCl = Thread.currentThread()
+ .getContextClassLoader();
+ Thread.currentThread().setContextClassLoader(
+ Kernel.class.getClassLoader());
long begin = System.currentTimeMillis();
InternalAuthentication initAuth = new InternalAuthentication(
KernelConstants.DEFAULT_SECURITY_KEY);
} catch (Exception e) {
log.error("Cannot initialize Argeo CMS", e);
throw new ArgeoException("Cannot initialize", e);
+ } finally {
+ Thread.currentThread().setContextClassLoader(currentContextCl);
}
long jvmUptime = ManagementFactory.getRuntimeMXBean().getUptime();