Java-no exception of type ConfigurationException can be thrown; An exception type must is a subclass of Throwable

Source: Internet
Author: User

Function: Read configuration file

Java Rookie: Import Project at the registration office began to error, the first time encountered

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 is a subclass of Throwable

Reason:

Http://hi.baidu.com/virackt/item/8534b95d49ce78d4d48bac4d

No exception of type ConfigurationException can be thrown; An exception type must is a subclass of Throwable

later, it is because the definition of the configurationexception in this class is inherited by Lang inside the nestableexception.

It is necessary to introduce two packages at a time to use this class. It seems that many of the Apache jar packages are interrelated, with a function to load several packages

Because there is no lang3 in the nestableexception this exception class, so the use of the configuration will be an exception, so instead of lang2.6 problem solved

Summarize:

With configuration, you have to use version lang to

Java-no exception of type ConfigurationException can be thrown; An exception type must is a subclass of Throwable

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.