The ContainerGetter.getContainer method returns an enum of either JBoss, Glassfish or UNKNOWN. It does this by checking for the presence of a particular file at a relative path. This file doesn't exist when running Payara inside the standard Payara docker image so the method returns UNKNOWN whereas it is expected to return Glassfish.
Checking for the presence of the file is clearly unreliable so perhaps we could get the container information from an api such as the getServerInfo call eg.
The
ContainerGetter.getContainer
method returns an enum of eitherJBoss
,Glassfish
orUNKNOWN
. It does this by checking for the presence of a particular file at a relative path. This file doesn't exist when running Payara inside the standard Payara docker image so the method returnsUNKNOWN
whereas it is expected to returnGlassfish
.Checking for the presence of the file is clearly unreliable so perhaps we could get the container information from an api such as the getServerInfo call eg.
where
c
is aServletContext
. (Copied from here)What does @ajkyffin think of this solution?