Just noticed that when http-listener-1 is Security [X] Enabled, asadmin deploy fails with an exception in the server log:
Caused by: java.lang.NullPointerException
at com.sun.enterprise.deployment.WebServiceEndpoint.composeEndpointAddress(WebServiceEndpoint.java:679)
at com.sun.enterprise.deployment.WebServiceEndpoint.composeEndpointAddress(WebServiceEndpoint.java:675)
at com.sun.enterprise.deployment.WebServiceEndpoint.composeFinalWsdlUrl(WebServiceEndpoint.java:731)
at org.glassfish.webservices.WebServicesDeployer.doWebServicesDeployment(WebServicesDeployer.java:560)
at org.glassfish.webservices.WebServicesDeployer.prepare(WebServicesDeployer.java:166)
... 84 more
I can perfectly asadmin deploy when temporarily setting disabling Security [ ] Enabled and enable it afterwards! It is 100% repeatable using Payara Community 5.2021.8. HTTPS works perfectly well then with the deployed application.
Side note, I am using a PKCS #12 certificate file directly as the keystore, and have not imported the own public key in the separate Java keystore.
Is there something I missed? Did I discover a bug?
Therefore to fix this, you should set the transport guarantee for the URL of your WS endpoint in web.xml to something other than NONE: web.xml Deployment Descriptor Elements
If this doesn’t help or you think that this shouldn’t be necessary, please raise a bug on github and describe how to reproduce it.
Ondro, thank you for chiming in! Yes, indeed I think it is a bug in Payara as in the end, we do not enforce HTTPS in our application, but we support it. Hence, it is definitively correct to have NONE in web.xml. Otherwise it would be impossible to switch between secured and unsecured mode without redeploying, which definitively is not what people expect. In the end, if temporarily disabling security on listener-1 at deployment, the applications works pretty will over HTTPS after switching it on then.
BTW, throwing NullPointerException to indicate that there should be something in web.xml other thank NONE is definitively a bug itself.
Side Note: Commenting // @WebService temporarily resolves this issue, which proofs that Ondro’s guess is correct. While this works for us (we do not need this web service currently), it is still a bug in Payara to behave like this.