Ignore resources loaded by a magic classloader in Glassfish.

Ignore resources loaded by a magic classloader in Glassfish.

Please see discussion at #3922. The change is ugly, but it works and has least risks side-effects.