要求されたメソッドの引数で示されているように、ペイロードを基本クラスにキャストするメソッド エントリ ポイント リゾルバーを取得しようとしています。しかし、Mule はそうではありません。私は何が間違っているのでしょうか?
つまり、次の構成が与えられます。
<mule ...>
<spring:bean id="FooBean" class="foo.Foo" />
<flow name="test">
<vm:inbound-endpoint name="test.Name" path="test.Path" exchange-pattern="request-response" />
<component>
<method-entry-point-resolver>
<include-entry-point method="bar" />
</method-entry-point-resolver>
<spring-object bean="FooBean" />
</component>
</flow>
</mule>
与えられた foo.Foo:
package foo;
public class Foo {
public Foo() {
}
public String bar(final Object anObject) {
return "bar";
}
}
次のテストに合格することを期待していますが、そうではありません。つまり、フローに送信するペイロードは であり、Integer
Mule がそれを引数として に渡すことを期待していますFoo::bar
。
@Test
public void methodEntryPointResolverUpcasts() throws MuleException {
final MuleClient client = muleContext.getClient();
final MuleMessage reply = client.send("vm://test.Path", new Integer(1), null, RECEIVE_TIMEOUT);
assertEquals("bar", reply.getPayload());
}
代わりに、ログにエラーが表示されます。関連するスニペットは次のとおりです。
...
Message : Failed to find entry point for component, the following resolvers tried but failed: [
ExplicitMethodEntryPointResolver: Could not find entry point on: "foo.Foo" with arguments: "{class java.lang.Integer}"
]
...
Exception stack is:
1. Failed to find entry point for component, the following resolvers tried but failed: [
ExplicitMethodEntryPointResolver: Could not find entry point on: "foo.Foo" with arguments: "{class java.lang.Integer}"