AnnotationConfigApplicationContext with multiple ClassLoaders
Hello guys,
I'm trying to use AnnotationConfigApplicationContext within the following scenario:
Code:
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.setClassLoader(this.getClass().getClassLoader()); // Changes here to take ProcessConfig
ctx.register(ProcessConfig.class);
ctx.register(ApiConfig.class); // Exception here
ctx.refresh();
Where ApiConfig.class is in the thread ClassLoader:
Thread.currentThread().getContextClassLoader();
Is there any configuration that could be made for AnnotationConfigApplicationContext allowing it to consider both classLoaders?
Thank you