title: SAXParseException; src-resolve: Cannot resolve the name '...' to a(n) 'type definition' component
body: <p>I'm trying to do schema validation, currently using a <code>javax.xml.validation.SchemaFactory</code>. Unfortunately When I call the <code>newSchema(Source schema)</code> function, I get the following error:</p>
  
  <pre><code>Caused by: org.xml.sax.SAXParseException; systemId: file:/C:/Users/C42056/Documents/workspace-sts-3.2.0.RELEASE/cec-sample-ws-integration-2-war/target/classes/WEB-INF/schemas/xsd/individual/PrivateComponentTypes_4_0.xsd; lineNumber: 33; columnNumber: 88; src-resolve: Cannot resolve the name 'utility:ObjectStatusDateType' to a(n) 'type definition' component.
  at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
  at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source)
  at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
  at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
  at org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaError(Unknown Source)
  at org.apache.xerces.impl.xs.traversers.XSDHandler.getGlobalDecl(Unknown Source)
  at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseNamedElement(Unknown Source)
  at org.apache.xerces.impl.xs.traversers.XSDElementTraverser.traverseLocal(Unknown Source)
  at org.apache.xerces.impl.xs.traversers.XSDHandler.traverseLocalElements(Unknown Source)
  at org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(Unknown Source)
  at org.apache.xerces.impl.xs.XMLSchemaLoader.loadSchema(Unknown Source)
  at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
  at org.apache.xerces.impl.xs.XMLSchemaLoader.loadGrammar(Unknown Source)
  at org.apache.xerces.jaxp.validation.XMLSchemaFactory.newSchema(Unknown Source)
  at com.sei.ec.xml.validation.SimpleXmlValidator.loadSchema(SimpleXmlValidator.java:70)
  at com.sei.ec.xml.validation.SimpleXmlValidator.&lt;init&gt;(SimpleXmlValidator.java:83)
  ... 75 more
  </code></pre>
  
  <p>The <code>utility:ObjectStatusDateType</code> element is used in the .xsd file which I am passing into the <code>newSchema(Source schema)</code> function. I am importing the <code>ObjectStatusDateType</code> from another .xsd file- for which I have tripple checked the file path.  The <code>utility</code> namespace is also declared properly.</p>
  
  <p>Here's a snippet of the schema I am passing into the function (LocateCoverageIndexesByIdentifier_3_0.xsd):</p>
  
  <pre><code>&lt;xs:import namespace="http://www.sei.com/utility/1/" schemaLocation="../../utility/InvocationOutcome_1_0.xsd"/&gt;
  &lt;xs:import namespace="http://www.sei.com/utility/1/" schemaLocation="../../utility/ObjectHistory_1_0.xsd"/&gt;
  &lt;xs:import namespace="http://www.sei.com/individual/component/4/" schemaLocation="../PrivateComponentTypes_4_0.xsd"/&gt;
  &lt;xs:import namespace="http://www.sei.com/individual/shared/5/" schemaLocation="../IndividualTypes_5_0.xsd"/&gt;
  .
  . &lt;!-- Some more stuff --&gt;
  .
  &lt;xs:element name="coveragePeriod" 
              type="utility:ObjectStatusDateType" 
              minOccurs="0"/&gt;
  </code></pre>
  
  <p>And this is from ObjectHistory_1_0.xsd:</p>
  
  <pre><code>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
             xmlns:tns="http://www.sei.com/utility/1/" 
             targetNamespace="http://www.sei.com/utility/1/" 
             elementFormDefault="qualified" 
             attributeFormDefault="unqualified" 
             version="1.0"&gt;
  .
  . &lt;!-- Some more stuff --&gt;
  .
    &lt;xs:complexType name="ObjectStatusDateType"&gt;
      &lt;xs:sequence&gt;
        &lt;xs:element name="effectiveDate" type="xs:date"/&gt;
        &lt;xs:element name="cancelDate" type="xs:date" minOccurs="0"/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  </code></pre>
  
  <p>And lastly, the bean</p>
  
  <pre><code>&lt;bean id="locateClaimValidator" 
        class="com.sei.ec.xml.validation.SimpleXmlValidator"&gt;
    &lt;constructor-arg&gt;
      &lt;value&gt;classpath:WEB-INF/schemas/xsd/individual/ci/LocateCoverageIndexesByIdentifier_3_0.xsd
      &lt;/value&gt;
    &lt;/constructor-arg&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Has anybody encountered this type of issue before?</p>