The Jasper Reports library uses URLs as Map/Set keys:
There are potential problems with this, as every time a URLs hashCode()/equals() methods are used a DNS request may be performed:
The recommendation of JDK developers is to use URIs in Map/Set collections instead.
This (performing host name lookups) depends on the underlying URL stream handler implementation. The problem does not apply equally to all environments where the Jasper reports library may be deployed. For instance JAR URLs in a static class-path have no such problem. On the the other hand HTTP URLs returned by a URLClassLoader may cause DNS lookups. We have seen specific problems in a JBoss OSGi environment:
If the DNS service for some reason does not answer fast enough this leads to applications delays. In addition if DNS does not perform very reliably this leads to the impression that the application itself has sporadic delays in Jasper Reports generation etc.
I believe the best place to fix this is the Jasper Reports library - use URIs in Map/Set collections instead.