xsd:import not working in WSDLs if EJB web service is deployed in EAR

Solution Verified - Updated -

Issue

  • An EAR contains an EJB-JAR and a JAR. The JAR contains WSDL in META-INF but it is referenced from wsdlLocation in EJB-JAR to avoid JBoss generating its own WSDL without external schema.
  • On deployment the error we get is:

    Caused by: java.io.IOException: JBAS015526: Child 'META-INF/wsdl/My_schema1.xsd' not found for VirtualFile: "/content/myEAR.ear/my-ejb.jar"
            at org.jboss.as.webservices.util.VirtualFileAdaptor.findChild(VirtualFileAdaptor.java:61)
            at org.jboss.as.webservices.util.VirtualFileAdaptor.findChild(VirtualFileAdaptor.java:71)
            at org.jboss.ws.common.deployment.ResourceResolverImpl.resolve(ResourceResolverImpl.java:76)
            at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:228)
            at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:253)
            at org.jboss.ws.common.utils.AbstractWSDLFilePublisher.publishSchemaImports(AbstractWSDLFilePublisher.java:257)
            at org.jboss.wsf.stack.cxf.deployment.WSDLFilePublisher.publishWsdlFiles(WSDLFilePublisher.java:92)
            ... 14 more
    
  • Removing the wsdlLocation from the EJB-JAR fixes this error, but the use case is that JBoss should be able to load the schema from the classpath since the WSDL was loaded from the classpath.

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.0.x
    • 6.1.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