Error "Could not find definition for port" occurs after migrating web services from EAP 5 to 6

Solution Unverified - Updated -

Issue

  • We are migrating an EAP 5.1 application to EAP 6.1.
  • We are trying to compile and deploy their existing EAP 5.1 application, which used the EAP provided CXF libraries, in EAP 6 and are seeing the exception below at deployment.
13:26:21,429 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.subunit."myapp.ear"."my_ws.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."myapp.ear"."my_ws.war".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "my_ws.war" of deployment "myapp.ear"
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:127) [jboss-as-server-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]
        at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]
Caused by: javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for port {urn:com:example:myapp:services}SampleServicePortTypeImplPort.
        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:368)
        at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:66)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:250)
        at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:536)
        at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:116)
        at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:128)
        at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:67)
        at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)
        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:120) [jboss-as-server-7.2.1.Final-redhat-10.jar:7.2.1.Final-redhat-10]
        ... 5 more
Caused by: org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for port {urn:com:example:myapp:services}SampleServicePortTypeImplPort.
        at org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:179)
        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:416)
        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:538)
        at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:252)
        at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:205)
        at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:101)
        at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:159)
        at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)
        at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:453)
        at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:333)
        ... 13 more
  • We are using a "meet-in-the-middle" web service development approach; we have written a WSDL and the web service implementations. But the CXF factory in EAP 6 can no longer find the service class under the proper name.
  • In EAP 5.1, it was able to properly recognize the SampleServicePortTypeImpl service class. In EAP 6, it is looking for SampleServicePortTypeImplPort ("Port" added to the end of the name), and this class is not found.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x
  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content