Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getContainer method relies on presence of a file rather than using the provided API #15

Open
stuartpullinger opened this issue Oct 1, 2021 · 1 comment

Comments

@stuartpullinger
Copy link
Contributor

stuartpullinger commented Oct 1, 2021

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.

c.getServerInfo().toLowerCase().contains("glassfish") || c.getServerInfo().toLowerCase().contains("payara");

where c is a ServletContext. (Copied from here)

What does @ajkyffin think of this solution?

@ajkyffin
Copy link
Contributor

ajkyffin commented Oct 1, 2021

Determining the application server from the ServletContext would be much better than the current method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants