Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/345.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java CXF 2.4.2:未找到命名空间的导管启动器http://schemas.xmlsoap.org/soap/http_Java_Soap_Cxf - Fatal编程技术网

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

Java CXF 2.4.2:未找到命名空间的导管启动器http://schemas.xmlsoap.org/soap/http,java,soap,cxf,Java,Soap,Cxf,我有一个从wsdl生成的服务客户机。我正在尝试调用远程服务,收到下面显示的导管启动器错误。我尝试了许多解决办法,但都没有成功 我找到了建议使用http jetty扩展的解决方案(旧帖子)。我认为这对我来说没有意义,因为服务器没有在本地运行 我还发现帮助我的最接近的配置是一个示例cxf.xml文件,该文件包含: <bean class="org.apache.cxf.transport.local.LocalTransportFactory" lazy-init="false">

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

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

我还发现帮助我的最接近的配置是一个示例cxf.xml文件,该文件包含:

<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>
预防措施:此时,我将停止尝试将我的CXF客户端升级到2.4.2,并退回到最旧的可用版本(2.2系列)。这并不理想


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

您是否将CXF-rt-binding-SOAP-2.4.X.jar放入了类路径中?

此错误可能是由客户端上无效的url格式产生的。例如,如果使用http传输,则应定义“http://localhost:8080/services/{smth}url。如果您在没有http前缀的情况下定义“localhost:8080/services/{smth}”,您会收到这样一个错误。

就像以前的文章推荐的那样,这可以通过将cxf rt transports http jetty添加到混合中来解决。

这并不特别适用于原始海报列出的示例URL,但当URL不正确时,我们会出现此错误。也就是说,我们在URL路径中列出了两次而不是一次的特定字符串。

最近我将cxf rt ws-security升级到了3.0.0。从那时起,我开始获取org.apache.cxf.BusException:没有为名称空间找到导管启动器。 位于org.apache.cxf.bus.managers.conduiteInitiatorManagerImpl.getConduiteInitiator(conduiteInitiatorManagerImpl.java:110)

在我将pom.xml中的以下JAR升级到3.0.0之后,这个问题得到了解决 cxf rt前端jaxws cxf rt ws策略
cxf rt传输http

我也面临同样的问题。通过IntelliJ,一切正常,但maven surefire出现了错误。终于找到了答案。这是:

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

将此添加到pom的“插件”部分的“构建”部分:

  <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>

org.apache.maven.plugins
maven阴影插件
1.4
真的
包裹
阴凉处
META-INF/cxf/bus-extensions.txt
*:*
META-INF/*.SF
META-INF/*.DSA
META-INF/*.RSA

从POM中删除此依赖项修复了我的错误

   <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>3.1.1</version>
    </dependency>

org.apache.cxf
cxf rt前端jaxws
3.1.1

我遇到了与此错误类似的情况,对于此问题,以下JAR的旧版本似乎也会出现

cxf-core-2.x.jar
cxf-rt-frontend-jaxrs-2.x.jar
cxf-rt-rs-client-2.x.jar
cxf-rt-transports-http-2.x.jar

当我切换到这些JAR的最新版本(撰写本文时为3.2.1)时,我已经解决了错误。

是(感谢您的回复!)。在我的MAVEN POM中,我有:org.apache.cxf cxf rt bindings soap${cxf.version}如果你有这种依赖关系,你不应该有问题:)我有一个与客户端在同一JBoss上的soap服务的问题。重要的是将此依赖项添加到客户机模块。@WillemJiang:“如果您有此依赖项,您不应该有问题”,但即使使用
cxf rt绑定soap
依赖项(以及
cxf rt transports http
cxf rt transports http jetty
和一系列其他cxf依赖项),在my pom.xml中,而且是100%有效的URL,我仍然在本地收到这个不清楚的错误消息(部署到服务器时效果很好)…非常好。直接从eclipse中运行JUnit测试没有问题,但需要添加此依赖项(具有测试范围),以便从命令行运行单元测试:mvn testAdding cxf rt transports http的依赖项要少得多,并且工作正常。已经添加了cxf-rt-transports-http,但仍然存在相同的错误。在Tomcat中运行此功能是否有人知道需要此依赖关系的原因?我认为在Intellij IDE上一切正常,但maven surefire不起作用。Intellij JUnit运行程序是否具有此依赖关系?或者URLI中的一个额外空间在导致此问题的属性值中具有额外空间。这意味着您已从CXF切换到JAX-WS的默认JDK实现。请参阅以了解差异。
cxf-core-2.x.jar
cxf-rt-frontend-jaxrs-2.x.jar
cxf-rt-rs-client-2.x.jar
cxf-rt-transports-http-2.x.jar