// spring needs to use the envLoader first for all class resolution,
// but we must still fall back on application loader
ClassLoader loader = repos.getConfiguration().
getClassResolverInstance().getClassLoader(cls, null);
if (envLoader != null && envLoader != loader) {
MultiClassLoader mult = new MultiClassLoader();
mult.addClassLoader(envLoader);
// loader from resolver is usually a multi loader itself
if (loader instanceof MultiClassLoader)
mult.addClassLoaders((MultiClassLoader)loader);
else
mult.addClassLoader(loader);
loader = mult;
}
XMLPersistenceMetaDataParser xmlParser = getXMLParser();
xmlParser.setClassLoader(loader);