title: Is method-entry-point-resolver able to cast the argument to a base class?
body: <p>I am trying to get a method-entry-point-resolver to cast the payload to a base class, as indicated by the argument of the requested method. However, Mule is not doing that. What could I be doing wrong?</p>
  
  <p>That is, given the following configuration:</p>
  
  <pre><code>&lt;mule ...&gt;
      &lt;spring:bean id="FooBean" class="foo.Foo" /&gt;
  
      &lt;flow name="test"&gt;
          &lt;vm:inbound-endpoint name="test.Name" path="test.Path" exchange-pattern="request-response" /&gt;
  
          &lt;component&gt;
              &lt;method-entry-point-resolver&gt;
                  &lt;include-entry-point method="bar" /&gt;
              &lt;/method-entry-point-resolver&gt;
              &lt;spring-object bean="FooBean" /&gt;
          &lt;/component&gt;        
      &lt;/flow&gt;
  &lt;/mule&gt;
  </code></pre>
  
  <p>and given foo.Foo:</p>
  
  <pre><code>package foo;
  
  public class Foo {
  
      public Foo() {
      }
  
      public String bar(final Object anObject) {
          return "bar";
      }
  
  }
  </code></pre>
  
  <p>I would expect the following test to pass, but it does not. That is, the payload that I am sending to the flow is an <code>Integer</code> and I am expecting Mule to pass it as an argument to <code>Foo::bar</code>:</p>
  
  <pre><code>@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());
  }
  </code></pre>
  
  <p>Instead, the logs show an error. Here is a relevant snippet:</p>
  
  <pre><code>
  ...
  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}"
  
  </code></pre>