Maven打jar包 Unable to locate Spring NamespaceHandler for XML schema namespace rabbit

Maven打jar包正常,但执行java -jar xxx.jar时,抛异常。

Unable to locate Spring NamespaceHandler for XML schema namespace rabbit

具体什么原因导致的未能查出,此处仅给出解决办法:

srping-rabbit.jar中的MATE-INF中的spring.handlers,spring.schemas,spring.tools中的数据拷贝到打包好的MATE-INF中对应的文件中

 

另贴出eclipse用maven打包的方法

pom.xml中和打包相关的配置:


		

			
				maven-compiler-plugin
				2.3.2
				
					1.7
					1.7
					UTF-8
				
			

			
				maven-assembly-plugin
				
					
						
							true
							com.cz.sintech.main.NettyMain
						
					
					
						jar-with-dependencies
					
					UTF-8
					UTF-8
					UTF-8
				
				
					
						make-my-jar-with-dependencies
						package
						
							single
						
					
				
			


		
	

 

 

eclipse添加本地maven:

Maven打jar包 Unable to locate Spring NamespaceHandler for XML schema namespace rabbit_第1张图片

Maven打jar包 Unable to locate Spring NamespaceHandler for XML schema namespace rabbit_第2张图片

 

 

JDK配置中加入MavenHome:

-Dmaven.multiModuleProjectDirectory=M2_HOME

Maven打jar包 Unable to locate Spring NamespaceHandler for XML schema namespace rabbit_第3张图片

Maven打jar包 Unable to locate Spring NamespaceHandler for XML schema namespace rabbit_第4张图片

Maven打jar包 Unable to locate Spring NamespaceHandler for XML schema namespace rabbit_第5张图片

-Xms2048m
-Xmx4096m
-XX:PermSize=128M
-XX:MaxNewSize=512m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=48m
-Dio.netty.leakDetectionLevel=paranoid

如果有乱码,把Common里的Encoding改为GBKMaven打jar包 Unable to locate Spring NamespaceHandler for XML schema namespace rabbit_第6张图片

 

你可能感兴趣的:(maven)