java-No exception of type ConfigurationException can be thrown; an exception type must be a subclass of Throwable
功能:读配置文件
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才可以
java-No exception of type ConfigurationException can be thrown; an exception type must be a subclass of Throwable的更多相关文章
- Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com.test.bean.groupMapper is not known to the MapperRegistry.
Exception in thread "main" org.apache.ibatis.binding.BindingException: Type interface com. ...
- org.springframework.beans.TypeMismatchException: Failed to convert property value of type 'null' to required type 'double' for property 'band'; nested exception is org.springframework.core.convert.Con
本文为博主原创,未经允许不得转载: 先将异常粘贴出来: 20:37:26,909 ERROR [com.suning.fucdn.controller.ProductDataStaticsContro ...
- Java之POI读取Excel的Package should contain a content type part [M1.13]] with root cause异常问题解决
Java之POI读取Excel的Package should contain a content type part [M1.13]] with root cause异常问题解决 引言: 在Java中 ...
- 使用Spire组件抛出异常The type initializer for 'spr857' threw an exception
使用Spire组件抛出异常The type initializer for 'spr857' threw an exception 我使用免费的Spire.Xls组件尝试去转换Excel文档到PDF文 ...
- HibernateProxy异常处理 java.lang.UnsupportedOperationException: Attempted to serialize java.lang.Class: org.hibernate.proxy.HibernateProxy. Forgot to register a type adapter?
这里使用google的Gson包做JSON转换,因为较早的1.4版本的FieldAttributes类中没有getDeclaringClass()这个方法,这个方法是获取field所属的类,在我的排除 ...
- ASP.Net Core "The type initializer for 'Gdip' threw an exception"
ASP.NET Core项目部署在Linux下可能会出现GDI错误 The type initializer for 'Gdip' threw an exception 解决方案:创建 libdl 的 ...
- Attempted to serialize java.lang.Class: org.hibernate.proxy.HibernateProxy. Forgot to register a type adapter?
当我们使用gson 转对象时,并且这个对象中有一些属性是懒加载时如 @Entity @Table(name = "user") public class User { @Id @C ...
- java.rmi.server.ExportException: Port already in use: 1099; nested exception is
现象 mac上tomcat启动时报错: java.rmi.server.ExportException: Port already in use: 1099; nested exception is. ...
- Exception of type 'System.OutOfMemoryException' was thrown
最近刚换了服务器,开始测试的时候未发现什么问题,可是一旦同一时间段操作的人比较多的时候,就会抛出如下错误: Server Error in '/' Application. Exception of ...
随机推荐
- 经典SQL查询语句大全
一.基础1.说明:创建数据库CREATE DATABASE database-name2.说明:删除数据库drop database dbname3.说明:备份sql server--- 创建 备份数 ...
- Centos环境下部署游戏服务器-编译
游戏服务器是在windows环境开发的,相关跨平台的东西在这里不谈了,只谈如何将Visual Studio 工程转换到Linux下编译.这里涉及到的软件分别为:Centos版本为6.4,Visual ...
- 计算CRC校验值(CRC16和CRC32)(网络传输检验)
CRC有非常多的模式,我没有全部都做,目前支持 CRC16-Modbus CRC16-X25 CRC32 使用方法 auto data = QByteArray::fromHex( "01 ...
- 【web性能】页面呈现、重绘、回流
在讨论页面重绘.回流之前.需要对页面的呈现流程有些了解,页面是怎么把html结合css等显示到浏览器上的,下面的流程图显示了浏览器对页面的呈现的处理流程.可能不同的浏览器略微会有些不同.但基本上都是类 ...
- 275. H-Index II
题目: Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optim ...
- ruby脚本,随机生成复杂密码
简单版本: base_char = (32..126).map{|i|i.chr} - ["'",'"'," ", "`",&qu ...
- 蒙特罗卡π算法(C++语言描述)
圆的面积计算公式为:S=π*r*r 将圆放到一个直角坐标系中,如图黄色部分的面积是S/4=(π*r*r)/4;如果我们将取一个单位圆,则S/4=π/4. 因为是单位圆,半径为1,所以图中红色正方形的面 ...
- ISE MAP报错: Unsupported programming for BSCAN block and JTAG_CHAIN attribute value 1的解决方法
2014-04-16 17:35:30 ISE MAP报错: Unsupported programming for BSCAN block and JTAG_CHAIN attribute valu ...
- Android 代码监控apk安装,卸载,替换
public class GetBroadcast extends BroadcastReceiver { private static GetBroadcast mReceiver = new Ge ...
- 安装hadoop
生成yum源 cd /var/ftp/pub/cdh/5 createrepo --update . 从节点 yum clean all 配置yum库 /etc/yum.repos.d # cat / ...