Ok, I have found out how to get it to work. Please let me know if what I am doing is incorrect.
I had to change the classloader for my current thread to that of my plugin's class.
ClassLoader orig = Thread.currentThread().getContextClassLoader();
try {
Thread.currentThread().setContextClassLoader(MyPlu gin.class.getClassLoader());
appContext = new FileSystemXmlApplicationContext("springapp.xml");
} catch (Exception e) {
.....
}
finally {
Thread.currentThread().setContextClassLoader(orig) ;
}
Now it all works like a charm!
