NoClassDefFoundError异常

  今天开发的时候,调用接口实例化的时候,报NoClassDefFoundError错误,意思是”找不到类“,是指编译通过运行不行。

  代码:IApiApply api = NCLocator.getInstance().lookup(IApiApply.class);,获取实现类ApiApplyImpl的对象,这行代码报错,查找原因是实现类中引用了配置文件的内容,结果配置文件未配置所需要的东西,实例化报错,抛出该异常。

引用配置文件代码:private static final ResourceBundle resourceBundle = ResourceBundle.getBundle("nc.itf.ecton.pub.common.EctonInterfaceConfig");

private static final String APPLYFILEURL = resourceBundle.getString("apply_file");

配置文件中未配置apply_file。

原文地址:https://www.cnblogs.com/xint/p/11771441.html