初学dubbo框架,在项目开发进行单元测试时候,一直出现如下的报错:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.alibaba.dubbo.config.ProviderConfig': Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateException; nested PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.MethodInvocationException: Property 'filter' threw exception; nested exception is java.lang.IllegalStateException: No such extension businessException for filter/com.alibaba.dubbo.rpc.Filter
看到网上有说IllegalStateException一般是配置的问题,就仔细检查dubbo-provider.xm文件,发现以下语句比较可疑:
<dubbo:provider filter="-exception,businessException" />
由于在com.alibaba.dubbo.rpc.Filter文件中进行了配置:
businessExceptionFilter=com.dianwoba.alliance.recharge.filter.BusinessExceptionFilter
那么这里dubbo filter参数的配置不应该是businessExceptionFilter吗?
于是解决了这个问题。当前需求是在之前的项目上进行功能开发(有的开发人员真挺坑的),因为这个问题是在单元测试中,所以没有引发问题,但是也让我踩了这么个小坑。