Underscore in hostname illegal in JavaSE

An issue has reared its ugly head which left me wondering who programs these things.
It turns out that JavaSE class JMXServiceURL throws an exception when a hostname contains a ‘_’ character. This class, in the present case, is buried deep within some Oracle software.
Well further investigation shows that in RFC1123 which amends RFC952 this behaviour is in fact correct!
The underscore character is illegal in a hostname.
So “wcc.dmz_myuserid_network” which is a host attached to the myuserid_network defined in the dmz stack cannot run any JavaSE application which makes use of the JMXServiceURL class from Oracle Java. And as everyone else tries to be compatible with that Java, it seems no container using Java and a JMXServiceURL class can run on Portainer (without exception handling).
Is there an option to change the use of underscores in compound names?

Replying to my own post:
As of V3.5 of the Composer/Stack syntax, there is support for a name: clause. I simply named all the networks to replace under_scores with hy-phens. Everything is now working as expected.
Hope this helps someone with a Java hostname issue.

1 Like