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 ...
随机推荐
- spring_150803_component
实体类: package com.spring.model; public class DogPet { private int id; private String name; private in ...
- 求一个全排列函数: 如p([1,2,3])输出:[123],[132],[213],[231],[312],[321]. 求一个组合函数 如p([1,2,3])输出:[1],[2],[3],[1,2],[2,3],[1,3],[1,2,3]
深度搜索的代码: #include<stdio.h> #include<string.h> ; int n; int a[Max]; bool b[Max]; void Dfs ...
- MyBatis学习总结_03_优化MyBatis配置文件中的配置
一.连接数据库的配置单独放在一个properties文件中 之前,我们是直接将数据库的连接配置信息写在了MyBatis的conf.xml文件中,如下: 1 <?xml version=" ...
- Java:Collection集合类
特点:只能用于存储对象,集合长度时可变的,集合可以存储不同类型的对象. 数组和集合类同时容器,不同的是: 1.数组虽然也可以存储对象,但是长度是固定的:集合长度时可变的. 2.数组中可以存储基本数据类 ...
- Spring AOP术语
1.AOP术语 1)连接点(Joinpoint) 程序执行的某个特定位置:如类开始初始化前.类初始化后.类某个方法调用前.调用后.方法抛出异常后.一个类或一段程序代码拥有一些具有边界性 ...
- 实际操作中命令 su 与 sudo 的区别(转)
------------------------------------------------------------------------------------------------ 首先我 ...
- 无图片,用css border实现尖三角
<!DOCTYPE HTML> <html> <head> <meta charset="gbk" /> <style typ ...
- 巧用cssText属性批量操作样式
给一个HTML元素设置css属性,如 1 2 3 4 var head= document.getElementById("head"); head.style.width = & ...
- 干货:yii日志功能详解
转载请注明来自souldak,微博:@evagle 一.基本日志功能 详细的介绍查看官网的document:http://www.yiiframework.com/doc/guide/1.1/en/t ...
- ubuntu 14.04 与 CentOS 升级GCC/G++至5版本
# 支持 ubuntu 14.04 add-apt-repository ppa:ubuntu-toolchain-r/test && apt-get update apt-get i ...