解决spring.handlers spring.schemas spring.tooling 被覆盖问题,而出现Spring 3.0: Unable to locate Spring Namespa

原创 2013年12月03日 15:30:28

有两种方式

第一是修改maven pom 文件增加


<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-shade-plugin</artifactId>
        <version>2.1</version>
        <executions>
            <execution>
                <phase>package</phase>
                <goals>
                    <goal>shade</goal>
                </goals>
                <configuration>
                        <transformers>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">  
                                <resource>META-INF/spring.handlers</resource>  
                            </transformer>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">  
                                <resource>META-INF/spring.schemas</resource>  
                            </transformer>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">  
                                <resource>META-INF/spring.tooling</resource>  
                            </transformer>
                            <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
                                <mainClass>com.zufangbao.renterremind.Main</mainClass>
                            </transformer>
                        </transformers>
                </configuration>
            </execution>
        </executions>
      </plugin>


第二种方式,在已生成的jar包META-INF文件夹中增加三个文件即可

spring.handlers,spring.schemas,spring.tooling

spring.handlers:

http\://www.springframework.org/schema/tx=org.springframework.transaction.config.TxNamespaceHandler
http\://www.springframework.org/schema/aop=org.springframework.aop.config.AopNamespaceHandler
http\://www.springframework.org/schema/p=org.springframework.beans.factory.xml.SimplePropertyNamespaceHandler
http\://www.springframework.org/schema/util=org.springframework.beans.factory.xml.UtilNamespaceHandler
http\://www.springframework.org/schema/context=org.springframework.context.config.ContextNamespaceHandler
http\://www.springframework.org/schema/jee=org.springframework.ejb.config.JeeNamespaceHandler
http\://www.springframework.org/schema/lang=org.springframework.scripting.config.LangNamespaceHandler
http\://www.springframework.org/schema/task=org.springframework.scheduling.config.TaskNamespaceHandler
http\://www.springframework.org/schema/jdbc=org.springframework.jdbc.config.JdbcNamespaceHandler
http\://www.springframework.org/schema/oxm=org.springframework.oxm.config.OxmNamespaceHandler
http\://www.springframework.org/schema/webflow-config=org.springframework.webflow.config.WebFlowConfigNamespaceHandler
http\://www.springframework.org/schema/mvc=org.springframework.web.servlet.config.MvcNamespaceHandler

spring.schemas:

