I'm in the process of creating a REST-adjacent (i.e. HTTP Method implementation, but not actual REST structure) API wrapper for a SOAP API I've developed for Glassfish6. In developing this, I've created a new module controller for the REST-adjacent controller in addition to the SOAP . The SOAP Controller is annotated with @WebService. Originally, the module was built and deployed as a JAR with
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.1</version>
<configuration>
<ejbVersion>3.1</ejbVersion>
</configuration>
</plugin>
It is now built and deployed as a WAR:
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
<configuration>
<attachClasses>true</attachClasses>
</configuration>
</plugin>
I'm able to build and deploy this module to my Glassfish6 server. However, there is a weird and inconsistent issue wherein, on deploy of the module Glassfish6 will report the Application as having engines ejb,web instead of ejb,web,webservices as seen in the External module in screenshot of the Application Console below:
ApplicationConsoleGF6
The SOAP Module Controller :
@WebService(targetNamespace = "http://redactednamespace.com")
@Stateless
@LoginNotRequired
public class External extends BaseController {
@Override
protected void setModuleNameInRegistry() {
registry.putResource(MODULE_NAME, "External");
}
}
The REST-Adjacent Controller
@Path("external/{serviceName}")
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
@Stateless
public class ExternalJson extends BaseJsonController {
@Override
protected void setModuleNameInRegistry() {
registry.putResource(MODULE_NAME, "External");
}
}
Because webservices isn't active, the SOAP controller throws a 404 when attempting to access, claiming no endpoint is listening. Using the REST Controller does allows for access with the module though.
Redeploying on its own does not solve the issue. What's even stranger about all of this, is that after several hours (without a redeploy and no additional steps on my side), GF6 will then report that the module is a webservices engine and the SOAP controller can be reached (like what you can see in the Core and Background modules in the screenshot). On subsequent redeploys after that, GF6 does not have an issue with deploying the module correctly as ejb,web,webservices.Obviously, picking SOAP or REST would be the best option, but not really feasible unfortunately at this point, so any advice would be greatly appreciated here. Thanks!