zoukankan      html  css  js  c++  java
  • jar包冲突问题

    今天学习Web Service时遇到如下问题

    2017-10-25 13:52:46 org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
    信息: Creating Service {http://ws.com/}HelloWSImplService from class com.ws.HelloWS
    2017-10-25 13:52:47 org.apache.cxf.endpoint.ServerImpl initDestination
    信息: Setting the server's publish address to be http://localhost:8888/20171025/hellows
    Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
     at org.eclipse.jetty.util.log.JettyAwareLogger.log(JettyAwareLogger.java:607)
     at org.eclipse.jetty.util.log.JettyAwareLogger.warn(JettyAwareLogger.java:431)
     at org.eclipse.jetty.util.log.Slf4jLog.warn(Slf4jLog.java:69)
     at org.eclipse.jetty.util.component.AbstractLifeCycle.setFailed(AbstractLifeCycle.java:204)
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:74)
     at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:417)
     at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:179)
     at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:53)
     at org.apache.cxf.binding.AbstractBindingFactory.addListener(AbstractBindingFactory.java:95)
     at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:896)
     at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:123)
     at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:362)
     at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:251)
     at org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:155)
     at javax.xml.ws.Endpoint.publish(Endpoint.java:170)
     at com.ws.server.ServerTest.main(Unknown Source)

    这是由于Slf4j jar包与其他jar冲突导致。那问题如何解决呢?

    1、首先我们需要找出冲突的jar包都有哪些.

      ctrl+shift+T,连jar包中的类也可以搜索出来。这个可以很好的查找jar包冲突的问题。看某个class在哪些jar包中存在.

    2、删除里面的slf4j就没有出现这个情况了。

  • 相关阅读:
    [bzoj1613 Usaco2007 Jan]Running贝茜的晨练计划
    [bzoj1600][Usaco2008 Oct]建造栅栏
    [bzoj3208]花神的秒题计划I
    [vijos1011]滑雪
    [noip2007 pjt3] 守望者的逃离
    DP(1) 背包
    快速幂 模板及应用
    BZOJ1303: [CQOI2009]中位数图
    BZOJ1083: [SCOI2005]繁忙的都市
    Bzoj1084: [SCOI2005]最大子矩阵
  • 原文地址:https://www.cnblogs.com/huadiyatou/p/7728563.html
Copyright © 2011-2022 走看看