Re: Bug: StackOverflowError on some unusual filenames

Splash Forums PrettyFaces Users Bug: StackOverflowError on some unusual filenames Re: Bug: StackOverflowError on some unusual filenames

#23328

adequmoda
Participant

I stepped thru with a debugger and identified the problem a little better.

Silly thing about file operations via the URL interface – the ‘#’ character is the “reference” part of a URL.

PrettyFaces WebClassesFinder#processDirectory calls ServletContext#getResource(“/WEB-INF/classes/net/concentric/icrwebtool/util/#CacheControlFilter.java#”) which returns a URL consisting of Path “/default-host/ICRWebTool/WEB-INF/classes/net/concentric/icrwebtool/util/” and Ref “CacheControlFilter.java#”. Because the path has a trailing slash PrettyFaces treats the URL as another directory to recurse. Perhaps you have mistaken the contract of ServletContext#getResourcePaths (Set of Strings where trailing slash means directory) with ServletContext#getResource (URL, silly stuff about Scheme, Path, Ref, Query – no ‘trailing slash means directory’ contract).

Looks like the code doesn’t need to operate on URL at all, can just use the String returned by ServletContext#getResourcePaths.