public void dispose() { bus.shutdown(true); // clear static caches preventing memory leaks on redeploy // needed because cxf core classes are loaded by the Mule system classloader, not app's JAXBContextCache.clearCaches(); try { // ASMHelper.LOADER_MAP is a protected static field final Field cacheField = ASMHelper.class.getDeclaredField("LOADER_MAP"); cacheField.setAccessible(true); // static field final Map cache = (Map) cacheField.get(null); cache.clear(); } catch (Throwable t) { logger.warn("Error disposing CxfConfiguration, this may cause a memory leak", t); } }