Search code examples
xsdwebsphere

Defining relative path for an application in IBM WebSphere


I have a couple of XSD's in my application. Something like the below,

 XSD
   common
      common.xsd
   request
      request.xsd
   response
      response.xsd

I have to use the common.xsd in the request and response xsd's. So I have used import statement. The config is as below,

<xsd:import namespace="www.some.namespace.com" schemaLocation="../common/common.xsd"/>

The problem here is, this works absolutely fine in Tomcat. But when I deploy the same application in WebSphere, it is throwing error as file not found. In the logs, I could see WebSpher is looking for the xsd in the IBM installation folder. The path it is looking is, "C:/IBM installation folder/common/common.xsd".

Can anyone help ?

Thanks in advance.


Solution

  • Just remove the schemaLocation attribute of the import element. Just keep the namespace attribute alone and be sure that you are importing the correct namespace.