Search code examples
tomcatembedded-tomcat-7

Embedded Tomcat: Unable to locate Spring NamespaceHandler for XML schema namespace


I am trying to run my Embedded Tomcat Application and I am getting following error:

BeanDefinitionParsingException: 
Configuration problem: 
Unable to locate Spring NamespaceHandler for XML schema namespace
[http://www.springframework.org/schema/tx]
Offending resource: ServletContext resource [/WEB-INF/applicationContext.xml]

I am pretty confident I have everything correctly on my classpath - you can see the tx as /transaction/:

$ jar tf webapp.jar | grep 'springframework/[a-z]*/$'
org/springframework/cache/
org/springframework/context/
org/springframework/ejb/
org/springframework/format/
org/springframework/instrument/
org/springframework/jmx/
org/springframework/jndi/
org/springframework/remoting/
org/springframework/scheduling/
org/springframework/scripting/
org/springframework/stereotype/
org/springframework/ui/
org/springframework/validation/
org/springframework/aop/
org/springframework/asm/
org/springframework/beans/
org/springframework/core/
org/springframework/util/
org/springframework/expression/
org/springframework/orm/
org/springframework/jdbc/
org/springframework/dao/
org/springframework/jca/
org/springframework/transaction/
org/springframework/web/
org/springframework/mail/
org/springframework/http/
org/springframework/mock/

What I don't understand is that running the application in Intellij IDEA works as expected and deploying to Tomcat Server as well.

What can be the problem? Where should I look? Thanks.


Solution

  • I found the answer for my problem here:

    http://forum.springsource.org/showthread.php?48787-Unable-to-locate-NamespaceHandler-when-using-context-annotation-config&p=191820#post191820

    which leads to here:

    http://forum.springsource.org/showthread.php?48787-Unable-to-locate-NamespaceHandler-when-using-context-annotation-config&p=191820#post191820

    The problem is the assembly maven plugin which unpacks all jars and overwrites the same contents.