I've got three classes
public abstract FoundationReport
{
public abstract FoundationDetails getDetails();
}
public abstract BaseReport extends FoundationReport
{
public abstract BaseDetails getDetails();
}
public Report extends BaseReport
{
ReportDetails reportDetails;
public ReportDetails getDetails()
{
return reportDetails
}
}
ReportDetails extends BaseDetails, BaseDetails extends FoundationDetails.
In my camel xml I've got a section:
<convertBodyTo type="path.to.Report" />
<when>
<simple>${body.details.type} == 'myself'</simple>
...
However the call to body.details.type results in:
Caused by: org.apache.camel.component.bean.AmbiguousMethodCallException:
Ambiguous method invocations possible:
[public path.to.ReportDetails path.to.Report.getDetails(),
public abstract path.to.BaseDetails path.to.BaseReport.getDetails(),
public abstract path.to.FoundationDetails path.to.FoundationReport()]
I had assumed (incorrectly) that the only concrete implementation of getDetails in the Report class would be used. Why am I getting this exception and how do I work around?
Its a bug in Apache Camel. I have reproduced it, and logged a ticket to get this fixed: https://issues.apache.org/jira/browse/CAMEL-9032
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With