2012-01-25 4 views
0

私はServiceMix 4.4.0から単純なactivemq-camel-blueprintの例をとり、ASCII行から読み込むためにMina TCPソケットに追加しました。Apache CamelとMina(Karaf)の簡単な例CamelExchangeException:本文を書き込めません

<camelContext xmlns="http://camel.apache.org/schema/blueprint"> 
    <route> 
     <from uri="mina:tcp://localhost:4001?textline=true&amp;sync=false" /> 
     <bean ref="NMEAString" method="ingest" /> 
     <to uri="activemq:queue:LOG.ME"/> 
    </route> 
    <route> 
     <from uri="activemq:queue:LOG.ME" /> 
     <to uri="log:ExampleActiveMQRouterBlueprint" /> 
    </route> 
</camelContext> 

私はこの例をKaraf内で実行しています。すべてのNMEAStringはオブジェクトをSTDOUTに出力します。

ASCIIファイルをソケット接続にプッシュする小さなプログラムを実行します。それは数ミリ秒でファイル全体(〜40)行をプッシュします。

私は、行間の約30秒でKaraf内でSTDOUT印刷物を見ることができます。 私のservicemix.logファイル内で以下の例外が発生しています:

誰もがこの例外の意味を知っていますか?そのような単純な理由でそれを投げているのはなぜですか? ?

org.apache.camel.CamelException:org.apache.camel.CamelExchangeException:本文を書き込めません。 Exchange [メッセージ:[Body is null]] at org.apache.camel.component.mina.MinaConsumer $ ReceiveHandler.exceptionCaught(MinaConsumer.java:91)[186:org.apache.camel.camel-mina:2.8.3 ] at org.apache.mina.common.support.AbstractIoFilterChain $ TailFilter.exceptionCaught(AbstractIoFilterChain.java:564)[187:org.apache.servicemix.bundles.mina:1.1.7.5] at org.apache.mina。 (AbstractIoFilterChain.java:345)[187:org.apache.servicemix.bundles.mina:1.1.7.5] at org.apache.mina.common.support.AbstractIoFilterChain.access $ 1000(AbstractIoFilterChain。 java:53)[187:org.apache.servicemix.bundles.mina:1.1.7.5] at org.apache.mina.common.support.AbstractIoFilterChain $ EntryImpl $ 1.exceptionCaught(AbstractIoFilterChain.java:643)[187:org .apache.servicemix.bundles.mina:1.1.7.5] at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java:224)[187:org.apache.servicemix.bundles.mina:1.1.7.5] at org.apache.mina.filter.executor .ExecutorFilter $ ProcessEventsRunnable.run(ExecutorFilter.java:264)[187:org.apache.servicemix.bundles.mina:1.1.7.5] at java.util.concurrent.ThreadPoolExecutor $ Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29] at java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_29] at java.lang.Thread.run(Thread.java:662)[: 1.6.0_29] 原因:org.apache.camel.CamelExchangeException:本文を書き込めません。 Exchange [メッセージ:[Body is null]] at org.apache.camel.component.mina.MinaHelper.writeBody(MinaHelper.java:55)[186:org.apache.camel.camel-mina:2.8.3] org.apache.camel.component.mina.MinaConsumer $ ReceiveHandler.messageReceived(MinaConsumer.java:148)[186:org.apache.camel.camel-mina:2.8.3] at org.apache.mina.common。 (AbstractIoFilterChain.java:570)[187:org.apache.servicemix.bundles.mina:1.1.7.5] at org.apache.mina.common.support.AbstractIoFilterChain.callNextMessageReceived(AbstractIoFilterChain.java) :299)[187:org.apache.servicemix.bundles.mina:1.1.7.5] at org.apache.mina.common.support.AbstractIoFilterChain.access $ 1100(AbstractIoFilterChain.java:53)[187:org.apache。 servicemix.bundles.mina:1.1.7.5] at org.apache.mina.common.support.Abstract IoFilterChain $ EntryImpl $ 1.messageReceived(AbstractIoFilterChain.java:648)[187:org.apache.servicemix.bundles.mina:1.1.7.5] at org.apache.mina.filter.executor.ExecutorFilter.processEvent(ExecutorFilter.java: 220)[187:org.apache.servicemix.bundles.mina:1.1.7.5] ... 4 more

+0

、それ次のものと関係があります: – user297500

答えて

0

LS、

Apache ServiceMix 4.4.0でこれを試してみましたが、以下の青写真のファイルがうまく動作するので、あなたのBeanが何らかの形でメッセージの本文を無効にしたり削除したりしていると思われます(例:getOut()空のメッセージかそのようなもの)。

実際に問題の原因であることを確認するためにルートからBeanを削除してみることができますか?もしそうであれば、まあ豆自体のコードを投稿すること自由に感じ、私たちは、あなたがそこに潜んだ問題を探すことができます...

よろしく、

ゲルト

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> 

<camelContext xmlns="http://camel.apache.org/schema/blueprint"> 
    <route> 
    <from uri="mina:tcp://localhost:4001?textline=true&amp;sync=false" /> 
    <to uri="log:test-read-stream"/> 
    <to uri="activemq:queue:LOG.ME"/> 
    </route> 
    <route> 
    <from uri="activemq:queue:LOG.ME" /> 
    <to uri="log:ExampleActiveMQRouterBlueprint" /> 
    </route> 
</camelContext> 

</blueprint> 
関連する問題