http\://www.springframework.org/schema/tx/spring-tx-2.0.xsd=org/springframework/transaction/config/spring-tx-2.0.xsd
http\://www.springframework.org/schema/tx/spring-tx-2.5.xsd=org/springframework/transaction/config/spring-tx-2.5.xsd
http\://www.springframework.org/schema/tx/spring-tx-3.0.xsd=org/springframework/transaction/config/spring-tx-3.0.xsd
http\://www.springframework.org/schema/tx/spring-tx.xsd=org/springframework/transaction/config/spring-tx-3.0.xsd
http\://www.springframework.org/schema/aop/spring-aop-2.0.xsd=org/springframework/aop/config/spring-aop-2.0.xsd
http\://www.springframework.org/schema/aop/spring-aop-2.5.xsd=org/springframework/aop/config/spring-aop-2.5.xsd
http\://www.springframework.org/schema/aop/spring-aop-3.0.xsd=org/springframework/aop/config/spring-aop-3.0.xsd
http\://www.springframework.org/schema/aop/spring-aop.xsd=org/springframework/aop/config/spring-aop-3.0.xsd
http\://www.springframework.org/schema/beans/spring-beans-2.0.xsd=org/springframework/beans/factory/xml/spring-beans-2.0.xsd
http\://www.springframework.org/schema/beans/spring-beans-2.5.xsd=org/springframework/beans/factory/xml/spring-beans-2.5.xsd
http\://www.springframework.org/schema/beans/spring-beans-3.0.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd
http\://www.springframework.org/schema/beans/spring-beans.xsd=org/springframework/beans/factory/xml/spring-beans-3.0.xsd
http\://www.springframework.org/schema/tool/spring-tool-2.0.xsd=org/springframework/beans/factory/xml/spring-tool-2.0.xsd
http\://www.springframework.org/schema/tool/spring-tool-2.5.xsd=org/springframework/beans/factory/xml/spring-tool-2.5.xsd
http\://www.springframework.org/schema/tool/spring-tool-3.0.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd
http\://www.springframework.org/schema/tool/spring-tool.xsd=org/springframework/beans/factory/xml/spring-tool-3.0.xsd
http\://www.springframework.org/schema/util/spring-util-2.0.xsd=org/springframework/beans/factory/xml/spring-util-2.0.xsd
http\://www.springframework.org/schema/util/spring-util-2.5.xsd=org/springframework/beans/factory/xml/spring-util-2.5.xsd
http\://www.springframework.org/schema/util/spring-util-3.0.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd
http\://www.springframework.org/schema/util/spring-util.xsd=org/springframework/beans/factory/xml/spring-util-3.0.xsd
http\://www.springframework.org/schema/context/spring-context-2.5.xsd=org/springframework/context/config/spring-context-2.5.xsd
http\://www.springframework.org/schema/context/spring-context-3.0.xsd=org/springframework/context/config/spring-context-3.0.xsd
http\://www.springframework.org/schema/context/spring-context.xsd=org/springframework/context/config/spring-context-3.0.xsd
http\://www.springframework.org/schema/jee/spring-jee-2.0.xsd=org/springframework/ejb/config/spring-jee-2.0.xsd
http\://www.springframework.org/schema/jee/spring-jee-2.5.xsd=org/springframework/ejb/config/spring-jee-2.5.xsd
http\://www.springframework.org/schema/jee/spring-jee-3.0.xsd=org/springframework/ejb/config/spring-jee-3.0.xsd
http\://www.springframework.org/schema/jee/spring-jee.xsd=org/springframework/ejb/config/spring-jee-3.0.xsd
http\://www.springframework.org/schema/lang/spring-lang-2.0.xsd=org/springframework/scripting/config/spring-lang-2.0.xsd
http\://www.springframework.org/schema/lang/spring-lang-2.5.xsd=org/springframework/scripting/config/spring-lang-2.5.xsd
http\://www.springframework.org/schema/lang/spring-lang-3.0.xsd=org/springframework/scripting/config/spring-lang-3.0.xsd
http\://www.springframework.org/schema/lang/spring-lang.xsd=org/springframework/scripting/config/spring-lang-3.0.xsd
http\://www.springframework.org/schema/task/spring-task-3.0.xsd=org/springframework/scheduling/config/spring-task-3.0.xsd
http\://www.springframework.org/schema/task/spring-task.xsd=org/springframework/scheduling/config/spring-task-3.0.xsd
http\://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd=org/springframework/jdbc/config/spring-jdbc-3.0.xsd
http\://www.springframework.org/schema/jdbc/spring-jdbc.xsd=org/springframework/jdbc/config/spring-jdbc-3.0.xsd
http\://www.springframework.org/schema/oxm/spring-oxm-3.0.xsd=org/springframework/oxm/config/spring-oxm-3.0.xsd
http\://www.springframework.org/schema/oxm/spring-oxm.xsd=org/springframework/oxm/config/spring-oxm-3.0.xsd
http\://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd=org/springframework/webflow/config/spring-webflow-config-2.0.xsd
http\://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd
http\://www.springframework.org/schema/mvc/spring-mvc.xsd=org/springframework/web/servlet/config/spring-mvc-3.0.xsd


spring.tooling

