启动类:
问题描述:一运行启动类log4j日志信息输出马上就结束了,显示如下信息
? 2020-06-20 05:52:33 using logger: org.apache.dubbo.common.logger.log4j.Log4jLoggerAdapter
org.apache.dubbo.container.Main 2020-06-20 05:52:34 [DUBBO] Duplicate class org/apache/dubbo/common/Version.class in 2 jar [file:/D:/Maven/repository/org/apache/dubbo/dubbo/2.7.6/dubbo-2.7.6.jar!/org/apache/dubbo/common/Version.class, file:/D:/Maven/repository/org/apache/dubbo/dubbo-common/2.7.6/dubbo-common-2.7.6.jar!/org/apache/dubbo/common/Version.class], dubbo version: 2.7.6, current host: 192.168.66.1
org.apache.dubbo.container.Main 2020-06-20 05:52:34 [DUBBO] Use container type([spring]) to run dubbo serivce., dubbo version: 2.7.6, current host: 192.168.66.1
org.springframework.context.support.AbstractApplicationContext 2020-06-20 05:52:34 Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@35bbe5e8
org.apache.dubbo.container.Main 2020-06-20 05:52:34 [DUBBO] Dubbo SpringContainer started!, dubbo version: 2.7.6, current host: 192.168.66.1
[2020-06-20 17:52:34] Dubbo service server started!
原因是,你在resources/META-INF/spring下的xml文件根本没有被解析运行。所以就是你的xml文件放错位置了,我是因为建包的时候,直接写META-INF.spring这样两个包一起建造成的错误,后面就先建META-INF包,再建spring包再把xml文件放在spring包下就没问题了
虽然两个包一起建跟一个包一个包的建表面看起来没区别,但是路径就不一样了,所以一定要注意xml存放的位置,一定是要放在resources/META-INF/spring包的下面
版权声明:本文为haitu_97原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。