Trying to integrate Compass, Spring and AXIS2 together.
LocalCompassBean is not aware of the ClassLoader being used for loading/configuring the BeanFactory. As consequence, when starting the webservice, the WebappClassLoader is used when invoking the init methods of the LocalCompassBean instead of the webservice ClassLoader --> ClassNotFoundException.
StackTrace on java.lang.ClassNotFoundException
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1443)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1289)
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Class.java:242)
org.compass.core.util.ClassUtils.forName(ClassUtils.java:90)
org.compass.spring.LocalCompassBean.afterPropertiesSet(LocalCompassBean.java:275)
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1198)
In order to avoid this problem LocalCompassBean must implement org.springframework.beans.factory.BeanClassLoaderAware. And every call to ClassUtils.forName must use the ClassLoader being set through the BeanClassLoaderAware implementation.
Regards
Grégory