首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >CXF 2.4.2:未找到命名空间http://schemas.xmlsoap.org/soap/http的管道启动器

CXF 2.4.2:未找到命名空间http://schemas.xmlsoap.org/soap/http的管道启动器
EN

Stack Overflow用户
提问于 2011-09-30 22:26:05
回答 8查看 36.6K关注 0票数 22

我有一个从wsdl生成的服务客户机。我正在尝试调用远程服务,但收到如下所示的管道启动器错误。我尝试了许多解决方案,但都没有成功。

我找到了推荐使用http-jetty扩展的解决方案(旧帖子)。我认为这对我来说没有意义,因为服务器不是在本地运行的。

我还发现最近的配置对我有帮助,它是一个示例cxf.xml文件,其中包含:

代码语言:javascript
复制
<bean class="org.apache.cxf.transport.local.LocalTransportFactory"
    lazy-init="false">
    <property name="transportIds">
        <list>
            <value>http://cxf.apache.org/transports/local</value>
            <value>http://cxf.apache.org/transports/http</value>
            <value>http://schemas.xmlsoap.org/soap/http</value>
            <value>http://schemas.xmlsoap.org/wsdl/soap/http</value>
        </list>
    </property>
</bean>

此配置提供了有关如何配置传输工厂并将其绑定到http://schemas.xmlsoap.org/soap/http的指导。当我在HTTPTransportFactory,中尝试这样做时,我收到一个异常,它无法初始化(没有这样的方法错误)。

代码语言:javascript
复制
Caused by: org.apache.cxf.BusException: No conduit initiator was found for the namespace http://schemas.xmlsoap.org/soap/http.
    at org.apache.cxf.transport.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:112)
    at org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:73)
    at org.apache.cxf.endpoint.UpfrontConduitSelector.prepare(UpfrontConduitSelector.java:61)
    at org.apache.cxf.endpoint.ClientImpl.prepareConduitSelector(ClientImpl.java:708)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:476)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:309)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:261)
    at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:127)

预防措施:在这一点上,我将停止将我的CXF客户端升级到2.4.2的尝试,并回退到可以工作的最旧版本(2.2系列)。这并不理想。

我想继续升级。任何关于如何配置CXF 2.4.X以便我的客户端仅HTTP SOAP配置正确连接的建议都将非常有用。

EN

回答 8

Stack Overflow用户

回答已采纳

发布于 2013-04-08 19:32:23

就像以前的帖子推荐的那样,这可以通过添加cxf-rt-transports-http-jetty来解决。

票数 26
EN

Stack Overflow用户

发布于 2012-11-07 01:32:05

客户端上的无效url格式可能会导致此错误。例如,如果使用http传输,则应定义"http://localhost:8080/services/{smth}“url。如果您定义"localhost:8080/services/{smth}“而不带http前缀-您将收到这样的错误。

票数 19
EN

Stack Overflow用户

发布于 2017-03-07 09:24:17

我也面临着同样的问题。通过IntelliJ,一切都运行得很好,但maven surefire却抛出了错误。最终找到了答案。这就是它:

基本上,每个cxf库都提供了一个META-INF/cxf/bus-extsions.txt文件,打包程序的默认行为是替换该文件,从而导致该文件不完整。通过将着色器配置为附加而不是替换,cxf内容将正确运行。

将此代码添加到pom的构建部分的插件部分中:

代码语言:javascript
复制
  <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-shade-plugin</artifactId>
    <version>1.4</version>
    <configuration>
      <createDependencyReducedPom>true</createDependencyReducedPom>
    </configuration>
    <executions>
      <execution>
        <phase>package</phase>
        <goals>
          <goal>shade</goal>
        </goals>
        <configuration>
          <transformers>
            <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
              <resource>META-INF/cxf/bus-extensions.txt</resource>
            </transformer>
          </transformers>
          <filters>
            <filter>
              <artifact>*:*</artifact>
              <excludes>
                <exclude>META-INF/*.SF</exclude>
                <exclude>META-INF/*.DSA</exclude>
                <exclude>META-INF/*.RSA</exclude>
              </excludes>
            </filter>
          </filters>
        </configuration>
      </execution>
    </executions>
  </plugin>
票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7611803

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档