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 ...
随机推荐
- OSX Mavericks下使用Synergy进行多台主机通过wifi共享键鼠问题的解决方法
转帖: OSX 10.9 几天用下来还是遇到几处问题的:之前先是遇到了OSX Mavericks GM598无法从Appstore升级到完全正式版的问题,下载无反应,后来找到了解决方法,发在以下链接: ...
- [Microsoft][ODBC Microsoft Access Driver] INSERT INTO 语句的语法错误。
遇到的情景: sta.executeUpdate("insert into 表1(longitude,latitude,time) values("+a[0]+",&qu ...
- python_pycharm介绍1
1. 常用设置 修改编程风格 File-Setting中,Editor下Colors&Fonts修改即可调整风格. 修改字体大小 pycharm默认字体太小,需调整些,Settings--&g ...
- libevent功能使用简介
http://blog.csdn.net/happyanger6/article/details/7272324 1. 介绍 libevent是一个用来开发可扩展的网络服务器的事件通知函数库.当一个文 ...
- 在telnet下操作memcache详解(操作命令详解)
这篇文章主要介绍了在telnet下操作memcache详解,telnet下的memcache操作命令详解,需要的朋友可以参考下 在定位问题.测试等时候经常需要对memcache的数据进行一些操作,但是 ...
- [iOS]ios archives 出现的是other items而不是iOS Apps的解决方案
百度了一上午, 总是这样子. (利用cocoapods上传项目的时候, 总是这样无法点击UpLoad to App Store) 然后. 这样做. 就可以了!
- SQL语句 递归
--正向递归查询(根据ID查到自己和自己以下的所有数据) connect by prior a.id = a. parentid --反向递归查询(根据叶子ID查出自己和自己以上的根数据) ...
- Myeclipse2014配置JSF环境
首先创建一个普通的webproject,然后看官网教程喽 https://www.genuitec.com/products/myeclipse/learning-center/web/myeclip ...
- Eclipse 下如何删除一个项目的 SVN 信息
选中项目,右键 - Team - 断开连接 出现如下对话框,根据需要,选择 “删除”或者“不删除”,点击 Yes 即可
- echo "hello" | nc -4t -w1 localhost 8001
TCP4: echo "hello" | nc -4t -w1 localhost 8001 UDP4: echo "hello" | nc -4u -w1 l ...