I have a setup resembling:

public interface Transformer<I,O> {
        public O transform(I input);
}

public class CollectionTransformer<I, O> implements
Transformer<Collection&lt;I>, O> {
        private Factory<String, O> factory;

        @Override
        public O transform(Collection input) {
                return factory.create("something");
        }
}

public class AnotherCollectionTransformer extends
CollectionTransformer<String, Long> {
        @Override
        public Long transform(Collection<String> input) {
                return super.transform(input);
        }
}

<bean id="transformer" class="AnotherCollectionTransformer" />

<route>
  <from uri="direct:aaa" />
  <bean ref="transformer" method="transform" />
</route>


I get an error similar to this:

org.apache.camel.RuntimeCamelException:
org.apache.camel.component.bean.AmbiguousMethodCallException: Ambiguous
method invocations possible: [public java.lang.Long
AnotherCollectionTransformer.transform(java.util.Collection), public
java.lang.Object CollectionTransformer.transform(java.util.Collection)].
Exchange[Message: java.lang.String@21faa3c5]

How can I get this to choose the subclass method?



--
View this message in context: 
http://camel.465427.n5.nabble.com/AmbiguousMethodCallException-on-override-methods-tp5720931.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to