In the integration with the new Bean Validator 1.1 we ran into a case
where the wrong beans.xml was being loaded. It happens where there are
more than 1 beans.xml in the classpath and using the ContextClassLoader
was returning the first one that it found which is not necessarily the
one in the archive that was being processed. This happened when running
glassfish in embedded mode.
The ReadableArchive does not have methods for returning URLs for the
entries only Strings. So to make sure that we get the beans.xml from the
archive we created the temporary class loader for the archive and then
get the URL for the beans.xml resource.