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才可以

时间: 2024-10-04 12:06:30

java-No exception of type ConfigurationException can be thrown; an exception type must be a subclass of Throwable的相关文章

IOS Exception 1(libc++abi.dylib: terminating with uncaught exception of type NSException)

2014-08-05 22:18:46.455 SwiftUI[1329:40871] -[_TtC7SwiftUI14MViewControler clickMe]: unrecognized selector sent to instance 0x10ea15dc0 2014-08-05 22:18:46.458 SwiftUI[1329:40871] *** Terminating app due to uncaught exception 'NSInvalidArgumentExcept

使用Spire组件抛出异常The type initializer for 'spr857' threw an exception

使用Spire组件抛出异常The type initializer for 'spr857' threw an exception 我使用免费的Spire.Xls组件尝试去转换Excel文档到PDF文档,在执行下面第二行代码,也就是做加载文档这步时,抛出了异常"The type initializer for 'spr857' threw an exception" Workbook workbook = new Workbook(); workbook.LoadFromFile(&q

错误: 代理抛出异常错误: java.rmi.server.ExportException: Port already in use: 1099; nested exception is: java.net.BindException: Address already in use: JVM_Bind

错误: 代理抛出异常错误: java.rmi.server.ExportException: Port already in use: 1099; nested exception is: java.net.BindException: Address already in use: JVM_Bind 在使用SpringMVC测试的时候, 遇到了这样一个问题, 说的是端口已经被使用了 代理抛出异常错误: java.rmi.server.ExportException: Port already

java.rmi.server.ExportException: Port already in use: 7888; nested exception is: java.net.BindException: Address already in use: JVM_Bind 报错解决

1. 问题描述 运行多个 spring boot 程序,出现报错 java.rmi.server.ExportException: Port already in use: 7888; nested exception is: java.net.BindException: Address already in use: JVM_Bind.网上查找相关问题多数是叫结束占用端口的进程,但是占用该端口的进程实际上也是需要启动的 spring boot 程序,关掉进程,程序也将停止. 2. 问题解决

关于Failed to convert property value of type [org.quartz.impl.StdScheduler] to required type [org.springframework.scheduling.quartz.SchedulerFactoryBean

在一个业务类有下列属性 private SchedulerFactoryBeanscheduler; public SchedulerFactory BeangetScheduler() { return scheduler; } public void setScheduler(SchedulerFactoryBean scheduler) { this.scheduler = scheduler; } 用spring 进行装配: <property name="scheduler&qu

解决warning: format ‘%x’ expects type ‘unsigned int’, but argument 2 has type ‘int *’

[[email protected] c]# gcc MemTest.c -o MemTest1 -WallMemTest.c: In function 'main':MemTest.c:24: warning: format '%x' expects type 'unsigned int', but argument 2 has type 'int *'MemTest.c:39: warning: format '%x' expects type 'unsigned int', but arg

C++: Type Conversion (数字,指针,其他type)

参考材料:C++ primer 5th, 4.11 起因是UNIX中一些函数返回void *指针,使用之前要转换成char *指针使用,不清楚会出现什么现象,所以找到type conversion来看 ************************************************************************************* 第一部分是implicit conversion **************************************

解决&quot;415 Cannot process the message because the content type &#39;application/x-www-form-urlencoded&#39; was not the expected type &#39;text/xml; charset=utf-8&#39;&quot;

wcf basicHttpBinding content-type    text/xml;charset=utf-8 wsHttpBinding  'application/soap+xml; charset=utf-8' webHttpBinding 'application/x-www-form-urlencoded'   对应网页中的post请求 所以如果是post请求wcf服务,要使用webHttpBinding 解决"415 Cannot process the message be

Thinking in Java,Fourth Edition(Java 编程思想,第四版)学习笔记(十四)之Type Information

Runtime type information (RTTI) allow you to discover and use type information while a program is running This take two forms: 1. "traditional" RTTI, which assumes that you have all the types available at compile time, 2. the reflection mechanis