# Tooling related information for the tx namespace
http\://www.springframework.org/schema/tx@name=tx Namespace
http\://www.springframework.org/schema/tx@prefix=tx
http\://www.springframework.org/schema/tx@icon=org/springframework/transaction/config/spring-tx.gif
http\://www.springframework.org/schema/aop@name=aop Namespace
http\://www.springframework.org/schema/aop@prefix=aop
http\://www.springframework.org/schema/aop@icon=org/springframework/aop/config/spring-aop.gif
http\://www.springframework.org/schema/beans@name=beans Namespace
http\://www.springframework.org/schema/beans@prefix=beans
http\://www.springframework.org/schema/beans@icon=org/springframework/beans/factory/xml/spring-beans.gif
http\://www.springframework.org/schema/util@name=util Namespace
http\://www.springframework.org/schema/util@prefix=util
http\://www.springframework.org/schema/util@icon=org/springframework/beans/factory/xml/spring-util.gif
http\://www.springframework.org/schema/context@name=context Namespace
http\://www.springframework.org/schema/context@prefix=context
http\://www.springframework.org/schema/context@icon=org/springframework/context/config/spring-context.gif
http\://www.springframework.org/schema/jee@name=jee Namespace
http\://www.springframework.org/schema/jee@prefix=jee
http\://www.springframework.org/schema/jee@icon=org/springframework/ejb/config/spring-jee.gif
http\://www.springframework.org/schema/task@name=task Namespace
http\://www.springframework.org/schema/task@prefix=task
http\://www.springframework.org/schema/task@icon=org/springframework/scheduling/config/spring-task.gif
http\://www.springframework.org/schema/lang@name=lang Namespace
http\://www.springframework.org/schema/lang@prefix=lang
http\://www.springframework.org/schema/lang@icon=org/springframework/scripting/config/spring-lang.gif
http\://www.springframework.org/schema/jdbc@name=jdbc Namespace
http\://www.springframework.org/schema/jdbc@prefix=jdbc
http\://www.springframework.org/schema/jdbc@icon=org/springframework/jdbc/config/spring-jdbc.gif
http\://www.springframework.org/schema/oxm@name=oxm Namespace
http\://www.springframework.org/schema/oxm@prefix=oxm
http\://www.springframework.org/schema/oxm@icon=org/springframework/oxm/config/spring-oxm.gif
http\://www.springframework.org/schema/mvc@name=mvc Namespace
http\://www.springframework.org/schema/mvc@prefix=mvc
http\://www.springframework.org/schema/mvc@icon=org/springframework/web/servlet/config/spring-mvc.gif

读Spring的源代码七:spring.handlers的加载过程

要实现自定义的xml配置,需要有两个默认spring配置文件来支持。一个是spring.schemas,一个是spring.handlers,前者是为了验证你自定义的xml配置文件是否符合你的格式要求...
  • kaka508
  • kaka508
  • 2015年08月03日 16:50
  • 2277

spring 打入jar包 xml配置路径,加载异常等常见问题解决方法

有些情况我们需在java工程而不是 web工程里面使用spring 并且需要打成jar包单独使用,这个时候spring的配置文件加载路径容易出错。大家可以参考如下配置,java工程目录 然后启...

Idea spring 自定义spring.handlers spring.schemas maven不识别问题

在idea编程环境下,在自定义spring的xsd时,需要编写spring.handlers,spring.schemas文件。但是idea默认maven没有META-INF文件夹,需要在resour...

Spring 命名空间配置

xmlns是xml namespace的缩写,也就是XML命名空间,xmlns 属性可以在文档中定义一个或多个可供选择的命名空间。今天小编要跟大家讲解的是Spring的命名空间配置。 首先,第一步要...

Storm系列(三):创建Maven项目打包提交wordcount到Storm集群

在上一篇博客中,我们通过Storm.Net.Adapter创建了一个使用Csharp编写的Storm Topology - wordcount。本文将介绍如何编写Java端的程序以及如何发布到测试的S...
  • ziyunhx
  • ziyunhx
  • 2015年06月25日 21:34
  • 985

Unable to locate Spring NamespaceHandler for XML schema namespace异常解决

测试环境: eclipse4.4 Spring3 MySQL5 今天测试Spring的AOP时出现以下异常: org.springframework.beans.fact...

Spring 3.0: Unable to locate Spring NamespaceHandler for XML schema namespace

昨日,在原本应用中添加了关于webService的调用,使用了Apache CXF 框架,并将其集成到了Spring中。   当时集成时,使用了如下的jar包(Spring2.5.5.JP...

Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/sc

1、错误描述org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration proble...

Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace

今天自己整合SSM,总是报如下的错误,怎么也解决不了,最后发现居然是Mybatis的jar包版本低了,而且少了一个jar包。。。 报错用的jar包是替换的jar包为 org.springframe...

spring boot启动报Unable to start EmbeddedWebApplicationContext问题解决方案

异常全文如下: org.springframework.context.ApplicationContextException: Unable to start embedded container;...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:解决spring.handlers spring.schemas spring.tooling 被覆盖问题,而出现Spring 3.0: Unable to locate Spring Namespa
举报原因:
原因补充:

(最多只允许输入30个字)