java-No exception of type ConfigurationException can be thrown; an exception type must be a subclass...

功能:读配置文件

java菜鸟:导入工程在报名处就开始报错,第一次遇到

import org.apache.commons.lang3.StringUtils;

import org.apache.commons.configuration.ConfigurationException;

package com.test;

The type org.apache.commons.lang.exception.NestableException cannot be resolved. It is indirectly referenced from required .class files

catch (ConfigurationException e)

No exception of type ConfigurationException can be thrown; an exception type must be a subclass of Throwable

 

原因:

http://hi.baidu.com/virackt/item/8534b95d49ce78d4d48bac4d

No exception of type ConfigurationException can be thrown; an exception type must be a subclass of Throwable

后来查了一下居然是因为这个类里面定义的configurationException是继承了lang里面的NestableException

要同时引入两个包才能使用这个类。貌似apache很多jar包都是相互牵连,用一个功能就得加载好几个包

由于lang3中已经没有NestableException这个异常类了,所以使用configuration会出现异常,所以改用lang2.6问题就解决了

总结:

使用configuration,要有对用版本lang才可以

 

转载于:https://www.cnblogs.com/Pierre-de-Ronsard/p/3985942.html

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值