NetBeans 6 Bug - ConfigurationException Class in Apache Common Configuration is not Throwable? Wednesday, Dec 12 2007
English and Java and Programming apache, bug, common, configuration, netbeans 6, throwable 3:17 pm
When I using Netbeans 6 (final released) and using Apache Common Configuration library, I encounter this bug.
Here’s how I found the bug :
- Create a java application project
- Add the library, I create a library name ‘Apache_Common_Configuration’ and add commons-configuration-1.5.jar to that library
- Then I wrote the code
public static void main(String[] args) {
try {
INIConfiguration ini = new INIConfiguration(”sample.ini”);
} catch (ConfigurationException ex) {
ex.printStackTrace();
}
}
- But the editor showing error on ‘ConfigurationException ex’ saying that ConfigurationException is not subclass of Throwable Class (I’ve upload the screenshot)
- When I try to build it’s showing different error “class file for org.apache.commons.lang.exception.NestableException not found”
- It’s look like Apache Common Configuration is using Apache Common Lang library (I also look to the source-code ‘ConfigurationException extends NestableException’). Error when compile showing me more help than error in editor.
- So I create a library name ‘Apache_Common_Lang’ and add commons-lang-2.3.jar to that library
- After add the library the editor still showing the same error : “ConfigurationException is not subclass of Throwable Class”
- But when I run build, it run successful . No error at all. (Now I confused)
- It’s look like there’s a bug in the Editor. And that red line & error icon in project window really bugging me, although I know it’s the editor bug not my code error.
- So to make this ‘red-line’ disappeared, I combined commons-configuration-1.5.jar & commons-lang-2.3.jar into 1 jar file. And set a library to this jar (instead using 2 library or 2 jar file).
- After this combined the editor not showing the error again.
Anyone having this problem too?
You can vote for this bug on : http://www.netbeans.org/issues/show_bug.cgi?id=124241

January 2, 2008 at 9:02 pm
I can reproduce it as well, the suitable workaround should be either add both jars as single jars (not as libraries) or to create one library containing both jars
January 3, 2008 at 9:50 am
Create 1 library consisting commons-configuration-x.jar & commons-lang-x.jar and add it to the project won’t make the editor stop showing the error.
Maybe the editor cannot recognize a Throwable class whose parent-class in different jar?
January 3, 2008 at 11:07 am
After several tries I found out that if commons-configuration-x.jar & commons-lang-x.jar are in 1 directory the editor won’t showing error.
It doesn’t matter whether they are on 1 or 2 libraries.
So the editor bug only happens if the jars on different directory.
January 9, 2008 at 12:03 am
I am having the same problem. Did you file a bug report? If you did please let me know the bug number so I can vote for it.
January 9, 2008 at 9:50 am
Yes. You can see the progress & vote for it at http://www.netbeans.org/issues/show_bug.cgi?id=124241