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 ...
随机推荐
- 【hdu3579-Hello Kiki】拓展欧几里得-同余方程组
http://acm.hdu.edu.cn/showproblem.php?pid=3579 题解:同余方程组的裸题.注意输出是最小的正整数,不包括0. #include<cstdio> ...
- C#加密算法汇总
方法一: //须添加对System.Web的引用 using System.Web.Security; ... /// <summary> /// SHA1加密字符串 /// </s ...
- HttpWebRequest模拟登陆,存储Cookie以便登录请求后使用
[一篮饭特稀原创,转载请注明出自http://www.cnblogs.com/wanghafan/p/3284481.html] PostLogin :登录,并保存Cookie 1 public st ...
- VS编译的QT程序发布时产生的AppCrash问题
至少我碰到了三个情况,都是AppCrash错误(以下都指VS2008的Release的设置) 第1个错误,报错模块是程序自己 我使用VS2008 Team with SP1和QT4.86编译程序,一直 ...
- 【原创】Android 4.4前后版本读取图库图片方式的变化
Android 4.4前后版本读取图库图片方式的变化 本文讲述Android 4.4(KitKat)前后访问图库以及访问后通过图片路径读取图片的变化 Android 4.4(KitKat)以前 ...
- HtmlHelper
HtmlHelper类 public class HtmlHelper<TModel> : HtmlHelper类 因为HtmlHelper<TModel>继承自HtmlHel ...
- Linux下安装mysql-5.6.4 的图文教程
在开始安装前,先说明一下mysql-5.6.4与较低的版本在安装上的区别,从mysql-5.5起,mysql源码安装开始使用cmake了,因此当我们配置安装目录./configure --perfix ...
- uboot命令分析+实现【转】
转自:http://xouou.iteye.com/blog/2150061 先贴一个重要结构,位于uboot/include/command.h,这个结构代表每个uboot命令 struct cmd ...
- .Net MVC视图
1.View显示 return View(): 默认为/Views/<控制器>/<方法> return View("Test"); 显示/View/< ...
- Java中获取完整的url
Java中获得完整的URl字符串 HttpServletRequest httpRequest=(HttpServletRequest)request; String strBackUrl = &qu ...