I need some help preventing Wildfly11 from automatically loading classes annotated with @WebServiceProvider
in jar dependencies.
The dependency is 3rd party so it's not possible for me to change the contents of the jar or to make source code changes to it.
I have tried
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclude-subsystems>
<subsystem name="jaxrs" />
<subsystem name="webservices" />
</exclude-subsystems>
</deployment>
</jboss-deployment-structure>
This completely disabled webservices support, which is fine for now (although I do get other errors that doesn't seem to break anything)...but ideally I just wanted to exclude the jar, or certain classes/class paths from being automatically loaded.
What I have discovered thus far is, the @WebServiceProvider
annotation is not part of the beans scanning. So adding bean-discovery-mode="none"
to beans.xml
has no affect. Adding a jboss-scanning.xml
had no luck excluding the jar or classes..
Application details:
- Type: SpringBoot 2 war file
- Container: War deployed to Wildfly 11 in standalone mode
- Why Wildfly?! Client dictated.
- Exclude the jar? I don't want to exclude the entire jar from the classpath, there are classes I need. I just don't want the automagic to load stuff I didn't ask for.
Update 1 Here is the log entry Yes it complains about a WSDL... but I don't even want this class to load at all in the first place.
11:56:50,990 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."studyquotation.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."studyquotation.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "studyquotation.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.jboss.wsf.spi.WSFException: JBWS024109: Could not get WSDL contract for endpoint com.ca.gen80.wsrt.router.GenServiceRouter at WEB-INF/wsdl/router.wsdl
at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.getWsdlLocationURL(MetadataBuilder.java:283)
at org.jboss.wsf.stack.cxf.metadata.MetadataBuilder.build(MetadataBuilder.java:90)
at org.jboss.wsf.stack.cxf.deployment.aspect.DescriptorDeploymentAspect.start(DescriptorDeploymentAspect.java:42)
at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:73)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
... 5 more
The class is annotated with
@WebServiceProvider(
serviceName = "router",
portName = "routerSoapPort",
targetNamespace = "http://GenStudio/router/",
wsdlLocation = "WEB-INF/wsdl/router.wsdl"
)
@BindingType("http://schemas.xmlsoap.org/wsdl/soap/http")
@ServiceMode(Mode.MESSAGE)
public class GenServiceRouter implements Provider<SOAPMessage> {