49

Apache CXF JaxWsServerFactoryBean をコンソール モードで使用すると (Java コマンド ラインでサーバーを起動しようとすると)、次のような例外が発生します。

Caused by: java.io.IOException: Cannot find any registered HttpDestinationFactory from the Bus.
        at org.apache.cxf.transport.http.HTTPTransportFactory.getDestination(HTTPTransportFactory.java:295)
        at org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(SoapTransportFactory.java:143)
        at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:93)
        at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:72)
        at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:160)

Spring 経由で Tomcat で同じサービス impl を使用すると、機能します。

<jaxws:endpoint id="abc" implementor="com.AbcServicePortTypeImpl" address="/abc">
4

6 に答える 6

8

たとえば、以下の構成があり、アドレスに http が追加されて定義されている場合、これは構成された CXFServlet への相対 URL ではありません。上記のエラーが発生します。

<jaxrs:server id="helloRestService" address="http://...">
        <jaxrs:serviceBeans>
            <ref bean="helloService" />
        </jaxrs:serviceBeans>
</jaxrs:server>

解決策は、アドレスに http/https を追加せずに相対 URL を指定するだけです。

http://grokbase.com/t/camel/users/155f1smn4v/error-cannot-find-any-registered-httpdestinationfactory-from-the-bus

于 2016-03-27T02:35:09.027 に答える
3

私も同じ問題を抱えていました。そして、グーグルのものはどれも意味を成していませんでした。私の場合、春のコンテキストファイルに次のものが欠けていることがわかりました。

   <import resource="classpath:META-INF/cxf/cxf.xml" />
   <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
   <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
于 2013-06-07T18:19:23.350 に答える
3

CSV 2.7.15 で動作する別のソリューション: を作成するときにBus、拡張子を登録します。

ServletDestinationFactory destinationFactory = new ServletDestinationFactory();
bus.setExtension(destinationFactory, HttpDestinationFactory.class);
于 2016-01-15T09:32:06.300 に答える