title: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace
body: <p>I am facing a lot of issues one after the other. Let me note it down properly -</p>
  
  <p>I am implementing Springframework cache and this was my original SpringCacheConfig.xml -</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:cache="http://www.springframework.org/schema/cache"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:c="http://www.springframework.org/schema/c"
     xmlns:p="http://www.springframework.org/schema/p"
     xmlns:hz="http://www.hazelcast.com/schema/spring"
     xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
                         http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd
                         http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
                         http://www.hazelcast.com/schema/spring http://www.hazelcast.com/schema/spring/hazelcast-spring.xsd"&gt; 
  </code></pre>
  
  <p>This was working fine in my laptop, but in the test VM, we were not able to download the XSD schema files from internet.</p>
  
  <p>So I changed the schemalocations to classpath -</p>
  
  <pre><code>&lt;beans xmlns="http://www.springframework.org/schema/beans"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:cache="http://www.springframework.org/schema/cache"
     xmlns:context="http://www.springframework.org/schema/context"
     xmlns:c="http://www.springframework.org/schema/c"
     xmlns:p="http://www.springframework.org/schema/p"
     xmlns:hz="http://www.hazelcast.com/schema/spring"
     xsi:schemaLocation="http://www.springframework.org/schema/beans classpath:spring-beans.xsd
                         http://www.springframework.org/schema/cache classpath:spring-cache.xsd
                         http://www.springframework.org/schema/context classpath:spring-context.xsd
                         http://www.hazelcast.com/schema/spring classpath:hazelcast-spring.xsd"&gt;
  </code></pre>
  
  <p>So now the XSD files were picked up. But the downloaded spring-context.xsd file has the following content -</p>
  
  <pre><code>&lt;xsd:import namespace="http://www.springframework.org/schema/beans" schemaLocation="https://www.springframework.org/schema/beans/spring-beans-4.3.xsd"/&gt;
  &lt;xsd:import namespace="http://www.springframework.org/schema/tool" schemaLocation="https://www.springframework.org/schema/tool/spring-tool-4.3.xsd"/&gt;
  </code></pre>
  
  <p>So I have again moved them to classpath.</p>
  
  <p>After these changes if I now execute our code, I am getting the following error -</p>
  
  <pre><code>Caused by: org.springframework.beans.factory.parsing.BeanDefinitionParsingException: 
  Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]
      Offending resource: class path resource [SpringCacheConfig.xml]
  </code></pre>
  
  <p>I tried to solve this problem by many previous posts, but not able to. </p>
  
  <p>The pom is already including spring-context related jars -</p>
  
  <pre><code>&lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
          &lt;version&gt;${springframework.version}&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context&lt;/artifactId&gt;
          &lt;version&gt;${springframework.version}&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
          &lt;groupId&gt;org.springframework&lt;/groupId&gt;
          &lt;artifactId&gt;spring-context-support&lt;/artifactId&gt;
          &lt;version&gt;${springframework.version}&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>These jars are not packaged within the main jar, but are available at </p>
  
  <blockquote>
    <p>modules/system/layers/thirdparty/org/springframework/main/spring-context-4.3.1.RELEASE.jar.</p>
  </blockquote>
  
  <p>But why the jar couldn't be found?</p>
  
  <p>I also tried the shade plugin, but still dependency jars are not included -
  <a href="https://stackoverflow.com/questions/11160534/how-to-create-spring-based-executable-jar-with-maven">How to create spring-based executable jar with maven?</a></p>
  
  <p>What else should I think about?</p>
  
  <p>I don't have the META-INF/spring.handlers etc Spring related files within the jar. Can it be the issue?</p>