Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-3544

xsd:import not working in WSDLs if EJB WebService deployed in EAR

    Details

      Description

      I try to define some common types to be used in multiple WSLDs into a xsd file WorkPackageServiceTypes.xsd as follows:

      <?xml version="1.0" encoding="UTF-8"?>
      <schema xmlns="http://www.w3.org/2001/XMLSchema"
      targetNamespace="http://www.example.org/Common/WorkPackageServiceTypes"
      xmlns:tns="http://www.example.org/Common/WorkPackageServiceTypes"
      elementFormDefault="qualified">

      <complexType name="WorkPackageType">
      <sequence>
      <element name="WpRunningNo" type="long"
      maxOccurs="1" minOccurs="1">
      </element>
      <element name="StartDate" type="dateTime"
      maxOccurs="1" minOccurs="1">
      </element>
      <element name="EndDate" type="dateTime"
      maxOccurs="1" minOccurs="1"></element>
      <element name="Approved" type="boolean"
      maxOccurs="1" minOccurs="1">
      </element>
      <element name="Enabled" type="boolean" maxOccurs="1"
      minOccurs="1">
      </element>
      <element name="Terminated" type="boolean"
      maxOccurs="1" minOccurs="1">
      </element>
      </sequence>
      </complexType>
      </schema>

      I import this XSD into the WSDL of a service.

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="http://www.example.org/WorkPackageApprovalDService/"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      name="WorkPackageApprovalDService" targetNamespace="http://www.example.org/WorkPackageApprovalDService/">

      <wsdl:types>
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pref="http://www.example.org/Common/WorkPackageServiceTypes"
      targetNamespace="http://www.example.org/WorkPackageApprovalDService/">
      <xsd:import schemaLocation="WorkPackageServiceTypes.xsd"
      namespace="http://www.example.org/Common/WorkPackageServiceTypes"></xsd:import>
      <xsd:element name="approve" type="tns:WpRunningNo">
      </xsd:element>
      <xsd:element name="approveResponse">
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element name="WorkPackage" type="pref:WorkPackageType"
      maxOccurs="1" minOccurs="1">
      </xsd:element>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>

      <xsd:element name="enableResponse">
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element name="WorkPackage" type="pref:WorkPackageType"></xsd:element>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      <xsd:element name="enable" type="tns:WpRunningNo"></xsd:element>

      <xsd:simpleType name="WpRunningNo">
      <xsd:restriction base="xsd:long"></xsd:restriction>
      </xsd:simpleType>
      <xsd:element name="terminateResponse">
      <xsd:complexType>
      <xsd:sequence>
      <xsd:element name="WorkPackage" type="pref:WorkPackageType" maxOccurs="1" minOccurs="1"></xsd:element>
      </xsd:sequence>
      </xsd:complexType>
      </xsd:element>
      <xsd:element name="terminate" type="tns:WpRunningNo"></xsd:element>
      </xsd:schema>
      </wsdl:types>

      <wsdl:message name="approveRequest">
      <wsdl:part name="WpRunningNo" element="tns:approve"></wsdl:part>
      </wsdl:message>
      <wsdl:message name="approveResponse">
      <wsdl:part name="parameters" element="tns:approveResponse"></wsdl:part>
      </wsdl:message>
      <wsdl:message name="enableRequest">
      <wsdl:part name="WpRunningNo" element="tns:enable"></wsdl:part>
      </wsdl:message>
      <wsdl:message name="enableResponse">
      <wsdl:part name="parameters" element="tns:enableResponse"></wsdl:part>
      </wsdl:message>
      <wsdl:message name="terminateRequest">
      <wsdl:part name="WpRunningNo" element="tns:terminate"></wsdl:part>
      </wsdl:message>
      <wsdl:message name="terminateResponse">
      <wsdl:part name="parameters" element="tns:terminateResponse"></wsdl:part>
      </wsdl:message>
      <wsdl:portType name="WorkPackageApprovalDService">

      <wsdl:operation name="approve">
      <wsdl:input message="tns:approveRequest"></wsdl:input>
      <wsdl:output message="tns:approveResponse"></wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="enable">
      <wsdl:input message="tns:enableRequest"></wsdl:input>
      <wsdl:output message="tns:enableResponse"></wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="terminate">
      <wsdl:input message="tns:terminateRequest"></wsdl:input>
      <wsdl:output message="tns:terminateResponse"></wsdl:output>
      </wsdl:operation>
      </wsdl:portType>
      <wsdl:binding name="WorkPackageApprovalDServiceSOAP" type="tns:WorkPackageApprovalDService">
      <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http" />

      </wsdl:binding>

      <wsdl:service name="WorkPackageApprovalDService">
      <wsdl:port binding="tns:WorkPackageApprovalDServiceSOAP"
      name="WorkPackageApprovalDServiceSOAP">
      <soap:address location="http://com.ipsways.ossoa.ws" />
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>

      Both WSDL and XSD are located into the same folder (META-INF/wsdl/). wsconsume as generated all classes and stubs as expected. The web service is implemented as stateless session bean. If I package the ejb jar into an ear and deploy it to JBoss AS the following exception occurs during deployment:

      09:08:12,156 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "Demo Project-1.0-SNAPSHOT.ear"
      09:08:12,217 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "webservices-ejb-1.0-SNAPSHOT.jar"
      09:08:12,238 INFO [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-1) JNDI bindings for session bean named WorkPackageApprovalDServiceCFEndpoint in deployment unit subdeployment "webservices-ejb-1.0-SNAPSHOT.jar" of deployment "Demo Project-1.0-SNAPSHOT.ear" are as follows:

      09:08:12,252 INFO [org.jboss.wsf.stack.cxf.metadata.MetadataBuilder] (MSC service thread 1-3) Add Service
      id=WorkPackageApprovalDServiceCFEndpoint
      address=http://W043:8080/xsdimportdemo/WorkPackageApprovalDService/WorkPackageApprovalDServiceImpl
      implementor=org.example.workpackageapprovaldservice.WorkPackageApprovalDServiceImpl
      invoker=org.jboss.wsf.stack.cxf.JBossWSInvoker
      serviceName=

      {http://www.example.org/WorkPackageApprovalDService/}

      WorkPackageApprovalDService
      portName=

      {http://www.example.org/WorkPackageApprovalDService/}

      WorkPackageApprovalDServiceSOAP
      wsdlLocation=null
      mtomEnabled=false
      properties=[org.jboss.as.webservices.metadata.modelEjbComponentViewName -> service jboss.deployment.subunit."Demo Project-1.0-SNAPSHOT.ear"."webservices-ejb-1.0-SNAPSHOT.jar".component.WorkPackageApprovalDServiceCFEndpoint.VIEW."org.example.workpackageapprovaldservice.WorkPackageApprovalDServiceImpl".SERVICE_ENDPOINT]
      09:08:12,265 INFO [org.apache.cxf.service.factory.ReflectionServiceFactoryBean] (MSC service thread 1-3) Creating Service

      {http://www.example.org/WorkPackageApprovalDService/}

      WorkPackageApprovalDService from WSDL: META-INF/wsdl/WorkPackageApprovalDService.wsdl
      09:08:12,322 INFO [org.apache.cxf.endpoint.ServerImpl] (MSC service thread 1-3) Setting the server's publish address to be http://W043:8080/xsdimportdemo/WorkPackageApprovalDService/WorkPackageApprovalDServiceImpl
      09:08:12,334 INFO [org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher] (MSC service thread 1-3) WSDL published to: file:/D:/dev/jboss-as-7.2.0.Alpha1-SNAPSHOT/standalone/data/wsdl/Demo%20Project-1.0-SNAPSHOT.ear/webservices-ejb-1.0-SNAPSHOT.jar/WorkPackageApprovalDService.wsdl
      09:08:12,340 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC00001: Failed to start service jboss.deployment.subunit."Demo Project-1.0-SNAPSHOT.ear"."webservices-ejb-1.0-SNAPSHOT.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."Demo Project-1.0-SNAPSHOT.ear"."webservices-ejb-1.0-SNAPSHOT.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "webservices-ejb-1.0-SNAPSHOT.jar" of deployment "Demo Project-1.0-SNAPSHOT.ear"
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_27]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_27]
      at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_27]
      Caused by: java.lang.RuntimeException: Cannot publish wsdl to: D:\dev\jboss-as-7.2.0.Alpha1-SNAPSHOT\standalone\data\wsdl\Demo Project-1.0-SNAPSHOT.ear\webservices-ejb-1.0-SNAPSHOT.jar\WorkPackageApprovalDService.wsdl
      at org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:107)
      at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.publishContractToFilesystem(EndpointImpl.java:133)
      at org.jboss.wsf.stack.cxf.deployment.EndpointImpl.doPublish(EndpointImpl.java:75)
      at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:246)
      at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:525)
      at org.jboss.wsf.stack.cxf.configuration.NonSpringBusHolder.configure(NonSpringBusHolder.java:119)
      at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.startDeploymentBus(BusDeploymentAspect.java:129)
      at org.jboss.wsf.stack.cxf.deployment.aspect.BusDeploymentAspect.start(BusDeploymentAspect.java:68)
      at org.jboss.as.webservices.deployers.AspectDeploymentProcessor.deploy(AspectDeploymentProcessor.java:74)
      at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.2.0.Alpha1-SNAPSHOT.jar:7.2.0.Alpha1-SNAPSHOT]
      ... 5 more
      Caused by: java.io.IOException: JBAS015526: Child 'META-INF/wsdl/dl/Demo%20Project-1.0-SNAPSHOT.ear/webservices-ejb-1.0-SNAPSHOT.jar/WorkPackageServiceTypes.xsd' not found for VirtualFile: "/D:/dev/jboss-as-7.2.0.Alpha1-SNAPSHOT/bin/content/Demo Project-1.0-SNAPSHOT.ear/webservices-ejb-1.0-SNAPSHOT.jar"
      at org.jboss.as.webservices.util.VirtualFileAdaptor.findChild(VirtualFileAdaptor.java:62)
      at org.jboss.ws.common.deployment.ResourceResolverImpl.resolve(ResourceResolverImpl.java:79)
      at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:223)
      at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:249)
      at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:249)
      at org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:94)
      ... 14 more

      09:08:12,550 INFO [org.jboss.as.server] (DeploymentScanner-threads - 1) JBAS015870: Deploy of deployment "Demo Project-1.0-SNAPSHOT.ear" was rolled back with failure message {"JBAS014671: Failed services" =>

      {"jboss.deployment.subunit.\"Demo Project-1.0-SNAPSHOT.ear\".\"webservices-ejb-1.0-SNAPSHOT.jar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"Demo Project-1.0-SNAPSHOT.ear\".\"webservices-ejb-1.0-SNAPSHOT.jar\".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment \"webservices-ejb-1.0-SNAPSHOT.jar\" of deployment \"Demo Project-1.0-SNAPSHOT.ear\" Caused by: java.lang.RuntimeException: Cannot publish wsdl to: D:\\dev\\jboss-as-7.2.0.Alpha1-SNAPSHOT\\standalone\\data\\wsdl\\Demo Project-1.0-SNAPSHOT.ear\\webservices-ejb-1.0-SNAPSHOT.jar\\WorkPackageApprovalDService.wsdl Caused by: java.io.IOException: JBAS015526: Child 'META-INF/wsdl/dl/Demo%20Project-1.0-SNAPSHOT.ear/webservices-ejb-1.0-SNAPSHOT.jar/WorkPackageServiceTypes.xsd' not found for VirtualFile: \"/D:/dev/jboss-as-7.2.0.Alpha1-SNAPSHOT/bin/content/Demo Project-1.0-SNAPSHOT.ear/webservices-ejb-1.0-SNAPSHOT.jar\""}

      ,"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.comp.\"Demo Project-1.0-SNAPSHOT\".\"webservices-ejb-1.0-SNAPSHOT\".WorkPackageApprovalDServiceCFEndpoint.Validator Missing[jboss.naming.context.java.comp.\"Demo Project-1.0-SNAPSHOT\".\"webservices-ejb-1.0-SNAPSHOT\".WorkPackageApprovalDServiceCFEndpoint]","jboss.naming.context.java.comp.\"Demo Project-1.0-SNAPSHOT\".\"webservices-ejb-1.0-SNAPSHOT\".WorkPackageApprovalDServiceCFEndpoint.ValidatorFactory Missing[jboss.naming.context.java.comp.\"Demo Project-1.0-SNAPSHOT\".\"webservices-ejb-1.0-SNAPSHOT\".WorkPackageApprovalDServiceCFEndpoint]","jboss.deployment.unit.\"Demo Project-1.0-SNAPSHOT.ear\".CLEANUP Missing[JBAS014861: <one or more transitive dependencies>]"]}
      09:08:12,553 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 1) JBAS014774: Service status report
      JBAS014775: New missing/unsatisfied dependencies:
      service jboss.naming.context.java.comp."Demo Project-1.0-SNAPSHOT"."webservices-ejb-1.0-SNAPSHOT".WorkPackageApprovalDServiceCFEndpoint (missing) dependents: [service jboss.naming.context.java.comp."Demo Project-1.0-SNAPSHOT"."webservices-ejb-1.0-SNAPSHOT".WorkPackageApprovalDServiceCFEndpoint.Validator, service jboss.naming.context.java.comp."Demo Project-1.0-SNAPSHOT"."webservices-ejb-1.0-SNAPSHOT".WorkPackageApprovalDServiceCFEndpoint.ValidatorFactory]
      JBAS014777: Services which failed to start: service jboss.deployment.subunit."Demo Project-1.0-SNAPSHOT.ear"."webservices-ejb-1.0-SNAPSHOT.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."Demo Project-1.0-SNAPSHOT.ear"."webservices-ejb-1.0-SNAPSHOT.jar".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment "webservices-ejb-1.0-SNAPSHOT.jar" of deployment "Demo Project-1.0-SNAPSHOT.ear"

      09:08:12,555 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 2) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014671: Failed services" =>

      {"jboss.deployment.subunit.\"Demo Project-1.0-SNAPSHOT.ear\".\"webservices-ejb-1.0-SNAPSHOT.jar\".INSTALL" => "org.jboss.msc.service.StartException in service jboss.deployment.subunit.\"Demo Project-1.0-SNAPSHOT.ear\".\"webservices-ejb-1.0-SNAPSHOT.jar\".INSTALL: JBAS018733: Failed to process phase INSTALL of subdeployment \"webservices-ejb-1.0-SNAPSHOT.jar\" of deployment \"Demo Project-1.0-SNAPSHOT.ear\" Caused by: java.lang.RuntimeException: Cannot publish wsdl to: D:\\dev\\jboss-as-7.2.0.Alpha1-SNAPSHOT\\standalone\\data\\wsdl\\Demo Project-1.0-SNAPSHOT.ear\\webservices-ejb-1.0-SNAPSHOT.jar\\WorkPackageApprovalDService.wsdl Caused by: java.io.IOException: JBAS015526: Child 'META-INF/wsdl/dl/Demo%20Project-1.0-SNAPSHOT.ear/webservices-ejb-1.0-SNAPSHOT.jar/WorkPackageServiceTypes.xsd' not found for VirtualFile: \"/D:/dev/jboss-as-7.2.0.Alpha1-SNAPSHOT/bin/content/Demo Project-1.0-SNAPSHOT.ear/webservices-ejb-1.0-SNAPSHOT.jar\""}

      ,"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.naming.context.java.comp.\"Demo Project-1.0-SNAPSHOT\".\"webservices-ejb-1.0-SNAPSHOT\".WorkPackageApprovalDServiceCFEndpoint.Validator Missing[jboss.naming.context.java.comp.\"Demo Project-1.0-SNAPSHOT\".\"webservices-ejb-1.0-SNAPSHOT\".WorkPackageApprovalDServiceCFEndpoint]","jboss.naming.context.java.comp.\"Demo Project-1.0-SNAPSHOT\".\"webservices-ejb-1.0-SNAPSHOT\".WorkPackageApprovalDServiceCFEndpoint.ValidatorFactory Missing[jboss.naming.context.java.comp.\"Demo Project-1.0-SNAPSHOT\".\"webservices-ejb-1.0-SNAPSHOT\".WorkPackageApprovalDServiceCFEndpoint]","jboss.deployment.unit.\"Demo Project-1.0-SNAPSHOT.ear\".CLEANUP Missing[JBAS014861: <one or more transitive dependencies>]"]}}}
      09:08:12,569 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment webservices-ejb-1.0-SNAPSHOT.jar in 12ms
      09:08:12,571 INFO [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015877: Stopped deployment Demo Project-1.0-SNAPSHOT.ear in 14ms

      If I deploy the jar directly without packaging into an ear it works.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jim.ma Jim Ma
                  Reporter:
                  timo.hirt Timo Hirt
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: