title: org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name?
body: <p>I am getting below error while maven build on Linux server  though on windows
  machine it works fine</p>
  
  <pre><code>org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'customer:CustomerApplication' to a(n) 'element declaration' component.
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
      at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
      at com.sun.org.apache.xerces.internal.impl.xs.traversers.XSDHandler.reportSchemaErr(XSDHandler.java:2537)
  </code></pre>
  
  <p><strong>Here is relevant snippet from pom.xml</strong></p>
  
  <pre><code>   &lt;plugin&gt;
          &lt;groupId&gt;org.jvnet.jaxb2.maven2&lt;/groupId&gt;
          &lt;artifactId&gt;maven-jaxb2-plugin&lt;/artifactId&gt;
          &lt;configuration&gt;
              &lt;schemaDirectory&gt;src/main/resources/META-INF/schema&lt;/schemaDirectory&gt;
          &lt;/configuration&gt;
          &lt;executions&gt;
              &lt;execution&gt;
                  &lt;goals&gt;
                      &lt;goal&gt;generate&lt;/goal&gt;
                  &lt;/goals&gt;
              &lt;/execution&gt;
          &lt;/executions&gt;
      &lt;/plugin&gt;
  </code></pre>
  
  <p><strong>First XSD relevant part</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="windows-1252" ?&gt;
  &lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns="http://www.cohbe.org/CustomerRequest"
              xmlns:customer="http://www.cohbe.org/customer"
              targetNamespace="http://www.cohbe.org/CustomerRequest"
              elementFormDefault="qualified"&gt;
      &lt;xsd:import schemaLocation="CustomerDetails.xsd"
                namespace="http://www.cohbe.org/customer"/&gt;
      &lt;xsd:element name="CustomerNewRequest"&gt;
          &lt;xsd:complexType&gt;
              &lt;xsd:sequence&gt;
                  &lt;xsd:element ref="customer:CustomerApplicationDetail" minOccurs="0"/&gt;
              &lt;/xsd:sequence&gt;
          &lt;/xsd:complexType&gt;
      &lt;/xsd:element&gt;
      ...
  &lt;/xsd:schema&gt;
  </code></pre>
  
  <p><strong>CustomerDetails.xsd location is same as of First XSD. Here is relevant part</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsd:schema version="2.15" 
              xmlns:xsd="http://www.w3.org/2001/XMLSchema"
              xmlns="http://www.cohbe.org/CustDetails"
              targetNamespace="http://www.cohbe.org/CustDetails"
              xmlns:countries="http://www.cohbe.org/Counties"
              elementFormDefault="qualified"&gt;
      &lt;!-- Version 2.15 --&gt;
      &lt;xsd:import namespace="http://www.cohbe.org/states" schemaLocation="States.xsd"/&gt;
      &lt;xsd:element name="CustomerApplicationDetail"
                 type="CustomerApplicationDetail"/&gt;
      &lt;xsd:complexType name="CustomerApplicationDetail"&gt;
  
      .....
      &lt;/xsd:schema&gt;
  </code></pre>
  
  <p><strong>UPDATE:-</strong> <strong>second file attributes are :-</strong></p>
  
  <pre><code>      xmlns="http://www.cohbe.org/customer"
              targetNamespace="http://www.cohbe.org/customer"
  </code></pre>
  
  <p><strong>instead of</strong></p>
  
  <pre><code>      xmlns="http://www.cohbe.org/CustDetails"
              targetNamespace="http://www.cohbe.org/CustDetails"
  </code></pre>
  
  <p>It was copy/paste error in this question So I am getting same error i.e <code>org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name</code></p>