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

  • 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
    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

    Comment

    Working...
    X