zoukankan      html  css  js  c++  java
  • 运行可执行jar包出错

    用maven创建的项目(可执行jar包),用eclipse开发过程中没问题,但是通过控制台java -jar指令执行出现以下错误:Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/tx]

    Offending resource: class path resource [applicationContext.xml]

    解决方法:

    <build>
    <plugins>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>1.2.1</version>
    <executions>
    <execution>
    <phase>package</phase>
    <goals>
    <goal>shade</goal>
    </goals>
    <configuration>
    <transformers>
    <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
    <mainClass>com.test.App</mainClass>
    </transformer>
    <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>
    </transformers>
    </configuration>
    </execution>
    </executions>
    </plugin>
    </plugins>

  • 相关阅读:
    寻找重复数
    除自身以外数组的乘积
    汇总区间
    Atlas 分表功能
    Atlas 读写分离 & Atlas + MHA 故障自动恢复
    MHA 的 Binlog Server & VIP 漂移
    MHA 高可用介绍
    MySQL 主从复制(下)
    MySQL 基础面试题
    MySQL 主从复制(上)
  • 原文地址:https://www.cnblogs.com/symcious/p/5550628.html
Copyright © 2011-2022 走看看