Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-11235

Simple Language: AmbiguousMethodCallException when calling method implemented by super class when method is defined by interface and abstract class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.19.0
    • 2.19.1, 2.20.0
    • camel-core
    • None
    • Unknown
    • Regression

    Description

      After updating from 2.18.3 to 2.19.0 the following simple expression:

      ${headers.materialnumbers.size} != 0

      (materialnumbers is a LinkedHashSet) fails with:

      2017-05-08 09:10:17,143 ERR [main] org.apache.camel.processor.DefaultErrorHandler - Failed delivery for (MessageId: ID-RDDE102Y-57877-1494227416153-0-1 on ExchangeId: ID-RDDE102Y-57877-1494227416153-0-2). Exhausted after delivery attempt: 1 caught: org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: size on null due to: org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous method invocations possible: [public abstract int java.util.Set.size(), public abstract int java.util.AbstractCollection.size()]. Exchange[]
      
      Message History
      ---------------------------------------------------------------------------------------------------------------------------------------
      RouteId    ProcessorId          Processor                                                                        Elapsed (ms)
      [Read TB ] [Read TB           ] [                                                                              ] [        67]
      [Read TB ] [choice1           ] [when[simple{Simple: ${headers.materialnumbers.size} != 0}]choice[]            ] [        62]
      
      Stacktrace
      ---------------------------------------------------------------------------------------------------------------------------------------
      org.apache.camel.language.bean.RuntimeBeanExpressionException: Failed to invoke method: size on null due to: org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous method invocations possible: [public abstract int java.util.Set.size(), public abstract int java.util.AbstractCollection.size()]. Exchange[]
      	at org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:327)
      	at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:115) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.language.bean.BeanExpression.evaluate(BeanExpression.java:139) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.model.language.ExpressionDefinition.evaluate(ExpressionDefinition.java:126) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.model.language.ExpressionDefinition.evaluate(ExpressionDefinition.java:118) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.builder.ExpressionBuilder$KeyedOgnlExpressionAdapter.evaluate(ExpressionBuilder.java:2490) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.support.ExpressionAdapter.evaluate(ExpressionAdapter.java:36) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.builder.BinaryPredicateSupport.matchesReturningFailureMessage(BinaryPredicateSupport.java:60) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.builder.BinaryPredicateSupport.matches(BinaryPredicateSupport.java:50) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.language.simple.ast.BinaryExpression$5.evaluate(BinaryExpression.java:233) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.util.ExpressionToPredicateAdapter.matches(ExpressionToPredicateAdapter.java:37) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.builder.SimpleBuilder.matches(SimpleBuilder.java:85) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.processor.FilterProcessor.matches(FilterProcessor.java:65) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:93) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:97) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:529) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:497) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:365) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:497) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:209) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:139) [camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:374) [camel-core-2.19.0.jar:2.19.0]
      Caused by: org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous method invocations possible: [public abstract int java.util.Set.size(), public abstract int java.util.AbstractCollection.size()]. Exchange[]
      	at org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:278) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.component.bean.BeanInfo.createInvocation(BeanInfo.java:189) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:160) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:69) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.language.bean.BeanExpression$InvokeProcessor.process(BeanExpression.java:212) ~[camel-core-2.19.0.jar:2.19.0]
      	at org.apache.camel.language.bean.BeanExpression$OgnlInvokeProcessor.process(BeanExpression.java:323) ~[camel-core-2.19.0.jar:2.19.0]
      

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              pascalschumacher Pascal Schumacher
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: