'Could not get WSDL contract error when deploying web service in WildFly

I am trying to deploy my web service in WildFly server, but I am getting following exception:

6:44:06,265 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."MyService.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.unit."MyService.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of deployment "MyService.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)Caused by: org.jboss.wsf.spi.WSFException: JBWS024109: Could not get WSDL contract for endpoint com.sun.xml.ws.tx.coord.v11.endpoint.RegistrationPortImpl at /wsdls/wsc11/wstx-wscoor-1.1-wsdl-200702.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:147)
... 5 more

How can I resolve the above problem?



Solution 1:[1]

If someone has the same error, I had compile scope dependency that is below in my pom.xml. After I deleted the dependency , the project has deployed and worked nicely.

<dependency>
    <groupId>org.glassfish.metro</groupId>
    <artifactId>webservices-rt</artifactId>
    <version>2.3</version>
    <scope>compile</scope>
</dependency>

Solution 2:[2]

see wsdllocation address in @javax.jws.WebService annotation. Sometimes there is something wrong with lowercase or uppercase letters. On Windows it might work and on Linux it might not.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 misman
Solution 2 procrastinator