Spring:无法找到XML命名空间的Spring NamespaceHandler
问题描述:
[http://www.springframework.org/schema/tx]
我在maven pom.xml中包含了jar文件。当我在eclipse中运行它时,swing应用程序工作正常。但是,当我尝试从jnlp文件运行它时,它会引发此错误。我在jnlp文件中添加了spring-tx
jar。这是我的春天上下文文件。Spring:无法找到XML命名空间的Spring NamespaceHandler
<!-- from the file 'context.xml' -->
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop.xsd">
下面是pom.xml中:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${org.springframework.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${org.springframework.version}</version>
</dependency>
答
问题的发生是因为前面我使用的是单spring2.5.jar升级到3.x后,我曾多次罐子。 Java webstart在解析不同jar中的namespacehandler文件时遇到了一些问题。
我的解决方案:我为我的所有弹簧模块构建了一个jar文件(using this),并将其包含在我的项目中。