title: apache camel : Ambiguous method invocations possible : JmsMessage
body: <p>I'm using apache camel 2.12.1 and I have problem with my multiple onException statements. My route looks like:</p>
  
  <p>
      </p>
  
  <pre><code>&lt;onException redeliveryPolicyRef="redeliveryPolicy1"&gt;
      &lt;exception&gt;com.somePackage.Exception1&lt;/exception&gt;
      &lt;handled&gt;
         &lt;constant&gt;true&lt;/constant&gt;
      &lt;/handled&gt;
      &lt;bean ref="errorHandler" /&gt;
  &lt;/onException&gt;
  
  
  &lt;onException redeliveryPolicyRef="redeliveryPolicy2"&gt;
      &lt;exception&gt;com.somePackage.Exception2&lt;/exception&gt;
      &lt;handled&gt;
         &lt;constant&gt;true&lt;/constant&gt;
      &lt;/handled&gt;
      &lt;bean ref="errorHandler" /&gt;
  &lt;/onException&gt;
  
  
  &lt;onException redeliveryPolicyRef="redeliveryPolicy3"&gt;
      &lt;exception&gt;java.lang.Exception&lt;/exception&gt;
      &lt;handled&gt;
         &lt;constant&gt;true&lt;/constant&gt;
      &lt;/handled&gt;
      &lt;bean ref="errorHandler" /&gt;
  &lt;/onException&gt;
  
  &lt;bean ref="bean1" /&gt;
  &lt;bean ref="bean2" /&gt;
  &lt;bean ref="bean3" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>In cases Exception1 or Exception2 occured while processing in beans my errorHandler is properly invoked(correct method binding). But in some other cases when let's say bean2 throws SomeOtherException I have problems with the last onException statement. </p>
  
  <p>The error I get is:</p>
  
  <p>Ambiguous method invocations possible: [Bean2.method1(Foo1), Bean2.method2(Foo2), Bead2.method3(Foo3) ]. Exchange[<em>JmsMessage</em>[JmsMessageID: ]]</p>
  
  <p>Probably camel gets Exchange which is JmsMessage instead of my classes Foo1, Foo2. How to solve this?</p>