Announcement Announcement Module
No announcement yet.
Unable to locate Spring NamespaceHandler for XML schema namespace /schema/context Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to locate Spring NamespaceHandler for XML schema namespace /schema/context


    I'm using Spring 2.5.5 & Maven 2.0.9.

    I'm using the maven assembly plugin (jar-with-dependencies) to generate a single assembly (in jar format). Since i'm using the "jar-with-dependencies", all dependencies are extracted to the final jar.

    When I start my application, I get an error as below.

    Initially the problem was occurring because i was using version 2.2-beta-1 of maven-assembly-plugin, which doesnt correctly generate the META-INF\spring.schemas & spring.handlers. Then on using version 2.2-beta-2, all the required spring.schemas & spring.handlers were being written to the META-INF folder in the final inflated jar.

    Even then i'm getting the same error.

    However, if i run my application using Eclipse, it works fine.

    Interestingly, when i try to open the spring-context-2.5.xsd (springframework/schema/context/spring-context-2.5.xsd) with some XML validation tool (i used XMLSpy), i get errors like:

    'beans:identifiedType' must refer to an existing simple or complex
    Error location: xsd:schema / xsd:element / xsd:complexType /xsd:complexContent / xsd:extension / at base

    Here's the stack trace of my application:
    Exception in thread "main" com.XYZ.core.common.exception.InitializationEx
    ception: Error in initialization of application wmc-core-metrics
    at com.wellmanage.core.common.ApplicationBase.main(Ap
    Caused by: org.springframework.beans.factory.parsing.BeanDefi nitionParsingExcept
    ion: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [springframework/schema/context]
    Offending resource: class path resource [spring-context/wmc-core-server-ctx.xml]
    at org.springframework.beans.factory.parsing.FailFast ProblemReporter.err
    at org.springframework.beans.factory.parsing.ReaderCo ntext.error(
    at org.springframework.beans.factory.parsing.ReaderCo ntext.error(
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.error(BeanDefinitionParserDelegat
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition
    at org.springframework.beans.factory.xml.BeanDefiniti onParserDelegate.parseCustomElement(BeanDefinition
    at org.springframework.beans.factory.xml.DefaultBeanD efinitionDocumentReader.parseBeanDefinitions(Defau

    Any pointers will be helpful.

  • #2
    I'm not sure where the bug is (suspect JRE) but you can workaoround it by not using an INDEX.LIST in the jar file. See


    • #3
      nkachr: were you ever able to resolve the issue?

      Dave, I manually removed the index.list file and ensured my manifest cp was correctly set, which it is. however, i still encounter the same issue as described by the original poster. Thoughts?


      • #4
        Resolved using shade plugin

        I ran into the same issue and was able to resolve it using the maven shade plugin in place of the assembly plugin:
                  <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                  <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                  <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">