Closed javaserverfaces closed 11 years ago
Reported by zsb
@manfredriem said: Can you verify if your DNS is always resolving properly? Note if the key is not being resolved fast enough it might indicate a DNS resolving problem.
@manfredriem said: Lowering priority because of no response
@manfredriem said: Lowering priority because of no response
@manfredriem said: Closing because of inactivity
Issue-Links: is related to JAVASERVERFACES-2117
This issue was imported from java.net JIRA JAVASERVERFACES-2228
Marked as incomplete on Thursday, April 25th 2013, 9:20:47 am
JSF clikcks take more than two seconds randomly although there is no logic on the page. After running the profiler it turned out that the application waits for 2-4 seconds on the following place:
java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method) java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:850) java.net.InetAddress.getAddressFromNameService(InetAddress.java:1201) java.net.InetAddress.getAllByName0(InetAddress.java:1154) java.net.InetAddress.getAllByName(InetAddress.java:1084) java.net.InetAddress.getAllByName(InetAddress.java:1020) java.net.InetAddress.getByName(InetAddress.java:970) java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:420) java.net.URLStreamHandler.hashCode(URLStreamHandler.java:337) java.net.URL.hashCode(URL.java:857) java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:768) com.sun.faces.util.ExpiringConcurrentCache.containsKey(ExpiringConcurrentCache.java:149) com.sun.faces.facelets.impl.DefaultFaceletCache.isFaceletCached(DefaultFaceletCache.java:132) com.sun.faces.facelets.impl.DefaultFaceletFactory.needsToBeRefreshed(DefaultFaceletFactory.java:264)
Reason of the hangs: DefaultFaceletCache uses an URL as the key of the cache entry. Some topic says that URL should never be used as key of HashMap or in collections where hashcode might be called. Reason is the same as the stacktrace shows: URL calls getHostAddress during hashcode generation that cause calling lookupAllHostAddr.
It may solve the problem if the url.getExternalForm() string is used as the key of the cache as it does not cause hangs.
Environment
Windows Vista, 7, 2008 Server, Java 1.6_27, Glassfish 3.1.1, JSF webapp as an OSGI bundle.
Affected Versions
[2.1.3]