2014-11-04 78 views
0
[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> 

回答

1

問題的發生是因爲前面我使用的是單spring2.5.jar升級到3.x後,我曾多次罐子。 Java webstart在解析不同jar中的namespacehandler文件時遇到了一些問題。

我的解決方案:我爲我的所有彈簧模塊構建了一個jar文件(using this),並將其包含在我的項目中。

相關問題