使用FactoryBeanPostProcessor时,来自ibatis的NullPointerException

时间:2018-09-12 16:07:47

标签: spring nullpointerexception ibatis

我通过自定义的BeanFactoryPostProcessor修改了一些bean定义 Web应用程序启动时失败:

    @Component
public class RPCTimeoutPostProcessor implements BeanFactoryPostProcessor {
    private static final Logger LOGGER = LoggerFactory.getLogger(RPCTimeoutPostProcessor.class);


    @Override
    public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException {
        overriderThriftTimeoutPolicy(beanFactory);
    }

    private void overriderThriftTimeoutPolicy(ConfigurableListableBeanFactory beanFactory) {
        Map<String, ThriftClientProxy> map = beanFactory.getBeansOfType(ThriftClientProxy.class);
        Set<String> keySet = map.keySet();
    }
}
  

[警告]上下文o.m.j.p.JettyWebAppContext的启动失败   org.springframework.beans.factory.UnsatisfiedDependencyException:   创建名称为“ baseSystemApi”的bean时出错:不满意的依赖关系   通过字段“ appConfigService”表示;嵌套异常为   org.springframework.beans.factory.BeanCreationException:错误   创建名称为“ appConfigService”的bean:初始化方法的调用   失败嵌套的异常是org.mybatis.spring.MyBatisSystemException:   嵌套的异常是org.apache.ibatis.exceptions.PersistenceException:   查询数据库时出错。原因:java.lang.NullPointerException   com / xxx / dao / WmAppTextDao.java中可能存在错误(最佳猜测)   错误可能涉及com.xxx.dao.WmAppTextDao.getAll发生错误   执行查询时原因:java.lang.NullPointerException在   org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor $ AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:588)

0 个答案:

没有答案