• 使用webservice客户端访问遇到 java: 程序包org.apache.cxf.jaxws不存在 的问题


    如果你是Maven项目的话添加pom依赖;

    <dependency>
          <groupId>org.apache.cxf</groupId>
          <artifactId>cxf-bundle</artifactId>
          <version>2.7.18</version>
        </dependency>

    如不过不是用依赖导入而是lib包形式,就要去下载这个jar包

    cxf-bundle-2.7.18.jar library root
    此处的cxf-bundle版本要与下面的版本号一致,不然会报错,错误信息在下面给大家展示一下 
    <!-- 要进行jaxws 服务开发 -->
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-frontend-jaxws</artifactId>
      <version>2.7.18</version>
    </dependency>
    <!--内置jetty web服务器 cxf‐rt‐transports‐http‐jetty-->
    <dependency>
      <groupId>org.apache.cxf</groupId>
      <artifactId>cxf-rt-transports-http-jetty</artifactId>
      <version>2.7.18</version>
    </dependency>

     解决办法→org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory.createConduit

    Exception in thread "main" java.lang.AbstractMethodError: org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitFactory.createConduit(Lorg/apache/cxf/transport/http/HTTPTransportFactory;Lorg/apache/cxf/Bus;Lorg/apache/cxf/service/model/EndpointInfo;Lorg/apache/cxf/ws/addressing/EndpointReferenceType;)Lorg/apache/cxf/transport/http/HTTPConduit;
        at org.apache.cxf.transport.http.HTTPTransportFactory.getConduit(HTTPTransportFactory.java:233)
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:226)
        at org.apache.cxf.binding.soap.SoapTransportFactory.getConduit(SoapTransportFactory.java:233)
        at org.apache.cxf.endpoint.AbstractConduitSelector.createConduit(AbstractConduitSelector.java:144)
        at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:108)
        at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:63)
        at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:882)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:526)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:440)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:355)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:313)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
        at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:140)
        at com.sun.proxy.$Proxy37.sayHello(Unknown Source)
        at com.tao.service.Client.main(Client.java:29)
  • 相关阅读:
    09-23
    21-9-18日记1
    paho mqtt库使用记录
    UIS8811 的 NB-IOT 初认识(21-9-10工作记录 )
    go语言之异常捕获
    【原创】数据库基础之PostgreSQL
    【原创】Linux基础之fail2ban
    【原创】大叔经验分享(132)mac os 12启动idea失败
    【原创】大数据基础之Hadoop(3)hdfs diskbalancer
    【转】常用 Git 命令清单
  • 原文地址:https://www.cnblogs.com/wdyjt/p/14664765.html
Copyright © 2020-2023  润新知