标签:form osc htm als nap plugin mamicode clip transform
1.我的maven项目在eclipse中Run As->Maven install,生成jar包后,用java -jar 包名 运行报错。报错图如下:
2.百度查了很多,有说版本号不一致的,有说缺少jar包的,有说用maven-shade-plugin插件的。
3.下面粘贴一下我的pom.xml和applicationContext.xml的代码
4.0.0 com.oscar.bdc.rpc
rpcthriftserver
0.0.1-SNAPSHOT jar rpcthriftserver http://maven.apache.org UTF-8 4.1.9.RELEASE junit
junit
3.8.1 test org.apache.thrift
libthrift
0.11.0 commons-io
commons-io
2.6 org.springframework
spring-core
${spring.version} commons-logging
commons-logging
org.springframework
spring-beans
${spring.version} org.springframework
spring-context
${spring.version} org.springframework
spring-context-support
${spring.version} org.springframework
spring-aop
${spring.version} commons-logging
commons-logging
org.springframework
spring-tx
${spring.version} org.springframework
spring-orm
${spring.version} org.springframework
spring-jdbc
${spring.version} org.apache.maven.plugins
maven-compiler-plugin
2.3.2 1.8 1.8 ${endorsed.dir}
maven-assembly-plugin
true
lib/ com.oscar.bdc.rpc.RPCThriftServerApplication jar-with-dependencies make-assembly package single
4.先把pom.xml缺少的jar包在applicationContext.xml中删掉引用,这个方案不可以。
5. 然后maven-shade-plugin这个插件,之前加了这个插件到pom.xml中不可以。
6.特别注意:是把maven-shade-plugin插件替换了maven-assembly-plugin插件。注意是替换。替换了就可以用了。运行没问题。下面粘贴替换后的pom.xml
4.0.0 com.oscar.bdc.rpc
rpcthriftserver
0.0.1-SNAPSHOT jar rpcthriftserver http://maven.apache.org UTF-8 4.1.9.RELEASE junit
junit
3.8.1 test org.apache.thrift
libthrift
0.11.0 commons-io
commons-io
2.6 org.springframework
spring-core
${spring.version} commons-logging
commons-logging
org.springframework
spring-beans
${spring.version} org.springframework
spring-context
${spring.version} org.springframework
spring-context-support
${spring.version} org.springframework
spring-aop
${spring.version} commons-logging
commons-logging
org.springframework
spring-tx
${spring.version} org.springframework
spring-orm
${spring.version} org.springframework
spring-jdbc
${spring.version} org.apache.maven.plugins
maven-compiler-plugin
2.3.2 1.8 1.8 ${endorsed.dir} org.apache.maven.plugins
maven-shade-plugin
3.1.1 package shade META-INF/spring.handlers META-INF/spring.schemas com.oscar.bdc.rpc.RPCThriftServerApplication
maven项目生成的jar包运行java -jar 包名报错 Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/context]
标签:form osc htm als nap plugin mamicode clip transform
原文地址:https://www.cnblogs.com/fzdsy/p/12722613.html