The earlier fix for
GLASSFISH-20510 can cause problems in the way resource names are actually constructed which can appear if the resource URI is used and analyzed.
The underlying problem really was in the way the monitoring name was constructed. It yielded part of a URI path that contained illegal characters: it contained a left bracket without a matching right bracket. Because matched brackets are valid in a URI but unmatched are not, this caused an error in building the URI for the resource name.
The correct fix is to adopt Byron's suggested change to the monitoring code and remove the URL encoding logic I added before.