I thought about this a bit more in the lat days. IMHO this is actually a bug in the container. If a path contains any number of # characters, the complete name should nevertheless be stored in the “path” component of the URL. It looks like you are using JBoss AS. Which exact version of it?
Of cause this incorrect behavior of the container shouldn’t lead to a StackOverflowError. But IMHO this could be very easy be replacing entryUrl.getPath() with entryUrl.toString(). But I’ll have a look at this.
Do you play Magic?
Get TopDecked MTG, the #1 Magic App, built by players, for players. Free to use, forever.