realmClassLoaderField.set(realm, realmClassLoader);
// Evil hack for Tomcat classloader issue - ends
embedder.start(classWorld);
metadataSource = (ArtifactMetadataSource) embedder.lookup(ArtifactMetadataSource.ROLE);
artifactFactory = (ArtifactFactory) embedder.lookup(ArtifactFactory.ROLE);
artifactResolver = (ArtifactResolver) embedder.lookup(ArtifactResolver.ROLE);
setUpRepositories(embedder);