SLF4JLogFactory does not implement org.apache.commons.logging.LogFactory

在使用axis1.4时引入了

    <dependency>
      <groupId>commons-discovery</groupId>
      <artifactId>commons-discovery</artifactId>
      <version>0.5</version>
    </dependency>

<!-- 这是日志的包 -->
    <!-- log start -->
    <dependency>
      <groupId>log4j</groupId>
      <artifactId>log4j</artifactId>
      <version>${log4j.version}</version>
    </dependency> 
    <dependency>
      <groupId>org.eclipse.birt.runtime.3_7_1</groupId>
      <artifactId>javax.wsdl</artifactId>
      <version>1.5.1</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-log4j12</artifactId>
      <version>${org.slf4j}</version>
    </dependency>

当要new一个org.apache.axis.client.Service的时候会爆

org.apache.commons.discovery.DiscoveryException: Class org.apache.commons.logging.impl.SLF4JLogFactory does not implement org.apache.commons.logging.LogFactory

但是在 commons-logging包下根本没有SLF4JLogFactory类
这里写图片描述

解决方法

所以要引入

<dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>jcl-over-slf4j</artifactId>
      <version>1.7.22</version>
    </dependency>

可以看到这个包里有SLF4JLogFactory类并实现了LogFactory
这里写图片描述

posted @ 2017-03-14 13:41  A_yes  阅读(1088)  评论(0编辑  收藏  举报