我有三類駱駝AmbiguousMethodCallException抽象類
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延伸BaseDetails,BaseDetails延伸FoundationDetails。
在我的駱駝XML我有一個部分:
<convertBodyTo type="path.to.Report" />
<when>
<simple>${body.details.type} == 'myself'</simple>
...
但是調用body.details.type的結果:
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()]
我本以爲(錯誤地),唯一將使用Report類中getDetails的具體實現。爲什麼我得到這個例外,我該如何解決?
你使用什麼版本的駱駝? –
我們使用的版本是2.15 – Airomega
您是否也可以在課堂上添加摘要 –