Ignore resources loaded by a magic classloader in Glassfish.

Ignore resources loaded by a magic classloader in Glassfish.
(cherry picked from commit 6efeaa6, backport of #3922)