Results 1 to 2 of 2

Thread: Re: Unable to locate Spring NamespaceHandler for XML schema namespace

  1. #1

    Default Re: Unable to locate Spring NamespaceHandler for XML schema namespace

    Hello,

    I have an application that has a main and the application context is loaded with the ClassPathXmlApplicationContext.

    It can be packged in a war and deployed to Tomcat for example, in which case everything works perfectly, however when running the jar stand alone I run into this issue. I have all the dependencies for the application in the manifest, including Spring of course.

    I have taken the spring.handlers, spring.schemas and spring.tooling and added them to my META-INF with all the handler definitions and then all is well, but this is a really dirty hack!

    My best guess is that the boot classloader is looking for XML libraries, like Xerces, but it is the parent classloader and doesn't see Spring further down the hierarchy. Or it could be a security thing, I do have the Spring security on the path as well, although I don't need it.

    My directory structure is:

    Code:
    ikube-core-1.0.jar
       lib/
          spring-core.....jar
          ...
    The command line would be: java -jar target/ikube-core-1.0.jar

    All code is available on Google Code - http://code.google.com/p/ikube/.

    Thanks in advance!

    Cheers,
    Michael

  2. #2
    Join Date
    Aug 2006
    Location
    Arequipa-Peru / South America
    Posts
    2,796

    Default

    Hello

    Be aware that the structures about a .war and .jar application are different

    1) did you change in your pom.xml file
    <packaging>war</packaging> to <packaging>jar</packaging> ?

    2) use mvn clean compile and later mvn package, then go to your target directory and run there your java -jar command

    3) copy here the complete error stack trace
    - Manuel Jordan

    Kill Your Pride, Share Your Knowledge With All
    The Fear Of The LORD Is The Beginning Of Knowledge, But Fools Despise Wisdom And Discipline. Proverbs 1:7

    Blog


    Technical Reviewer of Apress

    • Pro SpringSource dm Server
    • Spring Enterprise Recipes: A Problem-Solution Approach
    • Spring Recipes: A Problem-Solution Approach, 2nd Edition
    • Pro Spring Integration
    • Pro Spring Batch
    • Pro Spring 3
    • Pro Spring MVC: With Web Flow
    • Pro Spring Security

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •