問題は、私の概念の理解にも関連している可能性があります。
ActionClass
であるプロキシ Bean を呼び出していますAccountingInterface
。プロキシ Bean インターフェースはAccountingUtil
クラスで実装されます。したがってxml
、返されAccountingUtil
たものが通過しseda:accountingQueue
てコンソールにストリーミングされることを期待しています。
アプリケーションコンテキスト
<bean id="accountingInterface" class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
<property name="serviceUrl" value="seda:accountingQueue"/>
<property name="serviceInterface" value="acord.transaction.util.AccountingInterface"/>
</bean>
<route>
<from uri="seda:accountingQueue"/>
<setHeader headerName="nowInMillis">
<groovy>new Date().getTime()</groovy>
</setHeader>
<to uri="stream:out"/>
</route>
会計インターフェース
public interface AccountingInterface
{
void send(String xml);
String accountingUpdate(EDITDate accountingProcessDate);
}
AccountingUtil
public class AccountingUtil implements AccountingInterface
{
public String accountingUpdate(EDITDate accountingProcessDate)
{
//doSomething
return xml;
}
アクションクラス
AccountingInterface accountingInterface = (AccountingInterface) AppContext.getBean("accountingInterface");
accountingInterface.accountingUpdate(accountingProcessDate);
しかし、例外が発生しています:
No body available of type: java.lang.String but has value: BeanInvocation public abstract java.lang.String acord.transaction.util.AccountingInterface.accountingUpdate(edit.common.EDITDate) with [2012/11/08]] of type: org.apache.camel.component.bean.BeanInvocation on: Message: BeanInvocation public abstract java.lang.String acord.transaction.util.AccountingInterface.accountingUpdate(edit.common.EDITDate) with [2012/11/08]]. Caused by: No type converter available to convert from type: org.apache.camel.component.bean.BeanInvocation to the required type: java.lang.String with value BeanInvocation public abstract java.lang.String acord.transaction.util.AccountingInterface.accountingUpdate(edit.common.EDITDate) with [2012/11/08]]. Exchange[Message: BeanInvocation public abstract java.lang.String acord.transaction.util.AccountingInterface.accountingUpdate(edit.common.EDITDate) with [2012/11/08]]]. Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: org.apache.camel.component.bean.BeanInvocation to the required type: java.lang.String with value BeanInvocation public abstract java.lang.String acord.transaction.util.AccountingInterface.accountingUpdate(edit.common.EDITDate) with [2012/11/08]]]
at org.apache.camel.impl.MessageSupport.getMandatoryBody(MessageSupport.java:101)
もう1つの問題serviceURL
シングルに対して複数を使用できますproxyBean(interface)
か?
異なる方法で、異なるserviceURL
が単一のインターフェイスの一部を呼び出す必要があります。